All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test-media: Add basic tests for visl
@ 2024-02-28 16:56 Detlev Casanova
  0 siblings, 0 replies; only message in thread
From: Detlev Casanova @ 2024-02-28 16:56 UTC (permalink / raw
  To: linux-kernel; +Cc: linux-media, Hans Verkuil, Detlev Casanova

This will run the v4l2-compliance tests on the visl device, check
(un)binding and module reloading.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
 contrib/test/test-media | 80 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 78 insertions(+), 2 deletions(-)

diff --git a/contrib/test/test-media b/contrib/test/test-media
index afe20760..18a4f886 100755
--- a/contrib/test/test-media
+++ b/contrib/test/test-media
@@ -9,6 +9,7 @@ vivid=0
 vim2m=0
 vimc=0
 vicodec=0
+visl=0
 cec=0
 cecpwr=--skip-test-standby-resume
 kmemleak=0
@@ -56,10 +57,11 @@ if [ -z "$1" ]; then
 	echo "vimc: test the vimc driver"
 	echo "vicodec: test the vicodec driver"
 	echo "vidtv: test the vidtv driver"
+	echo "visl: test the visl driver"
 	echo "cec: adds the vivid CEC compliance tests, except for the CEC standby/wakeup tests."
 	echo "cec-pwr: adds the vivid CEC compliance tests, including the CEC standby/wakeup tests."
-	echo "all: equals 'vivid vim2m vimc vicodec vidtv cec cec-pwr'"
-	echo "mc: equals 'vivid vim2m vimc vicodec vidtv'"
+	echo "all: equals 'vivid vim2m vimc vicodec vidtv visl cec cec-pwr'"
+	echo "mc: equals 'vivid vim2m vimc vicodec vidtv visl'"
 	exit 0
 fi
 
@@ -118,6 +120,7 @@ while [ ! -z "$1" ]; do
 		vim2m=1
 		vimc=1
 		vicodec=1
+		visl=1
 		cec=1
 		cecpwr=
 		;;
@@ -127,6 +130,7 @@ while [ ! -z "$1" ]; do
 		vimc=1
 		vicodec=1
 		vidtv=1
+		visl=1
 		;;
 	vidtv)
 		vidtv=1
@@ -143,6 +147,9 @@ while [ ! -z "$1" ]; do
 	vicodec)
 		vicodec=1
 		;;
+	visl)
+		visl=1
+		;;
 	cec)
 		cec=1
 		cecpwr=--skip-test-standby-resume
@@ -239,6 +246,75 @@ if [ $vivid -eq 1 -a $setup -eq 0 ]; then
 	echo
 fi
 
+if [ $visl -eq 1 -a $setup -eq 0 ]; then
+	dmesg -n notice
+	echo
+	echo loading visl module | tee /dev/kmsg
+	modprobe visl
+	sleep $modprobe_time
+	echo
+	echo visl compliance tests | tee /dev/kmsg
+	echo
+	date
+	stdbuf -oL $v4l2_compliance -m platform:visl -P -s10 -a 2>&1 | tee -a $tmp
+	echo
+	echo unbind visl | tee /dev/kmsg
+	echo
+	echo -n visl.0 >/sys/bus/platform/drivers/visl/unbind
+	sleep $unbind_time
+	echo
+	echo rebind visl | tee /dev/kmsg
+	echo
+	echo -n visl.0 >/sys/bus/platform/drivers/visl/bind
+	sleep 1
+	echo
+	echo second unbind visl | tee /dev/kmsg
+	echo
+	for i in `$v4l2_ctl -z platform:visl --list-devices`; do
+		let "t = 1 + $RANDOM / 4096"
+		echo $i: sleep ${t}s
+		sleep $t <$i &
+	done
+	sleep 1
+	echo
+	echo -n visl.0 >/sys/bus/platform/drivers/visl/unbind
+	sleep $reunbind_time
+	echo
+	echo rmmod visl | tee /dev/kmsg
+	echo
+	rmmod visl
+	sleep $rmmod_time
+
+	if [ $kmemleak -eq 1 ]; then
+		echo
+		echo kmemleak results for visl:
+		echo
+		echo scan >/sys/kernel/debug/kmemleak
+		cat /sys/kernel/debug/kmemleak
+		echo
+		echo end of kmemleak results
+		echo
+	fi
+
+	modprobe visl
+	sleep $modprobe_time
+
+	$v4l2_ctl -z platform:visl --all
+
+	if [ $kmemleak -eq 1 ]; then
+		echo clear >/sys/kernel/debug/kmemleak
+	fi
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+fi
+
+
 if [ $cec -eq 1 ]; then
 	dmesg -n notice
 	cec-ctl --version
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-28 16:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28 16:56 [PATCH] test-media: Add basic tests for visl Detlev Casanova

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.