iotests fixes
v4 cover iotests fixes
Hi Kevin, Hanna,
Here is a new version of iotests fixes from our s390x systems. They aren't related, just came up walking through the failures.
I saw you asked Eric Blake about the nbd-in-qcow2-chain patch. I left it as-is, but I am fine with skipping it if that's easier.
I added a new patch at the end of this series, which skips the last remaining failure I can create out-of-the-box on s390. I had hoped that I could get that one to work, but it doesn't appear to be trivial.
Regardless, I now get a clean run on an s390 host:
Not run: 045 059 064 070 075 076 077 078 081 083 084 088 092 093 094 101 106 108 109 113 116 118 119 123 128 131 135 136 146 147 148 149 160 162 171 172 173 175 181 185 186 192 201 205 207 210 211 212 213 221 225 231 233 237 239 241 253 259 266 282 288 294 296 301 308 block-status-cache file-io-error fuse-allow-other fuse-mmap-shared fuse-truncate iothreads-nbd-export iov-padding loop-create-file luks-detached-header migration-permissions mirror-top-perms nbd-commands nbd-multiconn nbd-tls-iothread parallels-bitmap parallels-checks resize-below-raw vvfat write-zeroes-unmap zoned Some cases not run in: /home/farman/git/qemu/tests/qemu-iotests/151 /home/farman/git/qemu/tests/qemu-iotests/297
Passed all 261 iotests
I look forward to your feedback...
v1: https://lore.kernel.org/r/[email protected]/
v2: https://lore.kernel.org/r/[email protected]/
v3: https://lore.kernel.org/r/[email protected]/v3->v4:
- [KW] Rework patch 4 to use --daemonize and _notrun_on_fuse_error()
- [EF] Add patch 5 to skip iothread-nbd-export on s390
Eric Farman (5):
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 unusable iotests/iothreads-nbd-export: Skip on s390
tests/qemu-iotests/108 | 20 +++++++++++++++++++ tests/qemu-iotests/tests/fuse-truncate | 9 ++++++--- tests/qemu-iotests/tests/iothreads-nbd-export | 5 +++++ tests/qemu-iotests/tests/nbd-in-qcow2-chain | 2 +- tests/qemu-iotests/tests/nbd-tls-iothread | 4 ++++ 5 files changed, 36 insertions(+), 4 deletions(-)
Signature · 1 line
2.53.0
PATCH v4 1/5 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
PATCH v4 2/5 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 v4 3/5 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 v4 4/5 iotests/108: skip if fuse is unusable
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 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
tests/qemu-iotests/108 +20 -0
@@ -73,6 +73,26 @@ 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 \ + --daemonize \ + --pidfile "$TEST_DIR/qsd.pid" 2>&1) + _notrun_on_fuse_error "$response" + + if [ -f "$TEST_DIR/qsd.pid" ]; then + qsd_pid=$(cat "$TEST_DIR/qsd.pid") + kill -KILL "$qsd_pid" + # Wait for process to exit (cannot `wait` because the QSD is daemonized) + while [ -f "$TEST_DIR/qsd.pid" ]; do + true + done + fi fi echo
Signature · 1 line
2.53.0
Re: [PATCH v4 4/5] iotests/108: skip if fuse is unusable
Quoted 27 lines · 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.
Signed-off-by Eric Farman <[email protected]>--- tests/qemu-iotests/108 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)tests/qemu-iotests/108 +9
-0@@ -73,6 +73,26 @@ 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 \ + --daemonize \
tests/qemu-iotests/108 else · line 94
Quoted 10 lines
tests/qemu-iotests/108 +10
-0+ --pidfile "$TEST_DIR/qsd.pid" 2>&1) + _notrun_on_fuse_error "$response" + + if [ -f "$TEST_DIR/qsd.pid" ]; then + qsd_pid=$(cat "$TEST_DIR/qsd.pid") + kill -KILL "$qsd_pid" + # Wait for process to exit (cannot `wait` because the QSD is daemonized) + while [ -f "$TEST_DIR/qsd.pid" ]; do + true + done
This appears to go into an infinite loop on a machine I tested where corporate policy software held the fuse mountpoint open long enough that it caused a race condition in tearing things down. I'm dropping this one from my pull request, but 1-3 and 5 remain.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org
PATCH v4 5/5 iotests/iothreads-nbd-export: Skip on s390
In reply to Eric FarmanRunning this test on s390 causes long python exception tracebacks at the beginning of the system_reset loop. The problem appears to be the same one described by commit ad302b21aab6, in that QEMU will exit on s390 without any kernel or boot disk.
In other tests, this is addressed by adding -no-shutdown to the command line, and that does create a clean failure instead of a long line of python exceptions:
--- /home/farman/git/qemu/tests/qemu-iotests/tests/iothreads-nbd-export.out
+++ /home/farman/git/qemu/build/scratch/qcow2-file-iothreads-nbd-export/iothreads-nbd-export.out.bad @@ -16,4 +16,4 @@
{"return": {}}
{"return": {}}
Checking that it is still alive...
-{"return": {"running": true, "status": "running"}}
+{"return": {"running": false, "status": "prelaunch"}}
Failures: iothreads-nbd-export
Failed 1 of 1 iotests
...but obviously this isn't still a successful test, since it is expected that the guest will be still be usable after the reset loop. So, barring a solution to that, just skip this test on s390.
--- tests/qemu-iotests/tests/iothreads-nbd-export | 5 +++++ 1 file changed, 5 insertions(+)
tests/qemu-iotests/tests/iothreads-nbd-export +5 -0
@@ -25,6 +25,11 @@ import iotests iotests.script_initialize(supported_fmts=['qcow2'], supported_platforms=['linux']) +# QEMU on s390 will exit without any sort of backing disk, +# so the reset loop requested by this test will fail. +if iotests.qemu_default_machine == 's390-ccw-virtio': + iotests.notrun('Cannot run test on s390') + with iotests.FilePath('disk1.img') as path, \ iotests.FilePath('nbd.sock', base_dir=iotests.sock_dir) as nbd_sock, \ qemu.machine.QEMUMachine(iotests.qemu_prog) as vm:
Signature · 1 line
2.53.0
Quoted 11 lines · Eric Farman
Hi Kevin, Hanna,
Here is a new version of iotests fixes from our s390x systems. They aren't related, just came up walking through the failures.
I saw you asked Eric Blake about the nbd-in-qcow2-chain patch. I left it as-is, but I am fine with skipping it if that's easier.
I added a new patch at the end of this series, which skips the last remaining failure I can create out-of-the-box on s390. I had hoped that I could get that one to work, but it doesn't appear to be trivial.
Series:
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org
Quoted 9 lines · Eric Blake
Quoted 8 lines · Eric Farman
Hi Kevin, Hanna,
Here is a new version of iotests fixes from our s390x systems. They aren't related, just came up walking through the failures.
I saw you asked Eric Blake about the nbd-in-qcow2-chain patch. I left it as-is, but I am fine with skipping it if that's easier.
Quoted 7 lines
Quoted 3 lines
I added a new patch at the end of this series, which skips the last remaining failure I can create out-of-the-box on s390. I had hoped that I could get that one to work, but it doesn't appear to be trivial.
Series:
Reviewed-by Eric Blake <[email protected]>
Thanks, Eric!
@Kevin, @Hanna... Any concerns with this series?
Quoted 16 lines · Eric Farman
Quoted 13 lines · Eric Blake
Quoted 11 lines · Eric Farman
Hi Kevin, Hanna,
Here is a new version of iotests fixes from our s390x systems. They aren't related, just came up walking through the failures.
I saw you asked Eric Blake about the nbd-in-qcow2-chain patch. I left it as-is, but I am fine with skipping it if that's easier.
I added a new patch at the end of this series, which skips the last remaining failure I can create out-of-the-box on s390. I had hoped that I could get that one to work, but it doesn't appear to be trivial.
Quoted 7 lines
Quoted 3 lines
Series:
Reviewed-by Eric Blake <[email protected]>Thanks, Eric!
@Kevin, @Hanna... Any concerns with this series?
At this point, I plan on queuing this in my next NBD pull request.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org
Quoted 21 lines · Eric Blake
Quoted 20 lines · Eric Farman
Quoted 16 lines · Eric Blake
Quoted 11 lines · Eric Farman
Hi Kevin, Hanna,
Here is a new version of iotests fixes from our s390x systems. They aren't related, just came up walking through the failures.
I saw you asked Eric Blake about the nbd-in-qcow2-chain patch. I left it as-is, but I am fine with skipping it if that's easier.
I added a new patch at the end of this series, which skips the last remaining failure I can create out-of-the-box on s390. I had hoped that I could get that one to work, but it doesn't appear to be trivial.
Series:
Reviewed-by Eric Blake <[email protected]>
Quoted 6 lines
Quoted 3 lines
Thanks, Eric!
@Kevin, @Hanna... Any concerns with this series?
At this point, I plan on queuing this in my next NBD pull request.
Thank you!