[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/39] tests/functional: avoid accessing log_filename on earlier
From: |
Alex Bennée |
Subject: |
[PATCH 18/39] tests/functional: avoid accessing log_filename on earlier failures |
Date: |
Thu, 21 Nov 2024 16:57:45 +0000 |
From: Daniel P. Berrangé <berrange@redhat.com>
If a failure occurs early in the QemuBaseTest constructor, the
'log_filename' object atttribute may not exist yet. This happens
most notably if the QEMU_TEST_QEMU_BINARY is not set. We can't
initialize 'log_filename' earlier as we use the binary to identify
the architecture which is then used to build the path in which the
logs are stored.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20241121154218.1423005-19-berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/functional/qemu_test/testcase.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/functional/qemu_test/testcase.py
b/tests/functional/qemu_test/testcase.py
index fceafb32b0..90ae59eb54 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -81,10 +81,12 @@ def main():
res = unittest.main(module = None, testRunner = tr, exit = False,
argv=["__dummy__", path])
for (test, message) in res.result.errors + res.result.failures:
- print('More information on ' + test.id() + ' could be found here:'
- '\n %s' % test.log_filename, file=sys.stderr)
- if hasattr(test, 'console_log_name'):
- print(' %s' % test.console_log_name, file=sys.stderr)
+
+ if hasattr(test, "log_filename"):
+ print('More information on ' + test.id() + ' could be found
here:'
+ '\n %s' % test.log_filename, file=sys.stderr)
+ if hasattr(test, 'console_log_name'):
+ print(' %s' % test.console_log_name, file=sys.stderr)
sys.exit(not res.result.wasSuccessful())
--
2.39.5
- Re: [PATCH 24/39] tests/functional: update the mips32 tuxrun tests, (continued)
- [PATCH 35/39] plugins: add missing export for qemu_plugin_num_vcpus, Alex Bennée, 2024/11/21
- [PATCH 21/39] tests/functional: update the aarch64 tuxrun tests, Alex Bennée, 2024/11/21
- [PATCH 17/39] tests/functional: add a QMP backdoor for debugging stalled tests, Alex Bennée, 2024/11/21
- [PATCH 29/39] tests/functional: update the ppc64 tuxrun tests, Alex Bennée, 2024/11/21
- [PATCH 33/39] tests/functional: update the sparc64 tuxrun tests, Alex Bennée, 2024/11/21
- [PATCH 18/39] tests/functional: avoid accessing log_filename on earlier failures,
Alex Bennée <=
- [PATCH 20/39] tests/functional: update the arm tuxrun tests, Alex Bennée, 2024/11/21
- [PATCH 23/39] tests/functional: add a m68k tuxrun tests, Alex Bennée, 2024/11/21
- [PATCH 25/39] tests/functional: update the mips32el tuxrun tests, Alex Bennée, 2024/11/21
- [PATCH 22/39] tests/functional: update the i386 tuxrun tests, Alex Bennée, 2024/11/21