提交 69404d9e 编写于 作者: K Kevin Wolf

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: NKevin Wolf <kwolf@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 0042fd36
...@@ -469,7 +469,7 @@ No errors were found on the image. ...@@ -469,7 +469,7 @@ No errors were found on the image.
block-backup block-backup
Formatting 'TEST_DIR/t.IMGFMT.copy', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT Formatting 'TEST_DIR/t.IMGFMT.copy', fmt=IMGFMT size=4294968832 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
(qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo blockinfo block-info block-jinfo block-joinfo block-jobinfo block-jobs (qemu) info block-jobs
No active jobs No active jobs
=== IO: pattern 195 === IO: pattern 195
read 512/512 bytes at offset 3221194240 read 512/512 bytes at offset 3221194240
......
...@@ -60,7 +60,8 @@ function do_run_qemu() ...@@ -60,7 +60,8 @@ function do_run_qemu()
function 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 size=128M
......
此差异已折叠。
此差异已折叠。
...@@ -62,11 +62,11 @@ esac ...@@ -62,11 +62,11 @@ esac
# Give qemu some time to boot before saving the VM state # Give qemu some time to boot before saving the VM state
bash -c 'sleep 1; echo -e "savevm 0\nquit"' |\ bash -c 'sleep 1; echo -e "savevm 0\nquit"' |\
$QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" |\ $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) # Now try to continue from that VM state (this should just work)
echo quit |\ echo quit |\
$QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" -loadvm 0 |\ $QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" -loadvm 0 |\
_filter_qemu _filter_qemu | _filter_hmp
# success, all done # success, all done
echo "*** done" echo "*** done"
......
...@@ -4,8 +4,8 @@ QA output created by 068 ...@@ -4,8 +4,8 @@ QA output created by 068
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) ssasavsavesavevsavevmsavevm savevm 0 (qemu) savevm 0
(qemu) qququiquit (qemu) quit
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) qququiquit (qemu) quit
*** done *** done
...@@ -9,14 +9,14 @@ virtual size: 64M (67108864 bytes) ...@@ -9,14 +9,14 @@ virtual size: 64M (67108864 bytes)
=== HMP commit === === HMP commit ===
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) ccocomcommcommicommitcommit commit tcommit tecommit tescommit testcommit testdcommit testdicommit testdiscommit testdisk (qemu) commit testdisk
(qemu) (qemu)
image: TEST_DIR/t.IMGFMT image: TEST_DIR/t.IMGFMT
file format: IMGFMT file format: IMGFMT
virtual size: 64M (67108864 bytes) virtual size: 64M (67108864 bytes)
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.orig backing_fmt=raw 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 X.Y.Z monitor - type 'help' for more information
(qemu) ccocomcommcommicommitcommit commit tcommit tecommit tescommit testcommit testdcommit testdicommit testdiscommit testdisk (qemu) commit testdisk
(qemu) (qemu)
image: TEST_DIR/t.IMGFMT image: TEST_DIR/t.IMGFMT
file format: IMGFMT file format: IMGFMT
......
...@@ -62,7 +62,7 @@ function do_run_qemu() ...@@ -62,7 +62,7 @@ function do_run_qemu()
function 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 size=128M
......
...@@ -7,23 +7,23 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/ ...@@ -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 Testing: -drive file=TEST_DIR/t.qcow2,cache=none
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) qququiquit (qemu) quit
Testing: -drive file=TEST_DIR/t.qcow2,cache=directsync Testing: -drive file=TEST_DIR/t.qcow2,cache=directsync
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) qququiquit (qemu) quit
Testing: -drive file=TEST_DIR/t.qcow2,cache=writeback Testing: -drive file=TEST_DIR/t.qcow2,cache=writeback
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) qququiquit (qemu) quit
Testing: -drive file=TEST_DIR/t.qcow2,cache=writethrough Testing: -drive file=TEST_DIR/t.qcow2,cache=writethrough
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) qququiquit (qemu) quit
Testing: -drive file=TEST_DIR/t.qcow2,cache=unsafe Testing: -drive file=TEST_DIR/t.qcow2,cache=unsafe
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) qququiquit (qemu) quit
Testing: -drive file=TEST_DIR/t.qcow2,cache=invalid_value Testing: -drive file=TEST_DIR/t.qcow2,cache=invalid_value
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,cache=invalid_value: invalid cache option QEMU_PROG: -drive file=TEST_DIR/t.qcow2,cache=invalid_value: invalid cache option
......
...@@ -43,7 +43,8 @@ _supported_proto generic ...@@ -43,7 +43,8 @@ _supported_proto generic
_supported_os Linux _supported_os Linux
_make_test_img 1M _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 # success, all done
echo "*** done" echo "*** done"
......
QA output created by 145 QA output created by 145
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) qququiquit (qemu) quit
*** done *** done
...@@ -86,6 +86,13 @@ _filter_qmp() ...@@ -86,6 +86,13 @@ _filter_qmp()
-e ' QMP_VERSION' -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 # replace block job offset
_filter_block_job_offset() _filter_block_job_offset()
{ {
......
...@@ -59,7 +59,7 @@ function _timed_wait_for() ...@@ -59,7 +59,7 @@ function _timed_wait_for()
do do
if [ -z "${silent}" ]; then if [ -z "${silent}" ]; then
echo "${resp}" | _filter_testdir | _filter_qemu \ echo "${resp}" | _filter_testdir | _filter_qemu \
| _filter_qemu_io | _filter_qmp | _filter_qemu_io | _filter_qmp | _filter_hmp
fi fi
grep -q "${*}" < <(echo ${resp}) grep -q "${*}" < <(echo ${resp})
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -217,7 +217,7 @@ function _cleanup_qemu() ...@@ -217,7 +217,7 @@ function _cleanup_qemu()
if [ -n "${wait}" ]; then if [ -n "${wait}" ]; then
cat <&${QEMU_OUT[$i]} | _filter_testdir | _filter_qemu \ cat <&${QEMU_OUT[$i]} | _filter_testdir | _filter_qemu \
| _filter_qemu_io | _filter_qmp | _filter_qemu_io | _filter_qmp | _filter_hmp
fi fi
rm -f "${QEMU_FIFO_IN}_${i}" "${QEMU_FIFO_OUT}_${i}" rm -f "${QEMU_FIFO_IN}_${i}" "${QEMU_FIFO_OUT}_${i}"
eval "exec ${QEMU_IN[$i]}<&-" # close file descriptors eval "exec ${QEMU_IN[$i]}<&-" # close file descriptors
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册