Skip to contentSkip to conversation

iotests fixes

PATCH Superseded Eric Farman 3 participants 10 messages Aug 13 – Sep 25

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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.

Fixes 24fd6d75b3 ("iotests: Add coverage of recent NBD qio deadlock fix")
---
 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
index 455ddfa86f..e35f072eba 100755
@@ -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
#2 lore raw

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 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.

Fixes 24fd6d75b3 ("iotests: Add coverage of recent NBD qio deadlock fix")
---
 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
index 455ddfa86f..e35f072eba 100755

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

Reviewed-by
#3 lore raw

Re: [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 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.

Fixes 24fd6d75b3 ("iotests: Add coverage of recent NBD qio deadlock fix")

---

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
#4 lore raw

PATCH v3 2/4 iotests/nbd-tls-iothread: skip on non-x86 hardware

In reply to Eric Farman

Like 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
index a2fb07206e..4326e2d3e5 100755
@@ -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
#5 lore raw

PATCH v3 3/4 iotests/fuse-truncate: skip if FUSE is not usable

In reply to Eric Farman

Commit 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.

Fixes 7d06bbb2d9 ("iotests: test O_TRUNC behavior for fuse exports")
---
 tests/qemu-iotests/tests/fuse-truncate | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tests/qemu-iotests/tests/fuse-truncate +6 -3
index 7eee35111c..f3d2f1866c 100755
@@ -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
#6 lore raw

PATCH v3 4/4 iotests/108: skip if fuse is unsuable

In reply to Eric Farman

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.

---
 tests/qemu-iotests/108 | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
tests/qemu-iotests/108 +17 -0
index bf808b3512..8dc725cf66 100755
@@ -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
#7 lore raw

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.

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
index bf808b3512..8dc725cf66 100755
@@ -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 -0
     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 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

#8 lore raw

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.

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
index bf808b3512..8dc725cf66 100755
@@ -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 -0
      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 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?)'
+    fi

Should this part use _notrun_on_fuse_error()?

Ah, of course. Not sure why I neglected to use that here.

Quoted 3 lines

Kevin

#9 lore raw
In reply to Eric Farman
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 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(-)