[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/56] qemu-iotests: add gdbserver option to script tests too
From: |
Hanna Reitz |
Subject: |
[PULL 08/56] qemu-iotests: add gdbserver option to script tests too |
Date: |
Wed, 1 Sep 2021 17:15:31 +0200 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Remove read timer in test script when GDB_OPTIONS are set,
so that the bash tests won't timeout while running gdb.
The only limitation here is that running a script with gdbserver
will make the test output mismatch with the expected
results, making the test fail.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20210809090114.64834-9-eesposit@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
tests/qemu-iotests/common.qemu | 7 ++++++-
tests/qemu-iotests/common.rc | 8 +++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index 0fc52d20d7..0f1fecc68e 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -85,7 +85,12 @@ _timed_wait_for()
timeout=yes
QEMU_STATUS[$h]=0
- while IFS= read -t ${QEMU_COMM_TIMEOUT} resp <&${QEMU_OUT[$h]}
+ read_timeout="-t ${QEMU_COMM_TIMEOUT}"
+ if [ -n "${GDB_OPTIONS}" ]; then
+ read_timeout=
+ fi
+
+ while IFS= read ${read_timeout} resp <&${QEMU_OUT[$h]}
do
if [ -n "$capture_events" ]; then
capture=0
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 609d82de89..d8582454de 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -166,8 +166,14 @@ _qemu_wrapper()
if [ -n "${QEMU_NEED_PID}" ]; then
echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"
fi
+
+ GDB=""
+ if [ -n "${GDB_OPTIONS}" ]; then
+ GDB="gdbserver ${GDB_OPTIONS}"
+ fi
+
VALGRIND_QEMU="${VALGRIND_QEMU_VM}" _qemu_proc_exec
"${VALGRIND_LOGFILE}" \
- "$QEMU_PROG" $QEMU_OPTIONS "$@"
+ $GDB "$QEMU_PROG" $QEMU_OPTIONS "$@"
)
RETVAL=$?
_qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
--
2.31.1
- [PULL 00/56] Block patches, Hanna Reitz, 2021/09/01
- [PULL 01/56] python: qemu: add timer parameter for qmp.accept socket, Hanna Reitz, 2021/09/01
- [PULL 03/56] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine, Hanna Reitz, 2021/09/01
- [PULL 02/56] python: Reduce strictness of pylint's duplicate-code check, Hanna Reitz, 2021/09/01
- [PULL 05/56] qemu-iotests: add option to attach gdbserver, Hanna Reitz, 2021/09/01
- [PULL 04/56] docs/devel/testing: add debug section to the QEMU iotests chapter, Hanna Reitz, 2021/09/01
- [PULL 06/56] qemu-iotests: delay QMP socket timers, Hanna Reitz, 2021/09/01
- [PULL 08/56] qemu-iotests: add gdbserver option to script tests too,
Hanna Reitz <=
- [PULL 07/56] qemu_iotests: insert gdbserver command line as wrapper for qemu binary, Hanna Reitz, 2021/09/01
- [PULL 10/56] qemu-iotests: extend the check script to prepare supporting valgrind for python tests, Hanna Reitz, 2021/09/01
- [PULL 11/56] qemu-iotests: extend QMP socket timeout when using valgrind, Hanna Reitz, 2021/09/01
- [PULL 09/56] docs/devel/testing: add -gdb option to the debugging section of QEMU iotests, Hanna Reitz, 2021/09/01
- [PULL 12/56] qemu-iotests: allow valgrind to read/delete the generated log file, Hanna Reitz, 2021/09/01
- [PULL 13/56] qemu-iotests: insert valgrind command line as wrapper for qemu binary, Hanna Reitz, 2021/09/01
- [PULL 14/56] docs/devel/testing: add -valgrind option to the debug section of QEMU iotests, Hanna Reitz, 2021/09/01
- [PULL 16/56] docs/devel/testing: add -p option to the debug section of QEMU iotests, Hanna Reitz, 2021/09/01
- [PULL 17/56] block/monitor: Consolidate hmp_handle_error calls to reduce redundant code, Hanna Reitz, 2021/09/01
- [PULL 18/56] raw-format: drop WRITE and RESIZE child perms when possible, Hanna Reitz, 2021/09/01