mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
iotests: Do not suppress segfaults in bash tests
Currently, if a qemu/qemu-io/qemu-img/qemu-nbd invocation receives a segmentation fault, that message is invisible in most cases since the output is generally filtered and bash suppresses the segmentation fault notice for any but the last element of a pipe. Most of the time, the test will then fail anyway because of missing output, but not necessarily (as happened with test 82 recently). Fix this by making the corresponding environment variables point to wrapper functions which execute the respective command in a subshell. Giving options to qemu/qemu-io/qemu-img and path names with spaces were broken for the Python tests; this patch "accidentally" fixes that. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
0ed82f7a09
commit
934659c460
8 changed files with 67 additions and 31 deletions
|
@ -47,13 +47,6 @@ _supported_os Linux
|
|||
_default_cache_mode "writethrough"
|
||||
_supported_cache_modes "writethrough"
|
||||
|
||||
_subshell_exec()
|
||||
{
|
||||
# Executing crashing commands in a subshell prevents information like the
|
||||
# "Killed" line from being lost
|
||||
(exec "$@")
|
||||
}
|
||||
|
||||
size=128M
|
||||
|
||||
echo
|
||||
|
@ -74,8 +67,8 @@ echo "== Creating a dirty image file =="
|
|||
IMGOPTS="compat=1.1,lazy_refcounts=on"
|
||||
_make_test_img $size
|
||||
|
||||
_subshell_exec $QEMU_IO -c "write -P 0x5a 0 512" \
|
||||
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
|
||||
$QEMU_IO -c "write -P 0x5a 0 512" \
|
||||
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
|
||||
| _filter_qemu_io
|
||||
|
||||
# The dirty bit must be set
|
||||
|
@ -109,8 +102,8 @@ echo "== Opening a dirty image read/write should repair it =="
|
|||
IMGOPTS="compat=1.1,lazy_refcounts=on"
|
||||
_make_test_img $size
|
||||
|
||||
_subshell_exec $QEMU_IO -c "write -P 0x5a 0 512" \
|
||||
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
|
||||
$QEMU_IO -c "write -P 0x5a 0 512" \
|
||||
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
|
||||
| _filter_qemu_io
|
||||
|
||||
# The dirty bit must be set
|
||||
|
@ -127,8 +120,8 @@ echo "== Creating an image file with lazy_refcounts=off =="
|
|||
IMGOPTS="compat=1.1,lazy_refcounts=off"
|
||||
_make_test_img $size
|
||||
|
||||
_subshell_exec $QEMU_IO -c "write -P 0x5a 0 512" \
|
||||
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
|
||||
$QEMU_IO -c "write -P 0x5a 0 512" \
|
||||
-c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
|
||||
| _filter_qemu_io
|
||||
|
||||
# The dirty bit must not be set since lazy_refcounts=off
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue