mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
qemu-iotests: Filter HMP readline escape characters
The only thing the escape characters achieve is making the reference output unreadable and lines that are potentially so long that git doesn't want to put them into an email any more. Let's filter them out. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
@@ -469,7 +469,7 @@ No errors were found on the image.
|
||||
block-backup
|
||||
|
||||
Formatting 'TEST_DIR/t.IMGFMT.copy', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
|
||||
(qemu) i[K[Din[K[D[Dinf[K[D[D[Dinfo[K[D[D[D[Dinfo [K[D[D[D[D[Dinfo b[K[D[D[D[D[D[Dinfo bl[K[D[D[D[D[D[D[Dinfo blo[K[D[D[D[D[D[D[D[Dinfo bloc[K[D[D[D[D[D[D[D[D[Dinfo block[K[D[D[D[D[D[D[D[D[D[Dinfo block-[K[D[D[D[D[D[D[D[D[D[D[Dinfo block-j[K[D[D[D[D[D[D[D[D[D[D[D[Dinfo block-jo[K[D[D[D[D[D[D[D[D[D[D[D[D[Dinfo block-job[K[D[D[D[D[D[D[D[D[D[D[D[D[D[Dinfo block-jobs[K
|
||||
(qemu) info block-jobs
|
||||
No active jobs
|
||||
=== IO: pattern 195
|
||||
read 512/512 bytes at offset 3221194240
|
||||
|
||||
@@ -60,7 +60,8 @@ function do_run_qemu()
|
||||
|
||||
function run_qemu()
|
||||
{
|
||||
do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_generated_node_ids
|
||||
do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu |
|
||||
_filter_generated_node_ids | _filter_hmp
|
||||
}
|
||||
|
||||
size=128M
|
||||
|
||||
+53
-53
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -62,11 +62,11 @@ esac
|
||||
# Give qemu some time to boot before saving the VM state
|
||||
bash -c 'sleep 1; echo -e "savevm 0\nquit"' |\
|
||||
$QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" |\
|
||||
_filter_qemu
|
||||
_filter_qemu | _filter_hmp
|
||||
# Now try to continue from that VM state (this should just work)
|
||||
echo quit |\
|
||||
$QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" -loadvm 0 |\
|
||||
_filter_qemu
|
||||
_filter_qemu | _filter_hmp
|
||||
|
||||
# success, all done
|
||||
echo "*** done"
|
||||
|
||||
@@ -4,8 +4,8 @@ QA output created by 068
|
||||
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) s[K[Dsa[K[D[Dsav[K[D[D[Dsave[K[D[D[D[Dsavev[K[D[D[D[D[Dsavevm[K[D[D[D[D[D[Dsavevm [K[D[D[D[D[D[D[Dsavevm 0[K
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) savevm 0
|
||||
(qemu) quit
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) quit
|
||||
*** done
|
||||
|
||||
@@ -9,14 +9,14 @@ virtual size: 64M (67108864 bytes)
|
||||
=== HMP commit ===
|
||||
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) c[K[Dco[K[D[Dcom[K[D[D[Dcomm[K[D[D[D[Dcommi[K[D[D[D[D[Dcommit[K[D[D[D[D[D[Dcommit [K[D[D[D[D[D[D[Dcommit t[K[D[D[D[D[D[D[D[Dcommit te[K[D[D[D[D[D[D[D[D[Dcommit tes[K[D[D[D[D[D[D[D[D[D[Dcommit test[K[D[D[D[D[D[D[D[D[D[D[Dcommit testd[K[D[D[D[D[D[D[D[D[D[D[D[Dcommit testdi[K[D[D[D[D[D[D[D[D[D[D[D[D[Dcommit testdis[K[D[D[D[D[D[D[D[D[D[D[D[D[D[Dcommit testdisk[K
|
||||
(qemu) commit testdisk
|
||||
(qemu)
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 64M (67108864 bytes)
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.orig backing_fmt=raw
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) c[K[Dco[K[D[Dcom[K[D[D[Dcomm[K[D[D[D[Dcommi[K[D[D[D[D[Dcommit[K[D[D[D[D[D[Dcommit [K[D[D[D[D[D[D[Dcommit t[K[D[D[D[D[D[D[D[Dcommit te[K[D[D[D[D[D[D[D[D[Dcommit tes[K[D[D[D[D[D[D[D[D[D[Dcommit test[K[D[D[D[D[D[D[D[D[D[D[Dcommit testd[K[D[D[D[D[D[D[D[D[D[D[D[Dcommit testdi[K[D[D[D[D[D[D[D[D[D[D[D[D[Dcommit testdis[K[D[D[D[D[D[D[D[D[D[D[D[D[D[Dcommit testdisk[K
|
||||
(qemu) commit testdisk
|
||||
(qemu)
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
|
||||
@@ -62,7 +62,7 @@ function do_run_qemu()
|
||||
|
||||
function run_qemu()
|
||||
{
|
||||
do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu
|
||||
do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_hmp
|
||||
}
|
||||
|
||||
size=128M
|
||||
|
||||
@@ -7,23 +7,23 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,cache=none
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) quit
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,cache=directsync
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) quit
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,cache=writeback
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) quit
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,cache=writethrough
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) quit
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,cache=unsafe
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) quit
|
||||
|
||||
Testing: -drive file=TEST_DIR/t.qcow2,cache=invalid_value
|
||||
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,cache=invalid_value: invalid cache option
|
||||
|
||||
@@ -43,7 +43,8 @@ _supported_proto generic
|
||||
_supported_os Linux
|
||||
|
||||
_make_test_img 1M
|
||||
echo quit | $QEMU -nographic -hda "$TEST_IMG" -incoming 'exec:true' -snapshot -serial none -monitor stdio | _filter_qemu
|
||||
echo quit | $QEMU -nographic -hda "$TEST_IMG" -incoming 'exec:true' -snapshot -serial none -monitor stdio |
|
||||
_filter_qemu | _filter_hmp
|
||||
|
||||
# success, all done
|
||||
echo "*** done"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
QA output created by 145
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
|
||||
QEMU X.Y.Z monitor - type 'help' for more information
|
||||
(qemu) q[K[Dqu[K[D[Dqui[K[D[D[Dquit[K
|
||||
(qemu) quit
|
||||
*** done
|
||||
|
||||
@@ -86,6 +86,13 @@ _filter_qmp()
|
||||
-e ' QMP_VERSION'
|
||||
}
|
||||
|
||||
# readline makes HMP command strings so long that git complains
|
||||
_filter_hmp()
|
||||
{
|
||||
sed -e $'s/^\\((qemu) \\)\\?.*\e\\[D/\\1/g' \
|
||||
-e $'s/\e\\[K//g'
|
||||
}
|
||||
|
||||
# replace block job offset
|
||||
_filter_block_job_offset()
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ function _timed_wait_for()
|
||||
do
|
||||
if [ -z "${silent}" ]; then
|
||||
echo "${resp}" | _filter_testdir | _filter_qemu \
|
||||
| _filter_qemu_io | _filter_qmp
|
||||
| _filter_qemu_io | _filter_qmp | _filter_hmp
|
||||
fi
|
||||
grep -q "${*}" < <(echo ${resp})
|
||||
if [ $? -eq 0 ]; then
|
||||
@@ -217,7 +217,7 @@ function _cleanup_qemu()
|
||||
|
||||
if [ -n "${wait}" ]; then
|
||||
cat <&${QEMU_OUT[$i]} | _filter_testdir | _filter_qemu \
|
||||
| _filter_qemu_io | _filter_qmp
|
||||
| _filter_qemu_io | _filter_qmp | _filter_hmp
|
||||
fi
|
||||
rm -f "${QEMU_FIFO_IN}_${i}" "${QEMU_FIFO_OUT}_${i}"
|
||||
eval "exec ${QEMU_IN[$i]}<&-" # close file descriptors
|
||||
|
||||
Reference in New Issue
Block a user