On 11/11/2014 06:34 AM, Max Reitz wrote:
_filter_qmp should be able to correctly filter out the QMP version
object for pretty JSON output.
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/common.filter | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 3acdb30..e24dab4 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -165,9 +165,23 @@ _filter_qemu()
# replace problematic QMP output like timestamps
_filter_qmp()
{
+ discard=0
+
_filter_win32 | \
sed -e 's#\("\(micro\)\?seconds": \)[0-9]\+#\1 TIMESTAMP#g' \
- -e 's#^{"QMP":.*}$#QMP_VERSION#'
+ -e 's#^{"QMP":.*}$#QMP_VERSION#' \
+ -e 's#\\#\\\\#g' | \
+ while IFS='' read line; do
+ if [[ $line == ' "QMP": {' ]]; then
Good that this is a /bin/bash script and not /bin/sh :)