From: Omar Sandoval Date: Wed, 12 Sep 2018 23:55:00 +0000 (-0700) Subject: block: add smoke test for queue_mode=0 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7e7c9514d6c609eff3bb3933fcc62d6eb2f9afba;p=users%2Fsagi%2Fblktests.git block: add smoke test for queue_mode=0 Linux kernel commit ca4b2a011948 ("null_blk: add zone support") broke null_blk queue_mode=0. None of the existing tests use bio mode, so add a test which does a very basic test of all modes. Signed-off-by: Omar Sandoval --- diff --git a/tests/block/023 b/tests/block/023 new file mode 100755 index 0000000..3d01502 --- /dev/null +++ b/tests/block/023 @@ -0,0 +1,45 @@ +#!/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 . + +. 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" +} diff --git a/tests/block/023.out b/tests/block/023.out new file mode 100644 index 0000000..a2f376d --- /dev/null +++ b/tests/block/023.out @@ -0,0 +1,5 @@ +Running block/023 +Queue mode 0 +Queue mode 1 +Queue mode 2 +Test complete