lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Jun 2017 19:14:11 +0530
From:   Sumit Semwal <sumit.semwal@...aro.org>
To:     shuah@...nel.org, linux-kselftest@...r.kernel.org
Cc:     keescook@...omium.org, decot@...glers.com,
        linux-kernel@...r.kernel.org,
        Sumit Semwal <sumit.semwal@...aro.org>
Subject: [PATCH v2 1/2] 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.

Add the skip portion on missing the respective test_XXX module. Error out
with the same error code as prime_numbers.sh.

v2: Per Shuah's review, search for the module rather than do modprobe.

Signed-off-by: Sumit Semwal <sumit.semwal@...aro.org>
---
 tools/testing/selftests/lib/bitmap.sh | 6 ++++++
 tools/testing/selftests/lib/printf.sh | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/tools/testing/selftests/lib/bitmap.sh b/tools/testing/selftests/lib/bitmap.sh
index 2da187b6ddad..b893046d511f 100755
--- a/tools/testing/selftests/lib/bitmap.sh
+++ b/tools/testing/selftests/lib/bitmap.sh
@@ -1,6 +1,12 @@
 #!/bin/sh
 # Runs bitmap infrastructure tests using test_bitmap kernel module
 
+if ! find /lib/modules/$(uname -r) -type f -name test_bitmap.ko | grep -q .;
+then
+	echo "bitmap: test_bitmap.ko not found [SKIP]"
+	exit 77
+fi
+
 if /sbin/modprobe -q test_bitmap; then
 	/sbin/modprobe -q -r test_bitmap
 	echo "bitmap: ok"
diff --git a/tools/testing/selftests/lib/printf.sh b/tools/testing/selftests/lib/printf.sh
index 4fdc70fe6980..804b7e75acc0 100755
--- a/tools/testing/selftests/lib/printf.sh
+++ b/tools/testing/selftests/lib/printf.sh
@@ -1,6 +1,12 @@
 #!/bin/sh
 # Runs printf infrastructure using test_printf kernel module
 
+if ! find /lib/modules/$(uname -r) -type f -name test_printf.ko | grep -q .;
+then
+        echo "printf: test_printf.ko not found [SKIP]"
+        exit 77
+fi
+
 if /sbin/modprobe -q test_printf; then
 	/sbin/modprobe -q -r test_printf
 	echo "printf: ok"
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ