iotests: Fixes to 156 and 186
cover iotests: Fixes to 156 and 186
This series contains some small fixes for issues I stumbled upon when preparing my pull request.
Max Reitz (2):
iotests: Fix test 156
iotests: Redirect stderr to stdout in 186
tests/qemu-iotests/156 | 4 ++-- tests/qemu-iotests/186 | 2 +- tests/qemu-iotests/186.out | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.9.4
PATCH 1/2 iotests: Fix test 156
On one hand, the _make_test_img invocation for creating the target image was missing a -u because its backing file is not supposed to exist at that point.
On the other hand, nobody noticed probably because the backing file is created later on and _cleanup failed to remove it: The quotation marks were misplaced so bash tried to deleted a file literally called "$TEST_IMG{,.target}..." instead of resolving the globs. Thus, the files stayed around after the first run and qemu-img create did not complain about a missing backing file on any run but the first.
--- tests/qemu-iotests/156 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qemu-iotests/156 +2 -2
@@ -38,7 +38,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "$TEST_IMG{,.target}{,.backing,.overlay}" + rm -f "$TEST_IMG"{,.target}{,.backing,.overlay} } trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -83,7 +83,7 @@ _send_qemu_cmd $QEMU_HANDLE \ 'return' # Create target image -TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -b "$TEST_IMG.target" 1M +TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -u -b "$TEST_IMG.target" 1M # Mirror snapshot _send_qemu_cmd $QEMU_HANDLE \
Signature · 1 line
2.9.4
Re: [Qemu-devel] [PATCH 1/2] iotests: Fix test 156
Quoted 7 lines · Max Reitz
On one hand, the
_make_test_imginvocation for creating the target image was missing a -u because its backing file is not supposed to exist at that point.On the other hand, nobody noticed probably because the backing file is created later on and
_cleanupfailed to remove it: The quotation marks were misplaced so bash tried to deleted a file literally called
s/deleted/delete/
Quoted 1 line
"$TEST_IMG{,.target}..." instead of resolving the globs. Thus, the
Technically brace expansion, not globs.
Quoted 7 lines
files stayed around after the first run and qemu-img create did not complain about a missing backing file on any run but the first.
Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/156 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Re: [Qemu-devel] [PATCH 1/2] iotests: Fix test 156
In reply to Max ReitzQuoted 42 lines · Max Reitz
On one hand, the
_make_test_imginvocation for creating the target image was missing a -u because its backing file is not supposed to exist at that point.On the other hand, nobody noticed probably because the backing file is created later on and
_cleanupfailed to remove it: The quotation marks were misplaced so bash tried to deleted a file literally called "$TEST_IMG{,.target}..." instead of resolving the globs. Thus, the files stayed around after the first run and qemu-img create did not complain about a missing backing file on any run but the first.Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/156 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tests/qemu-iotests/156 +2
-2@@ -38,7 +38,7 @@ status=1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "$TEST_IMG{,.target}{,.backing,.overlay}" + rm -f "$TEST_IMG"{,.target}{,.backing,.overlay} } trap "_cleanup; exit \$status" 0 1 2 3 15@@ -83,7 +83,7 @@ _send_qemu_cmd $QEMU_HANDLE \ 'return' # Create target image -TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -b "$TEST_IMG.target" 1M +TEST_IMG="$TEST_IMG.target.overlay" _make_test_img -u -b "$TEST_IMG.target" 1M # Mirror snapshot _send_qemu_cmd $QEMU_HANDLE \Signature · 1 line
2.9.4
PATCH 2/2 iotests: Redirect stderr to stdout in 186
In reply to Max ReitzWithout redirecting qemu's stderr to stdout, _filter_qemu will not apply to warnings. This results in $QEMU_PROG not being replaced by QEMU_PROG which is not great if your qemu executable is not called qemu-system-x86_64 (e.g. qemu-system-i386).
--- tests/qemu-iotests/186 | 2 +- tests/qemu-iotests/186.out | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
tests/qemu-iotests/186 +1 -1
@@ -56,7 +56,7 @@ function do_run_qemu() done fi echo quit - ) | $QEMU -S -nodefaults -display none -device virtio-scsi-pci -monitor stdio "$@" + ) | $QEMU -S -nodefaults -display none -device virtio-scsi-pci -monitor stdio "$@" 2>&1 echo }
tests/qemu-iotests/186.out +6 -6
@@ -442,28 +442,28 @@ ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only) Cache mode: writeback (qemu) quit -qemu-system-x86_64: -drive if=scsi,driver=null-co: warning: bus=0,unit=0 is deprecated with this machine type Testing: -drive if=scsi,driver=null-co QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=scsi,driver=null-co: warning: bus=0,unit=0 is deprecated with this machine type +info block scsi0-hd0 (NODE_NAME): null-co:// (null-co) Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Cache mode: writeback (qemu) quit -qemu-system-x86_64: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type Testing: -drive if=scsi,media=cdrom QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type +info block scsi0-cd0: [not inserted] Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Removable device: not locked, tray closed (qemu) quit -qemu-system-x86_64: -drive if=scsi,driver=null-co,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type Testing: -drive if=scsi,driver=null-co,media=cdrom QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=scsi,driver=null-co,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type +info block scsi0-cd0 (NODE_NAME): null-co:// (null-co, read-only) Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Removable device: not locked, tray closed
Signature · 1 line
2.9.4
Re: [Qemu-devel] [PATCH 2/2] iotests: Redirect stderr to stdout in 186
Quoted 10 lines · Max Reitz
Without redirecting qemu's stderr to stdout,
_filter_qemuwill not apply to warnings. This results in $QEMU_PROG not being replaced byQEMU_PROGwhich is not great if your qemu executable is not called qemu-system-x86_64 (e.g. qemu-system-i386).Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/186 | 2 +- tests/qemu-iotests/186.out | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Re: [Qemu-devel] [PATCH 2/2] iotests: Redirect stderr to stdout in 186
In reply to Max ReitzQuoted 67 lines · Max Reitz
Without redirecting qemu's stderr to stdout,
_filter_qemuwill not apply to warnings. This results in $QEMU_PROG not being replaced byQEMU_PROGwhich is not great if your qemu executable is not called qemu-system-x86_64 (e.g. qemu-system-i386).Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/186 | 2 +- tests/qemu-iotests/186.out | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)tests/qemu-iotests/186 +1
-1@@ -56,7 +56,7 @@ function do_run_qemu() done fi echo quit - ) | $QEMU -S -nodefaults -display none -device virtio-scsi-pci -monitor stdio "$@" + ) | $QEMU -S -nodefaults -display none -device virtio-scsi-pci -monitor stdio "$@" 2>&1 echo }tests/qemu-iotests/186.out +6
-6@@ -442,28 +442,28 @@ ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only) Cache mode: writeback (qemu) quit -qemu-system-x86_64: -drive if=scsi,driver=null-co: warning: bus=0,unit=0 is deprecated with this machine type Testing: -drive if=scsi,driver=null-co QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=scsi,driver=null-co: warning: bus=0,unit=0 is deprecated with this machine type +info block scsi0-hd0 (NODE_NAME): null-co:// (null-co) Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Cache mode: writeback (qemu) quit -qemu-system-x86_64: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type Testing: -drive if=scsi,media=cdrom QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type +info block scsi0-cd0: [not inserted] Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Removable device: not locked, tray closed (qemu) quit -qemu-system-x86_64: -drive if=scsi,driver=null-co,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type Testing: -drive if=scsi,driver=null-co,media=cdrom QEMU X.Y.Z monitor - type 'help' for more information -(qemu) info block +(qemu) QEMU_PROG: -drive if=scsi,driver=null-co,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type +info block scsi0-cd0 (NODE_NAME): null-co:// (null-co, read-only) Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] Removable device: not locked, tray closedSignature · 1 line
2.9.4
Kevin Wolf
AppliedAm 25.07.2017 um 17:56 hat Max Reitz geschrieben:
Quoted 2 lines
This series contains some small fixes for issues I stumbled upon when preparing my pull request.
Thanks, applied to the block branch.
Kevin