Message ID | 20241121165806.476008-19-alex.bennee@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | maintainer updates for -rc2 pre-PR | expand |
On 21/11/2024 17.57, Alex Bennée wrote: > 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 s/atttribute/attribute/ > 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. With the typo fixed: Reviewed-by: Thomas Huth <thuth@redhat.com>
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())