[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 11/15] qemu_iotests: allow valgrind to read/delete the generat
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v3 11/15] qemu_iotests: allow valgrind to read/delete the generated log file |
Date: |
Wed, 14 Apr 2021 19:03:48 +0200 |
When using -valgrind on the script tests, it generates a log file
in $TEST_DIR that is either read (if valgrind finds problems) or
otherwise deleted. Provide the same exact behavior when using
-valgrind on the python tests.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
tests/qemu-iotests/iotests.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 94597433fa..aef67e3a86 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -600,6 +600,26 @@ def __init__(self, path_suffix=''):
sock_dir=sock_dir)
self._num_drives = 0
+ def subprocess_check_valgrind(self, valgrind) -> None:
+
+ if not valgrind:
+ return
+
+ valgrind_filename = test_dir + "/" + str(self._popen.pid) +
".valgrind"
+
+ if self.exitcode() == 99:
+ with open(valgrind_filename) as f:
+ content = f.readlines()
+ for line in content:
+ print(line, end ="")
+ print("")
+ else:
+ os.remove(valgrind_filename)
+
+ def _post_shutdown(self) -> None:
+ super()._post_shutdown()
+ self.subprocess_check_valgrind(qemu_valgrind)
+
def add_object(self, opts):
self._args.append('-object')
self._args.append(opts)
--
2.30.2
- Re: [PATCH v3 10/15] qemu_iotests: extent QMP socket timeout when using valgrind, (continued)
- [PATCH v3 09/15] qemu_iotests: extend the check script to support valgrind for python tests, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 13/15] docs/devel/testing: add -valgrind option to the debug section of QEMU iotests, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 12/15] qemu_iotests: insert valgrind command line as wrapper for qemu binary, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 15/15] docs/devel/testing: add -p option to the debug section of QEMU iotests, Emanuele Giuseppe Esposito, 2021/04/14
- [PATCH v3 11/15] qemu_iotests: allow valgrind to read/delete the generated log file,
Emanuele Giuseppe Esposito <=
- [PATCH v3 14/15] qemu_iotests: add option to show qemu binary logs on stdout, Emanuele Giuseppe Esposito, 2021/04/14