From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>, "Max Reitz" <mreitz@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Michael Müller" <mimu@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH v2 3/3] iotests: Fix test 039
Date: Thu, 4 Dec 2014 15:49:02 +0100 [thread overview]
Message-ID: <1417704542-18337-4-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1417704542-18337-1-git-send-email-mreitz@redhat.com>
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 "abort -S 9" instead to have it crash
without a core dump.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/039 | 12 +++++++-----
tests/qemu-iotests/039.out | 6 +++---
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 84c9167..51cb8f7 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,7 @@ 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 9" "$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 +107,7 @@ 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 9" "$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 +123,7 @@ 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 9" "$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.
--
1.9.3
next prev parent reply other threads:[~2014-12-04 14:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-04 14:48 [Qemu-devel] [PATCH v2 0/3] iotests: Fix test 039 Max Reitz
2014-12-04 14:49 ` [Qemu-devel] [PATCH v2 1/3] qemu-io: Add sigraise command Max Reitz
2014-12-05 7:03 ` Fam Zheng
2014-12-05 9:52 ` Markus Armbruster
2014-12-05 10:07 ` Max Reitz
2014-12-05 12:23 ` Markus Armbruster
2014-12-05 13:04 ` Kevin Wolf
2014-12-05 13:05 ` Max Reitz
2014-12-05 13:59 ` Markus Armbruster
2014-12-05 14:12 ` Eric Blake
2014-12-04 14:49 ` [Qemu-devel] [PATCH v2 2/3] iotests: Filter for "Killed" in qemu-io output Max Reitz
2014-12-05 7:04 ` Fam Zheng
2014-12-04 14:49 ` Max Reitz [this message]
2014-12-05 7:08 ` [Qemu-devel] [PATCH v2 3/3] iotests: Fix test 039 Fam Zheng
2014-12-05 9:03 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1417704542-18337-4-git-send-email-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mimu@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).