]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
block/006: add regression test fix for blocking blk-mq driver
authorJens Axboe <axboe@fb.com>
Wed, 10 May 2017 03:27:27 +0000 (21:27 -0600)
committerOmar Sandoval <osandov@fb.com>
Wed, 10 May 2017 03:34:49 +0000 (20:34 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
tests/block/006 [new file with mode: 0755]
tests/block/006.out [new file with mode: 0644]

diff --git a/tests/block/006 b/tests/block/006
new file mode 100755 (executable)
index 0000000..beefd4a
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+#
+# Test if a block driver with BLK_MQ_F_BLOCKING set works correctly.
+#
+# Regression test for commit bf4907c05e61 ("blk-mq: fix schedule-under-preempt
+# or blocking drivers")
+#
+# Copyright (C) 2017 Jens Axboe
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+TEST_GROUPS=(block auto)
+
+CHECK_DMESG=1
+
+prepare() {
+       _have_module null_blk
+}
+
+test() {
+       echo "Running ${TEST_NAME}"
+
+       modprobe -r null_blk
+       if ! modprobe null_blk queue_mode=2 submit_queues=2 blocking=1; then
+               return 1
+       fi
+
+       # run sync test
+       fio --bs=4k --ioengine=sync --rw=randread --norandommap --name=reads \
+               --filename=/dev/nullb0 --size=5g --direct=1 >> "$FULL"
+
+       # run async test
+       fio --bs=4k --ioengine=sync --rw=randread --norandommap --name=reads \
+               --ioengine=libaio --iodepth=8 --numjobs=4 \
+               --filename=/dev/nullb0 --size=5g --direct=1 >> "$FULL"
+
+       modprobe -r null_blk
+
+       echo "Test complete"
+}
diff --git a/tests/block/006.out b/tests/block/006.out
new file mode 100644 (file)
index 0000000..54c0a59
--- /dev/null
@@ -0,0 +1,2 @@
+Running block/006
+Test complete