Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemLogin: Add BMC checks for OOM #480

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions testcases/SystemLogin.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,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 @@ -95,6 +103,19 @@ def runTest(self):
self.assertEqual(r.exitcode, 1)
for i in range(2):
self.cv_BMC.run_command("dmesg")
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we are running 'dmesg' inside try command, can we remove the line running dmesg twice in for loop.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the original intent of running twice was to exercise the paths, make sure the console is working, login, etc. I think we can leave. This test is run as a "smoke test" in some CI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's only there to generate some console output we should do something like find / and limit the output to 1000 lines or something. If the dmesg log is cleared before op-test is run against the system then this won't be doing much for us.

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