]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
block/014: test all I/O schedulers
authorOmar Sandoval <osandov@fb.com>
Wed, 28 Feb 2018 18:17:34 +0000 (10:17 -0800)
committerOmar Sandoval <osandov@fb.com>
Wed, 28 Feb 2018 18:17:58 +0000 (10:17 -0800)
Signed-off-by: Omar Sandoval <osandov@fb.com>
tests/block/014

index 917017c83248d51acc1c62f47dbe4b87557059f9..da5508d5bd897877a9d895d97b8409c0a8eb60c8 100755 (executable)
@@ -19,8 +19,6 @@
 
 DESCRIPTION="run null-blk with timeout injection configured"
 
-QUICK=1
-
 requires() {
        _have_module null-blk && _have_module_param null_blk timeout
 }
@@ -32,14 +30,23 @@ test() {
 
        # The format is "<interval>,<probability>,<space>,<times>". Here, we
        # fail 50% of I/Os.
-       modprobe null_blk timeout='1,50,0,-1'
-
-       # Do a bunch of I/Os which will timeout and then complete. The only
-       # thing we're really testing here is that this doesn't crash or hang.
-       for ((i = 0; i < 100; i++)); do
-               dd if=/dev/nullb0 of=/dev/null bs=4K count=4 iflag=direct status=none &
+       modprobe null_blk queue_mode=2 timeout='1,50,0,-1'
+
+       local scheds
+       scheds=($(sed 's/[][]//g' /sys/block/nullb0/queue/scheduler))
+
+       for sched in "${scheds[@]}"; do
+               echo "Testing $sched" >> "$FULL"
+               echo "$sched" > /sys/block/nullb0/queue/scheduler
+               # Do a bunch of I/Os which will timeout and then complete. The
+               # only thing we're really testing here is that this doesn't
+               # crash or hang.
+               for ((i = 0; i < 100; i++)); do
+                       dd if=/dev/nullb0 of=/dev/null bs=4K count=4 \
+                               iflag=direct status=none &
+               done
+               wait
        done
-       wait
 
        modprobe -r null_blk