]> www.infradead.org Git - users/hch/blktests.git/commitdiff
common/multipath-over-rdma: make block scheduler directory optional
authorLuis Chamberlain <mcgrof@kernel.org>
Wed, 29 Jul 2020 15:21:13 +0000 (15:21 +0000)
committerOmar Sandoval <osandov@fb.com>
Tue, 4 Aug 2020 21:12:30 +0000 (14:12 -0700)
We currently fail if the following tests if the directory
/lib/modules/$(uname -r)/kernel/block does not exist. Just make
this optional. Older distributions won't have this directory.

srp/001
srp/002
srp/013
srp/014

Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
common/multipath-over-rdma

index eb85c5ee751bf634f989ae12abda07ccabb5a270..355b169181b293fd8be064db595eda8ad97933b4 100644 (file)
@@ -684,10 +684,13 @@ setup_test() {
 
        # Load the I/O scheduler kernel modules
        (
-               cd "/lib/modules/$(uname -r)/kernel/block" &&
-                       for m in *.ko; do
-                               [ -e "$m" ] && modprobe "${m%.ko}"
-                       done
+               KERNEL_BLOCK="/lib/modules/$(uname -r)/kernel/block"
+               if [[ -d $KERNEL_BLOCK ]]; then
+                       cd "$KERNEL_BLOCK" &&
+                               for m in *.ko; do
+                                       [ -e "$m" ] && modprobe "${m%.ko}"
+                               done
+               fi
        )
 
        if [ -d /sys/kernel/debug/dynamic_debug ]; then