]> www.infradead.org Git - users/hch/blktests.git/commitdiff
block/017: convert to use _configure_null_blk
authorChristoph Hellwig <hch@lst.de>
Wed, 1 Jun 2022 08:45:13 +0000 (10:45 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 7 Jun 2022 10:25:43 +0000 (12:25 +0200)
Switch to use _configure_null_blk so that built-in null_blk can be
supported, which implies not using the default nullb0 device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
tests/block/017

index c84b661c14e6d603334614cb9a2944e473491331..85968883842444a7e1987c61ff90f8fdea47663c 100755 (executable)
@@ -19,23 +19,24 @@ requires() {
 
 show_inflight() {
        awk '{ printf "sysfs inflight reads %d\nsysfs inflight writes %d\n", $1, $2 }' \
-               /sys/block/nullb0/inflight
-       awk '{ print "sysfs stat " $9 }' /sys/block/nullb0/stat
-       awk '$3 == "nullb0" { print "diskstats " $12 }' /proc/diskstats
+               /sys/block/nullb1/inflight
+       awk '{ print "sysfs stat " $9 }' /sys/block/nullb1/stat
+       awk '$3 == "nullb1" { print "diskstats " $12 }' /proc/diskstats
 }
 
 test() {
        echo "Running ${TEST_NAME}"
 
-       if ! _init_null_blk irqmode=2 completion_nsec=500000000; then
+       if ! _configure_null_blk nullb1 irqmode=2 completion_nsec=500000000 \
+                       power=1; then
                return 1
        fi
 
-       dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1 status=none &
+       dd if=/dev/nullb1 of=/dev/null bs=4096 iflag=direct count=1 status=none &
        sleep 0.1
        show_inflight
 
-       dd if=/dev/zero of=/dev/nullb0 bs=4096 oflag=direct count=1 status=none &
+       dd if=/dev/zero of=/dev/nullb1 bs=4096 oflag=direct count=1 status=none &
        sleep 0.1
        show_inflight