mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
iotests: Fix test 039
Test 039 used qemu-io -c abort for simulating a qemu crash; however, abort() generally results in a core dump and ulimit -c 0 is no reliable way of preventing that. Use "sigraise $(kill -l KILL)" instead to have it crash without a core dump. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1418032092-16813-4-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
9e0c3e8df5
commit
3f394472c5
2 changed files with 16 additions and 8 deletions
|
@ -47,9 +47,11 @@ _supported_os Linux
|
|||
_default_cache_mode "writethrough"
|
||||
_supported_cache_modes "writethrough"
|
||||
|
||||
_no_dump_exec()
|
||||
_subshell_exec()
|
||||
{
|
||||
(ulimit -c 0; exec "$@")
|
||||
# Executing crashing commands in a subshell prevents information like the
|
||||
# "Killed" line from being lost
|
||||
(exec "$@")
|
||||
}
|
||||
|
||||
size=128M
|
||||
|
@ -72,7 +74,9 @@ echo "== Creating a dirty image file =="
|
|||
IMGOPTS="compat=1.1,lazy_refcounts=on"
|
||||
_make_test_img $size
|
||||
|
||||
_no_dump_exec $QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" 2>&1 | _filter_qemu_io
|
||||
_subshell_exec $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
|
||||
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
||||
|
@ -105,7 +109,9 @@ echo "== Opening a dirty image read/write should repair it =="
|
|||
IMGOPTS="compat=1.1,lazy_refcounts=on"
|
||||
_make_test_img $size
|
||||
|
||||
_no_dump_exec $QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" 2>&1 | _filter_qemu_io
|
||||
_subshell_exec $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
|
||||
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
||||
|
@ -121,7 +127,9 @@ echo "== Creating an image file with lazy_refcounts=off =="
|
|||
IMGOPTS="compat=1.1,lazy_refcounts=off"
|
||||
_make_test_img $size
|
||||
|
||||
_no_dump_exec $QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" 2>&1 | _filter_qemu_io
|
||||
_subshell_exec $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
|
||||
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue