diff options
author | Sumit Semwal <sumit.semwal@linaro.org> | 2017-06-20 07:48:18 +0300 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-06-23 18:41:53 +0300 |
commit | e0912c0129038e1e8eb20e0441fc3d6b33215d68 (patch) | |
tree | f98c65fc3c591018a194eab96657a656e83eb462 /tools/testing/selftests/lib | |
parent | 34539b6c487c3d1cd1f3cafd1643e5ca89167813 (diff) | |
download | linux-e0912c0129038e1e8eb20e0441fc3d6b33215d68.tar.xz |
selftests: lib: Skip tests on missing test modules
With older kernels, printf.sh and bitmap.sh fail because they can't find
the respective test modules they are looking for.
Use modprobe dry run to check for missing test_XXX module. Error out with
the same error code as prime_numbers.sh.
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing/selftests/lib')
-rwxr-xr-x | tools/testing/selftests/lib/bitmap.sh | 4 | ||||
-rwxr-xr-x | tools/testing/selftests/lib/printf.sh | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/lib/bitmap.sh b/tools/testing/selftests/lib/bitmap.sh index 2da187b6ddad..b073c22a3435 100755 --- a/tools/testing/selftests/lib/bitmap.sh +++ b/tools/testing/selftests/lib/bitmap.sh @@ -1,5 +1,9 @@ #!/bin/sh # Runs bitmap infrastructure tests using test_bitmap kernel module +if ! /sbin/modprobe -q -n test_bitmap; then + echo "bitmap: [SKIP]" + exit 77 +fi if /sbin/modprobe -q test_bitmap; then /sbin/modprobe -q -r test_bitmap diff --git a/tools/testing/selftests/lib/printf.sh b/tools/testing/selftests/lib/printf.sh index 4fdc70fe6980..cbf3b124bd94 100755 --- a/tools/testing/selftests/lib/printf.sh +++ b/tools/testing/selftests/lib/printf.sh @@ -1,5 +1,9 @@ #!/bin/sh # Runs printf infrastructure using test_printf kernel module +if ! /sbin/modprobe -q -n test_printf; then + echo "printf: [SKIP]" + exit 77 +fi if /sbin/modprobe -q test_printf; then /sbin/modprobe -q -r test_printf |