lkml.org 
[lkml]   [2017]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] selftests: lib: prime_numbers: update presence check
Date
The test for prime numbers doesn't differentiate between missing
prime_numbers.ko and failure in prime_numbers.ko.

Update it to check for presence of the file itself to skip, therefore
correctly exercising the test failure case.

Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
---
tools/testing/selftests/lib/prime_numbers.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/lib/prime_numbers.sh b/tools/testing/selftests/lib/prime_numbers.sh
index da4cbcd766f5..492f0dcdf088 100755
--- a/tools/testing/selftests/lib/prime_numbers.sh
+++ b/tools/testing/selftests/lib/prime_numbers.sh
@@ -1,8 +1,9 @@
#!/bin/sh
# Checks fast/slow prime_number generation for inconsistencies

-if ! /sbin/modprobe -q -r prime_numbers; then
- echo "prime_numbers: [SKIP]"
+if ! find /lib/modules/$(uname -r) -type f -name prime_numbers.ko | grep -q .;
+then
+ echo "prime_numbers: prime_numbers.ko not found: [SKIP]"
exit 77
fi

--
2.7.4
\
 
 \ /
  Last update: 2017-06-19 15:45    [W:0.082 / U:3.500 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site