Introduce EndsWithBye log analysis check

It was initially foreseen to just check the program exit code, but most
executables don't return with 0 (so the CI would always fail). Add a
separate check that will check for the Bye., only going through the last
X lines instead of the entire file.
This commit is contained in:
Robert Schmidt
2026-02-26 13:36:17 +01:00
parent 735058f5c4
commit 5165834051
3 changed files with 33 additions and 0 deletions

View File

@@ -110,5 +110,22 @@ UE 257a: ulsch_rounds 41777/2863/10/0, ulsch_errors 0, ulsch_DTX 17, BLER 0.1145
self.assertTrue(result)
self.assertEqual(log, expected)
def test_ends_no_bye(self):
f = "tests/log-analysis/arbitrary.log"
opt = None
result, log = cls_loganalysis.EndsWithBye.run(f, opt)
expected = "No Bye. message found, did not stop properly"
self.assertFalse(result)
self.assertEqual(log, expected)
def test_ends_with_bye(self):
f = "tests/log-analysis/with-bye.log"
opt = None
result, log = cls_loganalysis.EndsWithBye.run(f, opt)
expected = ""
self.assertTrue(result)
self.assertEqual(log, expected)
if __name__ == '__main__':
unittest.main()

View File

@@ -0,0 +1,3 @@
Some other logs
Bye.
process exited.