[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/34] qemu-iotests: 067: ignore QMP events
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 32/34] qemu-iotests: 067: ignore QMP events |
Date: |
Mon, 22 Feb 2016 17:32:50 +0100 |
From: Sascha Silbe <address@hidden>
The relative ordering of "device_del" return value and the
"DEVICE_DELETED" QMP event depends on the architecture being
tested. On x86 unplugging virtio disks is asynchronous
(=qdev_unplug()= → =hotplug_handler_unplug_request()=) while on s390x
it is synchronous (=qdev_unplug()= → =hotplug_handler_unplug()=). This
leads to the actual output on s390x consistently differing from the
reference output (that was probably produced on x86).
The easiest way to address this is to filter out QMP events in
067. The DEVICE_DELETED event is already getting explicitly tested by
the Python-based test case 139, so the test coverage should be
unaffected. Make use of the recently introduced _filter_qmp_events()
to remove QMP events from the test case output and adjust the
reference output accordingly.
The tr / sed / tr trick used for filtering was suggested by Max Reitz
<address@hidden>.
Signed-off-by: Sascha Silbe <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/067 | 11 +++-
tests/qemu-iotests/067.out | 144 ---------------------------------------------
2 files changed, 10 insertions(+), 145 deletions(-)
diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
index 3788534..77dec0d 100755
--- a/tests/qemu-iotests/067
+++ b/tests/qemu-iotests/067
@@ -45,11 +45,20 @@ function do_run_qemu()
echo
}
+# Remove QMP events from (pretty-printed) output. Doesn't handle
+# nested dicts correctly, but we don't get any of those in this test.
+_filter_qmp_events()
+{
+ tr '\n' '\t' | sed -e \
+
's/{\s*"timestamp":\s*{[^}]*},\s*"event":[^,}]*\(,\s*"data":\s*{[^}]*}\)\?\s*}\s*//g'
\
+ | tr '\t' '\n'
+}
+
function run_qemu()
{
do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu \
| sed -e 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g' \
- | _filter_generated_node_ids
+ | _filter_generated_node_ids | _filter_qmp_events
}
size=128M
diff --git a/tests/qemu-iotests/067.out b/tests/qemu-iotests/067.out
index ae3fccb..7e25a49 100644
--- a/tests/qemu-iotests/067.out
+++ b/tests/qemu-iotests/067.out
@@ -70,34 +70,6 @@ Testing: -drive
file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk -device virti
}
}
{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "path": "/machine/peripheral/virtio0/virtio-backend"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "device": "virtio0",
- "path": "/machine/peripheral/virtio0"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "RESET"
-}
-{
"return": [
]
}
@@ -105,14 +77,6 @@ Testing: -drive
file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk -device virti
"return": {
}
}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "SHUTDOWN"
-}
-
=== -drive/device_add and device_del ===
@@ -186,34 +150,6 @@ Testing: -drive
file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk
}
}
{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "path": "/machine/peripheral/virtio0/virtio-backend"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "device": "virtio0",
- "path": "/machine/peripheral/virtio0"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "RESET"
-}
-{
"return": [
]
}
@@ -221,14 +157,6 @@ Testing: -drive
file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk
"return": {
}
}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "SHUTDOWN"
-}
-
=== drive_add/device_add and device_del ===
@@ -305,34 +233,6 @@ Testing:
}
}
{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "path": "/machine/peripheral/virtio0/virtio-backend"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "device": "virtio0",
- "path": "/machine/peripheral/virtio0"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "RESET"
-}
-{
"return": [
]
}
@@ -340,14 +240,6 @@ Testing:
"return": {
}
}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "SHUTDOWN"
-}
-
=== blockdev_add/device_add and device_del ===
@@ -425,34 +317,6 @@ Testing:
}
}
{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "path": "/machine/peripheral/virtio0/virtio-backend"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "DEVICE_DELETED",
- "data": {
- "device": "virtio0",
- "path": "/machine/peripheral/virtio0"
- }
-}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "RESET"
-}
-{
"return": [
{
"io-status": "ok",
@@ -506,12 +370,4 @@ Testing:
"return": {
}
}
-{
- "timestamp": {
- "seconds": TIMESTAMP,
- "microseconds": TIMESTAMP
- },
- "event": "SHUTDOWN"
-}
-
*** done
--
1.8.3.1
- [Qemu-devel] [PULL 22/34] throttle: Add command-line settings to define the burst periods, (continued)
- [Qemu-devel] [PULL 22/34] throttle: Add command-line settings to define the burst periods, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 33/34] qemu-iotests: 140: don't use IDE device, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 24/34] qapi: Add burst length fields to BlockDeviceInfo, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 19/34] throttle: Merge all functions that check the configuration into one, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 25/34] throttle: Check that burst_level leaks correctly, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 30/34] MAINTAINERS: Add myself as maintainer of the throttling code, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 21/34] throttle: Add support for burst periods, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 23/34] qapi: Add burst length parameters to block_set_io_throttle, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 27/34] qemu-iotests: Extend iotest 093 to test bursts, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 31/34] blockdev: unset inappropriate flags when changing medium, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 32/34] qemu-iotests: 067: ignore QMP events,
Kevin Wolf <=
- [Qemu-devel] [PULL 29/34] docs: Document the throttling infrastructure, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 34/34] qemu-iotests: 140: make description slightly more verbose, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 28/34] qapi: Correct the name of the iops_rd parameter, Kevin Wolf, 2016/02/22
- Re: [Qemu-devel] [PULL 00/34] Block layer patches, Peter Maydell, 2016/02/22