mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 19:14:58 -06:00
tests/functional: avoid accessing log_filename on earlier failures
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> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20241121165806.476008-19-alex.bennee@linaro.org>
This commit is contained in:
parent
1a8755a51e
commit
f5578e427f
1 changed files with 6 additions and 4 deletions
|
@ -81,10 +81,12 @@ class QemuBaseTest(unittest.TestCase):
|
||||||
res = unittest.main(module = None, testRunner = tr, exit = False,
|
res = unittest.main(module = None, testRunner = tr, exit = False,
|
||||||
argv=["__dummy__", path])
|
argv=["__dummy__", path])
|
||||||
for (test, message) in res.result.errors + res.result.failures:
|
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, "log_filename"):
|
||||||
if hasattr(test, 'console_log_name'):
|
print('More information on ' + test.id() + ' could be found here:'
|
||||||
print(' %s' % test.console_log_name, file=sys.stderr)
|
'\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())
|
sys.exit(not res.result.wasSuccessful())
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue