From 7360f78514c3bed30f318f2c2dd9f1a1d6687dbe Mon Sep 17 00:00:00 2001 From: Deb McLemore Date: Sun, 21 Apr 2019 19:12:10 -0500 Subject: [PATCH] SystemLogin: Add BMC checks for OOM Add filtering to check the BMC dmesg's for Out of memory and Killed process. Signed-off-by: Deb McLemore --- testcases/SystemLogin.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/testcases/SystemLogin.py b/testcases/SystemLogin.py index cec54580f..c2457a454 100644 --- a/testcases/SystemLogin.py +++ b/testcases/SystemLogin.py @@ -83,6 +83,14 @@ def runTest(self): if (isinstance(self.cv_BMC, OpTestMambo.OpTestMambo)) \ or (isinstance(self.cv_BMC, OpTestQemu.OpTestQemu)): raise unittest.SkipTest("QEMU/Mambo so skipping BMCLogin test") + + filter_list = [ + 'Out of memory: Kill process', + 'Killed process', + ] + + found_issues = [] + r = self.cv_BMC.run_command("echo 'Hello World'") self.assertIn("Hello World", r) try: @@ -91,6 +99,16 @@ def runTest(self): self.assertEqual(r.exitcode, 1) for i in range(2): self.cv_BMC.run_command("dmesg") + try: + r = self.cv_BMC.run_command("dmesg") + for f in filter_list: + fre = re.compile(f) + found_issues = [l for l in r if fre.search(l)] + log.debug("BMC found_issues={}".format(found_issues)) + msg = '\n'.join(filter(None, found_issues)) + self.assertTrue( len(found_issues) == 0, "REPORT_BUG BMC dmesg, debug log has full details:\n{}".format(msg)) + except CommandFailed as r: + log.debug("BMC dmesg grep for issues failed") class SSHHostLogin(unittest.TestCase): '''