--- /dev/null
+#!/bin/bash
+#
+# Smoke test all null_blk queue modes. Regression test for patch "null_blk: fix
+# zoned support for non-rq based operation".
+#
+# Copyright (C) 2018 Omar Sandoval
+#
+# 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/>.
+
+. tests/block/rc
+. common/null_blk
+
+DESCRIPTION="do I/O on all null_blk queue modes"
+QUICK=1
+
+requires() {
+ _have_null_blk
+}
+
+test() {
+ echo "Running ${TEST_NAME}"
+
+ local queue_mode
+ for ((queue_mode = 0; queue_mode <= 2; queue_mode++)); do
+ if _init_null_blk gb=1 queue_mode="$queue_mode"; then
+ echo "Queue mode $queue_mode"
+ dd if=/dev/nullb0 of=/dev/null iflag=direct bs=64k status=none
+ dd if=/dev/null of=/dev/nullb0 oflag=direct bs=64k status=none
+ _exit_null_blk
+ fi
+ done
+
+ echo "Test complete"
+}