iotests fixes
v3 cover iotests fixes
Hi Kevin, Hanna,
Here is a third version of iotests fixes from our s390x systems. They aren't related, just came up walking through the failures.
In fact, only patch 4 has existed in the previous versions of this "series", as it remains stubborn for me (hence me putting it at the end). This time, I added a check against the qemu-storage-daemon to try to do a mount against a null device (similar to the test_fuse_support() routine in fuse-mmap-shared), to bail out of the test earlier than failing on the "real" command later on.
I look forward to your feedback...
v1: https://lore.kernel.org/r/[email protected]/
v2: https://lore.kernel.org/r/[email protected]/v2->v3:
- [EF] Add two fixes for NBD tests, and one (new) fix for another FUSE test
- [HC] Rework the fix to 108, and perform a dummy mount to see if fuse works
Eric Farman (4):
iotests/nbd-in-qcow2-chain: use default machine iotests/nbd-tls-iothread: skip on non-x86 hardware iotests/fuse-truncate: skip if FUSE is not usable iotests/108: skip if fuse is unsuable
tests/qemu-iotests/108 | 17 +++++++++++++++++ tests/qemu-iotests/tests/fuse-truncate | 9 ++++++--- tests/qemu-iotests/tests/nbd-in-qcow2-chain | 2 +- tests/qemu-iotests/tests/nbd-tls-iothread | 4 ++++ 4 files changed, 28 insertions(+), 4 deletions(-)
Signature · 1 line
2.53.0
PATCH v3 1/4 iotests/nbd-in-qcow2-chain: use default machine
Some of the NBD tests explicitly specify -machine q35 which won't work when running against, say, qemu-system-s390x.
The nbd-in-qcow2-chain test runs fine with the default machine on a z16 host, so allow it to run in other configurations.
--- tests/qemu-iotests/tests/nbd-in-qcow2-chain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/tests/nbd-in-qcow2-chain +1 -1
@@ -43,7 +43,7 @@ TEST_IMG="$TEST_IMG.base" _make_test_img $size echo echo "=== Starting QEMU and exposing base image ===" -_launch_qemu -machine q35 +_launch_qemu h1=$QEMU_HANDLE _send_qemu_cmd $QEMU_HANDLE '{"execute": "qmp_capabilities"}' 'return' _send_qemu_cmd $QEMU_HANDLE '{"execute": "blockdev-add",
Signature · 1 line
2.53.0
Re: [PATCH v3 1/4] iotests/nbd-in-qcow2-chain: use default machine
Am 13.08.2026 um 20:37 hat Eric Farman geschrieben:
Quoted 17 lines
Some of the NBD tests explicitly specify
-machine q35which won't work when running against, say, qemu-system-s390x.The nbd-in-qcow2-chain test runs fine with the default machine on a z16 host, so allow it to run in other configurations.
Fixes 24fd6d75b3 ("iotests: Add coverage of recent NBD qio deadlock fix")Signed-off-by Eric Farman <[email protected]>--- tests/qemu-iotests/tests/nbd-in-qcow2-chain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/qemu-iotests/tests/nbd-in-qcow2-chain +0
-0
tests/qemu-iotests/tests/nbd-in-qcow2-chain TEST_IMG="$TEST_IMG.base" _make_test_img $size · line 49
Quoted 8 lines
tests/qemu-iotests/tests/nbd-in-qcow2-chain +1
-1@@ -43,7 +43,7 @@ TEST_IMG="$TEST_IMG.base" _make_test_img $size echo echo "=== Starting QEMU and exposing base image ===" -_launch_qemu -machine q35 +_launch_qemu h1=$QEMU_HANDLE _send_qemu_cmd $QEMU_HANDLE '{"execute": "qmp_capabilities"}' 'return' _send_qemu_cmd $QEMU_HANDLE '{"execute": "blockdev-add",
I don't see what the machine type is needed for, so this is probably fine.
Eric (Blake), any specific reason you added the machine type in this test case so that removing it might cause a regression?
Kevin
Eric Blake
Reviewed-byRe: [PATCH v3 1/4] iotests/nbd-in-qcow2-chain: use default machine
Quoted 21 lines · Kevin Wolf
Am 13.08.2026 um 20:37 hat Eric Farman geschrieben:
Quoted 11 lines
Some of the NBD tests explicitly specify
-machine q35which won't work when running against, say, qemu-system-s390x.The nbd-in-qcow2-chain test runs fine with the default machine on a z16 host, so allow it to run in other configurations.
Fixes 24fd6d75b3 ("iotests: Add coverage of recent NBD qio deadlock fix")Signed-off-by Eric Farman <[email protected]>---
tests/qemu-iotests/tests/nbd-in-qcow2-chain TEST_IMG="$TEST_IMG.base" _make_test_img $size · line 49
Quoted 5 lines
tests/qemu-iotests/tests/nbd-in-qcow2-chain +1
-1-_launch_qemu -machine q35 +_launch_qemu h1=$QEMU_HANDLE _send_qemu_cmd $QEMU_HANDLE '{"execute": "qmp_capabilities"}' 'return' _send_qemu_cmd $QEMU_HANDLE '{"execute": "blockdev-add",I don't see what the machine type is needed for, so this is probably fine.
Quoted 2 lines
Eric (Blake), any specific reason you added the machine type in this test case so that removing it might cause a regression?
This would have been copy-and-paste from some other test, and not something specific to this one.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org
PATCH v3 2/4 iotests/nbd-tls-iothread: skip on non-x86 hardware
In reply to Eric FarmanLike nbd-in-qcow2-chain, this test assumes a q35 machine is present, which might not be available on other hosts. Unlike that test, simply allowing it to run with the default machine still throws an errors. Fence this to PC-only machines for now.
--- tests/qemu-iotests/tests/nbd-tls-iothread | 4 ++++ 1 file changed, 4 insertions(+)
tests/qemu-iotests/tests/nbd-tls-iothread +4 -0
@@ -47,6 +47,10 @@ cd .. _supported_fmt qcow2 # Hardcoded to qcow2 command line and QMP below _supported_proto file +if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then + _notrun "Requires a PC machine" +fi + # pick_unused_port # # Picks and returns an "unused" port, setting the global variable
Signature · 1 line
2.53.0
PATCH v3 3/4 iotests/fuse-truncate: skip if FUSE is not usable
In reply to Eric FarmanCommit 951227d3755 ("iotests: skip FUSE tests when FUSE is not usable") reworked some of the fuse-related tests to skip where needed, but the new test fuse-truncate raced with that and missed out on the same treatment. Add that same python-esque skip logic to this test.
--- tests/qemu-iotests/tests/fuse-truncate | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
tests/qemu-iotests/tests/fuse-truncate +6 -3
@@ -32,9 +32,12 @@ def check_fuse_support(): test_qsd.stop() os.remove(fuse_mount_point) if 'error' in res: - assert (res['error']['desc'] == - "Parameter 'type' does not accept value 'fuse'") - iotests.notrun('No FUSE support') + desc = res['error']['desc'] + if desc == "Parameter 'type' does not accept value 'fuse'": + iotests.notrun('No FUSE support') + if 'Failed to mount FUSE session' in desc: + iotests.notrun('FUSE not usable in this environment') + assert False, desc def check_sudo_support(): try:
Signature · 1 line
2.53.0
PATCH v3 4/4 iotests/108: skip if fuse is unsuable
In reply to Eric FarmanIt is possible that the ability to fusermount is restricted to privileged users. Rather than waiting for this test to perform a mount and subsequently fail, perform a dummy mount early on and skip the tests if fuse is not usable.
--- tests/qemu-iotests/108 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
tests/qemu-iotests/108 +17 -0
@@ -73,6 +73,23 @@ else _notrun 'Passwordless sudo for losetup or FUSE support required, but' \ 'neither is available' fi + + # Test to see if fuse is usable or not (permissions, etc.) + export_mp="$TEST_DIR/fuse-export" + touch "$export_mp" + + response=$($QSD \ + --blockdev null-co,node-name=export-node \ + --export fuse,id=fuse-export,node-name=export-node,mountpoint="$export_mp",allow-other=off \ + --pidfile "$TEST_DIR/qsd.pid" 2>&1) + if [[ $response = *"Failed to mount FUSE session to export"* ]]; then + _notrun 'FUSE support is not usable (permission error?)' + fi + + if [ -f "$TEST_DIR/qsd.pid" ]; then + qsd_pid=$(cat "$TEST_DIR/qsd.pid") + kill -KILL "$qsd_pid" + fi fi echo
Signature · 1 line
2.53.0
Re: [PATCH v3 4/4] iotests/108: skip if fuse is unsuable
Am 13.08.2026 um 20:37 hat Eric Farman geschrieben:
Quoted 6 lines
It is possible that the ability to fusermount is restricted to privileged users. Rather than waiting for this test to perform a mount and subsequently fail, perform a dummy mount early on and skip the tests if fuse is not usable.
Signed-off-by Eric Farman <[email protected]>
There is a typo in the subject line (s/unsuable/unusable/).
Quoted 10 lines
tests/qemu-iotests/108 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)tests/qemu-iotests/108 +0
-0@@ -73,6 +73,23 @@ else _notrun 'Passwordless sudo for losetup or FUSE support required, but' \ 'neither is available'
tests/qemu-iotests/108 else · line 84
Quoted 10 lines
tests/qemu-iotests/108 +9
-0fi + + # Test to see if fuse is usable or not (permissions, etc.) + export_mp="$TEST_DIR/fuse-export" + touch "$export_mp" + + response=$($QSD \ + --blockdev null-co,node-name=export-node \ + --export fuse,id=fuse-export,node-name=export-node,mountpoint="$export_mp",allow-other=off \ + --pidfile "$TEST_DIR/qsd.pid" 2>&1)
If FUSE is available, this hangs because QSD doesn't exit by itself, but waits for clients to connect.
--daemonize might give you the right semantics (print errors while setting up the export to stderr, exit after initialising everything) when combined with your code below to kill QSD.
tests/qemu-iotests/108 else · line 87
Quoted 3 lines
tests/qemu-iotests/108 +3
-0+ if [[ $response = *"Failed to mount FUSE session to export"* ]]; then + _notrun 'FUSE support is not usable (permission error?)' + fi
Should this part use _notrun_on_fuse_error()?
Kevin
Re: [PATCH v3 4/4] iotests/108: skip if fuse is unsuable
Quoted 34 lines · Kevin Wolf
Am 13.08.2026 um 20:37 hat Eric Farman geschrieben:
Quoted 6 lines
It is possible that the ability to fusermount is restricted to privileged users. Rather than waiting for this test to perform a mount and subsequently fail, perform a dummy mount early on and skip the tests if fuse is not usable.
Signed-off-by Eric Farman <[email protected]>There is a typo in the subject line (s/unsuable/unusable/).
Quoted 10 lines
tests/qemu-iotests/108 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)tests/qemu-iotests/108 +0
-0@@ -73,6 +73,23 @@ else _notrun 'Passwordless sudo for losetup or FUSE support required, but' \ 'neither is available'tests/qemu-iotests/108 else · line 84
Quoted 10 lines
tests/qemu-iotests/108 +9
-0fi + + # Test to see if fuse is usable or not (permissions, etc.) + export_mp="$TEST_DIR/fuse-export" + touch "$export_mp" + + response=$($QSD \ + --blockdev null-co,node-name=export-node \ + --export fuse,id=fuse-export,node-name=export-node,mountpoint="$export_mp",allow-other=off \ + --pidfile "$TEST_DIR/qsd.pid" 2>&1)If FUSE is available, this hangs because QSD doesn't exit by itself, but waits for clients to connect.
Quoted 3 lines
--daemonize might give you the right semantics (print errors while setting up the export to stderr, exit after initialising everything) when combined with your code below to kill QSD.
Good point. I note that similar logic exists elsewhere in 108, with a loop to wait for the qsd.pid file to disappear from a daemonized QSD, which would probably be warranted.
Quoted 6 lines
tests/qemu-iotests/108 else · line 87
Quoted 4 lines
tests/qemu-iotests/108 +3
-0+ if [[ $response = *"Failed to mount FUSE session to export"* ]]; then + _notrun 'FUSE support is not usable (permission error?)' + fiShould this part use
_notrun_on_fuse_error()?
Ah, of course. Not sure why I neglected to use that here.
Quoted 3 lines
Kevin
Quoted 4 lines · Eric Farman
Hi Kevin, Hanna,
Here is a third version of iotests fixes from our s390x systems. They aren't related, just came up walking through the failures.
Hi Kevin, Hanna,
Just bumping this up the list. Any thoughts?
This series applies cleanly to today's master, and without this I can still reproduce the errors described within.
Thanks,
Eric
Quoted 27 lines
In fact, only patch 4 has existed in the previous versions of this "series", as it remains stubborn for me (hence me putting it at the end). This time, I added a check against the qemu-storage-daemon to try to do a mount against a null device (similar to the
test_fuse_support()routine in fuse-mmap-shared), to bail out of the test earlier than failing on the "real" command later on.I look forward to your feedback...
v1: https://lore.kernel.org/r/[email protected]/
v2: https://lore.kernel.org/r/[email protected]/v2->v3:
- [EF] Add two fixes for NBD tests, and one (new) fix for another FUSE test
- [HC] Rework the fix to 108, and perform a dummy mount to see if fuse worksEric Farman (4):
iotests/nbd-in-qcow2-chain: use default machine iotests/nbd-tls-iothread: skip on non-x86 hardware iotests/fuse-truncate: skip if FUSE is not usable iotests/108: skip if fuse is unsuabletests/qemu-iotests/108 | 17 +++++++++++++++++ tests/qemu-iotests/tests/fuse-truncate | 9 ++++++--- tests/qemu-iotests/tests/nbd-in-qcow2-chain | 2 +- tests/qemu-iotests/tests/nbd-tls-iothread | 4 ++++ 4 files changed, 28 insertions(+), 4 deletions(-)