[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/19] iotests: Fix test 039
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 10/19] iotests: Fix test 039 |
Date: |
Fri, 12 Dec 2014 17:09:56 +0000 |
From: Max Reitz <address@hidden>
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 <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/qemu-iotests/039 | 18 +++++++++++++-----
tests/qemu-iotests/039.out | 6 +++---
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 84c9167..859705f 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -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
diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
index 0adf153..35a04bd 100644
--- a/tests/qemu-iotests/039.out
+++ b/tests/qemu-iotests/039.out
@@ -11,7 +11,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./039: Aborted ( ulimit -c 0; exec "$@" )
+./039: Killed ( exec "$@" )
incompatible_features 0x1
ERROR cluster 5 refcount=0 reference=1
ERROR OFLAG_COPIED data cluster: l2_entry=8000000000050000 refcount=0
@@ -46,7 +46,7 @@ read 512/512 bytes at offset 0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./039: Aborted ( ulimit -c 0; exec "$@" )
+./039: Killed ( exec "$@" )
incompatible_features 0x1
ERROR cluster 5 refcount=0 reference=1
Rebuilding refcount structure
@@ -60,7 +60,7 @@ incompatible_features 0x0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./039: Aborted ( ulimit -c 0; exec "$@" )
+./039: Killed ( exec "$@" )
incompatible_features 0x0
No errors were found on the image.
--
2.1.0
- [Qemu-devel] [PULL 00/19] Block patches, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 01/19] block migration: fix return value, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 02/19] vmdk: Fix error for JSON descriptor file names, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 03/19] iotests: Add test for vmdk JSON file names, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 04/19] block/rbd: fix memory leak, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 05/19] block: vhdx - remove redundant comments, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 06/19] block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 07/19] block: vhdx - change .vhdx_create default block state to ZERO, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 08/19] qemu-io: Add sigraise command, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 09/19] iotests: Filter for "Killed" in qemu-io output, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 10/19] iotests: Fix test 039,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 11/19] block: vhdx - set .bdrv_has_zero_init to bdrv_has_zero_init_1, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 13/19] block: Don't add trailing space in "Formating..." message, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 14/19] block: drop unused bdrv_clear_incoming_migration_all() prototype, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 15/19] linux-aio: queue requests that cannot be submitted, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 16/19] linux-aio: track whether the queue is blocked, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 17/19] linux-aio: rename LaioQueue idx field to "n", Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 18/19] linux-aio: drop return code from laio_io_unplug and ioq_submit, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 19/19] linux-aio: simplify removal of completed iocbs from the list, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 12/19] qemu-iotests: Remove traling whitespaces in *.out, Stefan Hajnoczi, 2014/12/12
- Re: [Qemu-devel] [PULL 00/19] Block patches, Peter Maydell, 2014/12/15