diff mbox series

[v4l-utils] test-media: add support for vidtv

Message ID 20210105131725.1191046-1-dwlsalmeida@gmail.com
State New
Headers show
Series [v4l-utils] test-media: add support for vidtv | expand

Commit Message

Daniel Almeida Jan. 5, 2021, 1:17 p.m. UTC
From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>

Add support for vidtv at the test-media script so that automated testing
is possible. Proper compliance tests are still pending.

Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
---
 contrib/test/test-media | 72 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

Comments

Hans Verkuil Jan. 28, 2021, 2:36 p.m. UTC | #1
Hi Daniel,

On 05/01/2021 14:17, Daniel W. S. Almeida wrote:
> From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>

> 

> Add support for vidtv at the test-media script so that automated testing

> is possible. Proper compliance tests are still pending.


I've tried this, but something is wrong: 'media-ctl -p' shows an empty
topology, ditto with contrib/test/mc_nextgen_test.

For the same reason 'v4l2-compliance -M0' fails with:

 fail: v4l2-test-media.cpp(120): !topology.num_entities

I'm not sure what's going on here, but it needs some more work.

In the meantime I'll merge this patch since it doesn't hurt.

Regards,

	Hans

> 

> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>

> ---

>  contrib/test/test-media | 72 +++++++++++++++++++++++++++++++++++++++++

>  1 file changed, 72 insertions(+)

> 

> diff --git a/contrib/test/test-media b/contrib/test/test-media

> index 1c1d2e37b..86a2e081a 100755

> --- a/contrib/test/test-media

> +++ b/contrib/test/test-media

> @@ -4,6 +4,7 @@

>  #

>  # Copyright 2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.

>  

> +vidtv=0

>  vivid=0

>  vim2m=0

>  vimc=0

> @@ -51,6 +52,7 @@ if [ -z "$1" ]; then

>  	echo "-32: use v4l2-ctl-32 and v4l2-compliance-32 to test the 32 bit compat layer"

>  	echo

>  	echo Test Targets:

> +	echo "vidtv: test the vidtv driver"

>  	echo "vivid: test the vivid driver"

>  	echo "vim2m: test the vim2m driver"

>  	echo "vimc: test the vimc driver"

> @@ -96,6 +98,7 @@ while [ ! -z "$1" ]; do

>  		fi

>  		;;

>  	all)

> +		vidtv=1

>  		vivid=1

>  		vim2m=1

>  		vimc=1

> @@ -109,6 +112,9 @@ while [ ! -z "$1" ]; do

>  		vimc=1

>  		vicodec=1

>  		;;

> +	vidtv)

> +		vidtv=1

> +		;;

>  	vivid)

>  		vivid=1

>  		;;

> @@ -162,6 +168,72 @@ $v4l2_ctl -z platform:vivid-002 -d vivid-002-vid-out -o1 -x width=3840,height=21

>  

>  echo

>  

> +if [ $vidtv -eq 1 ]; then

> +	rmmod vidtv 2&>/dev/null

> +	modprobe vidtv

> +	sleep 2

> +	dmesg -n notice

> +	echo

> +

> +	if ! media-ctl -d platform:vidtv -p ; then

> +		echo "FAIL: the vidtv module failed to load" | tee -a $tmp

> +		echo "Grand Total for vidtv: Succeeded: 0, Failed: 1, Warnings: 0" | tee -a $tmp

> +		echo "Final Summary: 1, Succeeded: 0, Failed: 1, Warnings: 0"

> +		rmmod vidtv

> +		exit 0

> +	fi

> +

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo unbind vidtv

> +	echo

> +	echo -n vidtv.0 >/sys/bus/platform/drivers/vidtv/unbind

> +	sleep $unbind_time

> +	echo

> +	echo rebind vidtv

> +	echo

> +	echo -n vidtv.0 >/sys/bus/platform/drivers/vidtv/bind

> +	sleep 1

> +	echo

> +	echo second unbind vidtv

> +	echo

> +	sleep 1

> +	echo

> +	echo -n vidtv.0 >/sys/bus/platform/drivers/vidtv/unbind

> +	sleep $reunbind_time

> +	echo

> +	echo rmmod vidtv

> +	echo

> +	rmmod vidtv

> +	sleep $rmmod_time

> +	if [ $kmemleak -eq 1 ]; then

> +		echo

> +		echo kmemleak results for vidtv:

> +		echo

> +		echo scan >/sys/kernel/debug/kmemleak

> +		cat /sys/kernel/debug/kmemleak

> +		echo

> +		echo end of kmemleak results

> +		echo clear >/sys/kernel/debug/kmemleak

> +	fi

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +	echo

> +

> +fi

> +

>  if [ $vivid -eq 1 ]; then

>  	dmesg -n notice

>  	echo

>
diff mbox series

Patch

diff --git a/contrib/test/test-media b/contrib/test/test-media
index 1c1d2e37b..86a2e081a 100755
--- a/contrib/test/test-media
+++ b/contrib/test/test-media
@@ -4,6 +4,7 @@ 
 #
 # Copyright 2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 
+vidtv=0
 vivid=0
 vim2m=0
 vimc=0
@@ -51,6 +52,7 @@  if [ -z "$1" ]; then
 	echo "-32: use v4l2-ctl-32 and v4l2-compliance-32 to test the 32 bit compat layer"
 	echo
 	echo Test Targets:
+	echo "vidtv: test the vidtv driver"
 	echo "vivid: test the vivid driver"
 	echo "vim2m: test the vim2m driver"
 	echo "vimc: test the vimc driver"
@@ -96,6 +98,7 @@  while [ ! -z "$1" ]; do
 		fi
 		;;
 	all)
+		vidtv=1
 		vivid=1
 		vim2m=1
 		vimc=1
@@ -109,6 +112,9 @@  while [ ! -z "$1" ]; do
 		vimc=1
 		vicodec=1
 		;;
+	vidtv)
+		vidtv=1
+		;;
 	vivid)
 		vivid=1
 		;;
@@ -162,6 +168,72 @@  $v4l2_ctl -z platform:vivid-002 -d vivid-002-vid-out -o1 -x width=3840,height=21
 
 echo
 
+if [ $vidtv -eq 1 ]; then
+	rmmod vidtv 2&>/dev/null
+	modprobe vidtv
+	sleep 2
+	dmesg -n notice
+	echo
+
+	if ! media-ctl -d platform:vidtv -p ; then
+		echo "FAIL: the vidtv module failed to load" | tee -a $tmp
+		echo "Grand Total for vidtv: Succeeded: 0, Failed: 1, Warnings: 0" | tee -a $tmp
+		echo "Final Summary: 1, Succeeded: 0, Failed: 1, Warnings: 0"
+		rmmod vidtv
+		exit 0
+	fi
+
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo unbind vidtv
+	echo
+	echo -n vidtv.0 >/sys/bus/platform/drivers/vidtv/unbind
+	sleep $unbind_time
+	echo
+	echo rebind vidtv
+	echo
+	echo -n vidtv.0 >/sys/bus/platform/drivers/vidtv/bind
+	sleep 1
+	echo
+	echo second unbind vidtv
+	echo
+	sleep 1
+	echo
+	echo -n vidtv.0 >/sys/bus/platform/drivers/vidtv/unbind
+	sleep $reunbind_time
+	echo
+	echo rmmod vidtv
+	echo
+	rmmod vidtv
+	sleep $rmmod_time
+	if [ $kmemleak -eq 1 ]; then
+		echo
+		echo kmemleak results for vidtv:
+		echo
+		echo scan >/sys/kernel/debug/kmemleak
+		cat /sys/kernel/debug/kmemleak
+		echo
+		echo end of kmemleak results
+		echo clear >/sys/kernel/debug/kmemleak
+	fi
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+	echo
+
+fi
+
 if [ $vivid -eq 1 ]; then
 	dmesg -n notice
 	echo