mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] selftests: lib: prime_numbers: update presence check
@ 2017-06-19 13:44 Sumit Semwal
  2017-06-19 13:51 ` Chris Wilson
  0 siblings, 1 reply; 5+ messages in thread
From: Sumit Semwal @ 2017-06-19 13:44 UTC (permalink / raw)
  To: shuah, linux-kselftest
  Cc: chris, lukas, linux-kernel, daniel.vetter, joonas.lahtinen, Sumit Semwal

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-20 13:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 13:44 [PATCH 2/2] selftests: lib: prime_numbers: update presence check Sumit Semwal
2017-06-19 13:51 ` Chris Wilson
2017-06-19 14:46   ` Sumit Semwal
     [not found]     ` <149788426772.14237.4686476703933342760@mail.alporthouse.com>
2017-06-19 15:11       ` Sumit Semwal
     [not found]         ` <149795925290.25956.17215228674567137983@mail.alporthouse.com>
2017-06-20 13:08           ` Sumit Semwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®