From 0b4ebff45793c2d96434ff91b6f4a6f607492e86 Mon Sep 17 00:00:00 2001 From: Victoria Grain <49324855+gratux@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:41:41 +0100 Subject: [PATCH 1/3] write generated files to disk image --- tortillas/test_runner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tortillas/test_runner.py b/tortillas/test_runner.py index 48b2a12..7b91116 100644 --- a/tortillas/test_runner.py +++ b/tortillas/test_runner.py @@ -381,8 +381,12 @@ def _run( # Wait a bit for cleanup and debug output to be flushed time.sleep(1) + # analyze before exiting the shell, to keep exit codes intact + test.analyze(status) - test.analyze(status) + # exit the shell, so files are written to the qcow2 image + qemu.sweb_input("exit\n") + time.sleep(1) log.info("Done!") if callback: From 7afcc1c62a0d80f5a53ad469467e7ff47b88e9a6 Mon Sep 17 00:00:00 2001 From: Victoria Grain <49324855+gratux@users.noreply.github.com> Date: Mon, 13 Nov 2023 20:01:10 +0100 Subject: [PATCH 2/3] consider unplanned timeouts as errors --- tortillas/test_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tortillas/test_runner.py b/tortillas/test_runner.py index 7b91116..ffb549b 100644 --- a/tortillas/test_runner.py +++ b/tortillas/test_runner.py @@ -186,7 +186,7 @@ def run_test(test_queue: list[TestRun]): # Testing finished self.success = not any( - test_run.result.status in (TestStatus.FAILED, TestStatus.PANIC) + test_run.result.status in (TestStatus.FAILED, TestStatus.PANIC, TestStatus.TIMEOUT) for test_run in self.test_runs ) From c67dfbe61072aed15557516aaffde53bf0fd5146 Mon Sep 17 00:00:00 2001 From: Victoria Grain <49324855+gratux@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:06:12 +0100 Subject: [PATCH 3/3] no logs should trigger missing exit codes --- tortillas/log_analyzer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tortillas/log_analyzer.py b/tortillas/log_analyzer.py index c1e0a71..beb1488 100644 --- a/tortillas/log_analyzer.py +++ b/tortillas/log_analyzer.py @@ -142,8 +142,11 @@ def analyze( else TestStatus[config_entry.set_status] ) - if not logs: - continue + # fixme: this is flawed, why is this here? + # when tortillas gets no logs and and aborts, it can't detect incorrect or missing exit codes + # as a result, every test with incorrect exit codes passes + # if not logs: + # continue if config_entry.mode == "add_as_error": result.add_errors(logs, status)