From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcCy4-0007kk-6L for qemu-devel@nongnu.org; Tue, 23 Aug 2016 10:46:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcCxy-0000PL-Rk for qemu-devel@nongnu.org; Tue, 23 Aug 2016 10:46:19 -0400 From: Kevin Wolf Date: Tue, 23 Aug 2016 16:46:00 +0200 Message-Id: <1471963560-1433-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] qemu-iotests: Log QMP traffic in debug mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Python tests are already annoying enough to debug. With QMP traffic available it's a little bit easier at least. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 03bccdd..3329bc1 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -50,6 +50,7 @@ cachemode = os.environ.get('CACHEMODE') qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE') socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper') +debug = False def qemu_img(*args): '''Run qemu-img and return the exit code''' @@ -134,6 +135,8 @@ class VM(qtest.QEMUQtestMachine): def __init__(self): super(VM, self).__init__(qemu_prog, qemu_opts, test_dir=test_dir, socket_scm_helper=socket_scm_helper) + if debug: + self._debug = True self._num_drives = 0 def add_device(self, opts): @@ -323,6 +326,8 @@ def verify_quorum(): def main(supported_fmts=[], supported_oses=['linux']): '''Run tests''' + global debug + # We are using TEST_DIR and QEMU_DEFAULT_MACHINE as proxies to # indicate that we're not being run via "check". There may be # other things set up by "check" that individual test cases rely -- 1.8.3.1