Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1425580
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/4] selftests: add media controller regression test scripts and document |
| Date | 2016-06-18 02:30 +0200 |
| Message-ID | <rLcj8-5aI-9@gated-at.bofh.it> (permalink) |
| References | <rLcj7-5aI-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Add regression test scripts open_loop_test.sh, and bind_unbind_sample.sh. Also add regression_test.txt that describes the regression test procedure. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> --- .../selftests/media_tests/bind_unbind_sample.sh | 13 +++++++ .../selftests/media_tests/open_loop_test.sh | 10 +++++ .../selftests/media_tests/regression_test.txt | 43 ++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100755 tools/testing/selftests/media_tests/bind_unbind_sample.sh create mode 100755 tools/testing/selftests/media_tests/open_loop_test.sh create mode 100644 tools/testing/selftests/media_tests/regression_test.txt diff --git a/tools/testing/selftests/media_tests/bind_unbind_sample.sh b/tools/testing/selftests/media_tests/bind_unbind_sample.sh new file mode 100755 index 0000000..2b24743 --- /dev/null +++ b/tools/testing/selftests/media_tests/bind_unbind_sample.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Find device number in /sys/bus/usb/drivers/drivername +# Edit this file to update the driver numer and name +# Example test for uvcvideo driver +#i=0 +# while :; do +# i=$((i+1)) +# echo 1-5:1.0 > /sys/bus/usb/drivers/uvcvideo/unbind; +# echo 1-5:1.0 > /sys/bus/usb/drivers/uvcvideo/bind; +# clear +# echo $i +#done + diff --git a/tools/testing/selftests/media_tests/open_loop_test.sh b/tools/testing/selftests/media_tests/open_loop_test.sh new file mode 100755 index 0000000..dcd3c17 --- /dev/null +++ b/tools/testing/selftests/media_tests/open_loop_test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + i=0 +file=/dev/media$1 + while :; do + echo $file + i=$((i+1)) + R=$(./media_device_open -d $file); + # clear + echo -e "Loop $i\n$R" + done diff --git a/tools/testing/selftests/media_tests/regression_test.txt b/tools/testing/selftests/media_tests/regression_test.txt new file mode 100644 index 0000000..2627367 --- /dev/null +++ b/tools/testing/selftests/media_tests/regression_test.txt @@ -0,0 +1,43 @@ +Testing for regressions in Media Controller API register, ioctl, syscall, +and unregister paths. There have a few problems that result in user-after +free on media_device, media_devnode, and cdev pointers when the driver is +unbound while ioctl is in progress. + +Test Procedure: + +Run bin/unbind loop while ioctls are in progress. +Run rmmod and modprobe. +Disconnect the device. + +Setup: + +Build media_device_test +cd tools/testing/selftests/media_tests +make + +Regressions test for cdev user-after free error on /dev/mediaX when driver +is unbound: + +Start media_device_test to regression test media devnode dynamic alloc +and cdev user-after-free fixes. This opens media dev files and sits in +a loop running media ioctl MEDIA_IOC_DEVICE_INFO command once every 10 +seconds. The idea is when device file goes away, media devnode and cdev +should stick around until this test exits. + +The test for a random number of iterations or until user kills it with a +sleep 10 in between the ioctl calls. + +sudo ./media_device_test -d /dev/mediaX + +Regression test for media_devnode unregister race with ioctl_syscall: + +Start 6 open_loop_test.sh tests with different /dev/mediaX files. When +device file goes away after unbind, device file name changes. Start the +test with possible device names. If we start with /dev/media0 for example, +after unbind, /dev/media1 or /dev/media2 could get created. The idea is +keep ioctls going while bind/unbind runs. + +Copy bind_unbind_sample.txt and make changes to specify the driver name +and number to run bind and unbind. Start the bind_unbind.sh + +Run dmesg looking for any user-after free errors or mutex lock errors. -- 2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/4] Add new media test and regression test scripts Shuah Khan <shuahkh@osg.samsung.com> - 2016-06-18 02:30 +0200 [PATCH 3/4] selftests: add media controller regression test scripts and document Shuah Khan <shuahkh@osg.samsung.com> - 2016-06-18 02:30 +0200 [PATCH 2/4] selftests: add media_device_open test Shuah Khan <shuahkh@osg.samsung.com> - 2016-06-18 02:30 +0200
csiph-web