Skip to content

Commit

Permalink
Merge pull request #471 from liangxiao1/aws
Browse files Browse the repository at this point in the history
test_boot_debugkernel: skip set kmemleak if cpu > 36
  • Loading branch information
liangxiao1 authored Nov 13, 2024
2 parents 8830f27 + 22e42a6 commit 8334675
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion os_tests/tests/test_general_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,7 @@ def test_check_dmesg_sev(self):
key_steps:
# dmesg|grep -i sev
expect_result:
AMD Memory Encryption Features active: SEV
"AMD Memory Encryption Features active: SEV"
debug_want:
# dmesg
"""
Expand Down
14 changes: 9 additions & 5 deletions os_tests/tests/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ def test_boot_debugkernel(self):
utils_lib.run_cmd(self, cmd, expect_ret=0, msg="change default boot index")
cmd = 'cat /proc/cmdline'
cmd_options = utils_lib.run_cmd(self, cmd)
if 'kmemleak=on' not in cmd_options:
need_reboot = True
cmd = 'cat /proc/cpuinfo |grep processor|wc -l'
cpucount = utils_lib.run_cmd(self, cmd, msg='get cpu count')
self.log.info("Do not collect memory leak when cpucount is over 36 - RHEL-65525")
if int(cpucount) <= 36:
if 'kmemleak=on' not in cmd_options:
need_reboot = True
cmd = 'sudo grubby --update-kernel=ALL --args="kmemleak=on"'
utils_lib.run_cmd(self, cmd, expect_ret=0, msg="enable kmemleak")
if need_reboot:
cmd = 'sudo grubby --update-kernel=ALL --args="kmemleak=on"'
utils_lib.run_cmd(self, cmd, expect_ret=0, msg="enable kmemleak")
utils_lib.run_cmd(self, 'sudo reboot', msg='reboot system under test')
time.sleep(10)
utils_lib.init_connection(self, timeout=self.ssh_timeout)
Expand Down Expand Up @@ -177,7 +181,7 @@ def test_boot_debugkernel(self):
self.log.info("Wait for bootup finish......")
time.sleep(1)
utils_lib.run_cmd(self, "sudo dmesg", expect_not_kw="Call trace,Call Trace")
if int(mini_mem) <= 32:
if int(mini_mem) <= 32 and int(cpucount) <= 36:
cmd = 'sudo bash -c "echo scan > /sys/kernel/debug/kmemleak"'
utils_lib.run_cmd(self, cmd, expect_ret=0, timeout=1800)

Expand Down

0 comments on commit 8334675

Please sign in to comment.