]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: explicitly test for engine availability in _require_fio v2025.03.17
authorEric Sandeen <sandeen@sandeen.net>
Fri, 14 Mar 2025 18:37:45 +0000 (13:37 -0500)
committerZorro Lang <zlang@kernel.org>
Sun, 16 Mar 2025 16:43:12 +0000 (00:43 +0800)
The current test in _require_fio (--warnings-fatal --showcmd) does not
fail if an invalid/unavailable io engine is specified.

Add an explicit test that every requested io engine in the job file
is actually available.

Also, remove the "ioe_e4defrag" entries in the [global] stanza of several
ext4 tests which use fio jobfiles. While ioengines can be set in the
[global] section, they can also be overridden in individual, subsequent
stanzas. In each affected test (ext4/301, ext4/302, ext4/303, and
ext4/304) every individual stanza after [global]re-specifies an ioengine;
either with ioengine=e4defrag or ioengine=libaio.

Because of this re-specification, the ioengine in the [global] section
is ignored. This is a good thing, because ioe_e4defrag is not a valid
ioengine, and would fail this new hand-rolled check, even though fio
did not complain.

So rather than over-complicate this new check, simply remove the unused,
invalid "ioengine=ioe_e4defrag" lines in these tests.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc
tests/ext4/301
tests/ext4/302
tests/ext4/303
tests/ext4/304

index dcdfa86e43b119d62a707eea4073a47ae89e588a..e51686389a78fbbd5f232debc914f1a7308547e9 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3985,12 +3985,19 @@ _require_scratch_dev_pool_equal_size()
 _require_fio()
 {
        local job=$1
+       local eng
 
        _require_command "$FIO_PROG" fio
        if [ -z "$1" ]; then
                return 1;
        fi
 
+       # Explicitly check for every ioengine listed in the job
+       for eng in `sed -n "s/ioengine=\(.*\)/\1/p" $job | sort -u`; do
+               grep -wq $eng <($FIO_PROG --enghelp 2>/dev/null) || \
+                       _notrun "fio engine $eng not available"
+       done
+
        $FIO_PROG --warnings-fatal --showcmd $job >> $seqres.full 2>&1
        [ $? -eq 0 ] || _notrun "$FIO_PROG too old, see $seqres.full"
 }
index abf47d4b7ecea2b2c1564d7fd1c75d17de95fad2..a05b8e8a82fe87faa34c62aaae507bfc35a70b2d 100755 (executable)
@@ -31,7 +31,6 @@ FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
 cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
-ioengine=ioe_e4defrag
 iodepth=1
 directory=${SCRATCH_MNT}
 filesize=${FILE_SIZE}
index 87820184e30f716f8402c815fe30bf0d5345c696..e0f5f2f980ea361990ceee86a2a6e1715a000fdb 100755 (executable)
@@ -31,7 +31,6 @@ FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
 cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
-ioengine=ioe_e4defrag
 iodepth=1
 directory=${SCRATCH_MNT}
 filesize=${FILE_SIZE}
index 2381f04770828f6d9c87b6777ed04aaf327d38eb..0a83e86cdde1f4f2d586d5bb41c317d00ba9647e 100755 (executable)
@@ -31,7 +31,6 @@ FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1))))
 cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
-ioengine=ioe_e4defrag
 iodepth=1
 directory=${SCRATCH_MNT}
 filesize=${FILE_SIZE}
index 53b522ee85bdcf0b5410dd9792a7736639f246e6..5f2ae4bdc56e2a31a464a2c78cbb6a135bb3eb63 100755 (executable)
@@ -32,7 +32,6 @@ FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
 cat >$fio_config <<EOF
 # Common e4defrag regression tests
 [global]
-ioengine=ioe_e4defrag
 iodepth=1
 directory=${SCRATCH_MNT}
 filesize=${FILE_SIZE}