Skip to content

Commit

Permalink
SystemLogin: Add BMC checks for OOM
Browse files Browse the repository at this point in the history
Add filtering to check the BMC dmesg's for Out of memory and Killed
process.

Signed-off-by: Deb McLemore <[email protected]>
  • Loading branch information
debmc committed Apr 29, 2019
1 parent 8855e2e commit 921964b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions testcases/SystemLogin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -91,6 +99,19 @@ 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))
if len(found_issues) != 0:
r = self.cv_BMC.run_command("dmesg -c")
log.debug("REPORT_BUG so we cleared dmesg to allow other tests to succeed")
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):
'''
Expand Down

0 comments on commit 921964b

Please sign in to comment.