mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
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:
@@ -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()
|
||||
|
||||
3
ci-scripts/tests/log-analysis/with-bye.log
Normal file
3
ci-scripts/tests/log-analysis/with-bye.log
Normal file
@@ -0,0 +1,3 @@
|
||||
Some other logs
|
||||
Bye.
|
||||
process exited.
|
||||
Reference in New Issue
Block a user