Skip to content

Commit

Permalink
Fix kdump/Fadump config
Browse files Browse the repository at this point in the history
ServiceReport fails to estimate correct crashkernel size.
This is a temporary fix to define crashkernel size.

Signed-off-by: Sachin P Bappalige <[email protected]>
  • Loading branch information
Sachin P Bappalige committed Apr 23, 2024
1 parent e4c4fb6 commit 4fc59c9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
4 changes: 2 additions & 2 deletions op-test
Original file line number Diff line number Diff line change
Expand Up @@ -693,15 +693,15 @@ class OSdumpfadumpSuite():
def __init__(self):
self.s = unittest.TestSuite()
self.s.addTest(PowerNVDump.KernelCrash_FadumpEnable())
self.s.addTest(PowerNVDump.OpTestMakedump())
self.s.addTest(PowerNVDump.KernelCrash_KdumpDLPAR())
self.s.addTest(PowerNVDump.KernelCrash_KdumpWorkLoad())
self.s.addTest(PowerNVDump.KernelCrash_hugepage_checks())
self.s.addTest(PowerNVDump.KernelCrash_XIVE_off())
self.s.addTest(PowerNVDump.KernelCrash_disable_radix())
self.s.addTest(PowerNVDump.KernelCrash_FadumpNocma())
self.s.addTest(PowerNVDump.OpTestMakedump())
self.s.addTest(PowerNVDump.KernelCrash_KdumpSSH())
self.s.addTest(PowerNVDump.KernelCrash_KdumpNFS())
self.s.addTest(PowerNVDump.KernelCrash_FadumpNocma())

def suite(self):
return self.s
Expand Down
45 changes: 31 additions & 14 deletions testcases/PowerNVDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ def verify_fadump_reg(self):
if int(res) == 1:
return True
else:
self.c.run_command("echo 1 > /sys/kernel/fadump_registered")
self.c.run_command('\r\n')
self.c.run_command("echo 1 > /sys/kernel/fadump_registered; sleep 10")
self.c.run_command("cat /sys/kernel/fadump_registered")

if not self.is_lpar:
Expand Down Expand Up @@ -330,14 +329,12 @@ def verify_fadump_unreg(self):
if int(res) == 0:
return True
else:
self.c.run_command("echo 0 > /sys/kernel/fadump_registered")
self.c.run_command('\r\n')
self.c.run_command("echo 0 > /sys/kernel/fadump_registered; sleep 10")

if not self.is_lpar:
self.c.run_command("%s > /tmp/opal_log" % BMC_CONST.OPAL_MSG_LOG)
self.c.run_command("dmesg > /tmp/dmesg_log")
self.c.run_command("echo 0 > /sys/kernel/fadump_registered")
self.c.run_command('\r\n')
self.c.run_command("echo 0 > /sys/kernel/fadump_registered; sleep 10")

opal_data = " ".join(self.c.run_command(
"%s | diff -a /tmp/opal_log -" % BMC_CONST.OPAL_MSG_LOG))
Expand Down Expand Up @@ -632,14 +629,10 @@ def setup_fadump(self):
'''
self.cv_SYSTEM.set_state(OpSystemState.OS)
if self.distro == "rhel":
self.c.run_command("git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
self.c.run_command("rm -rf ServiceReport; git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
"python ./servicereport --plugins kdump package --repair", timeout=240)
time.sleep(10)
self.c.run_command("sed -e '/nfs/ s/^#*/#/' -i /etc/kdump.conf; sync")
obj = OpTestInstallUtil.InstallUtil()
if not obj.update_kernel_cmdline(self.distro, args="fadump=on",
reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to update kernel args")
if self.distro == "sles":
self.c.run_command('sed -i \'/^KDUMP_SAVEDIR=/c\KDUMP_SAVEDIR=\"/var/crash\"\' /etc/sysconfig/kdump;')
self.c.run_command("sed -i '/KDUMP_FADUMP=\"no\"/c\KDUMP_FADUMP=\"yes\"' /etc/sysconfig/kdump")
Expand All @@ -649,6 +642,10 @@ def setup_fadump(self):
self.c.run_command("zypper install -y ServiceReport; servicereport -r -p kdump;"
"update-bootloader --refresh", timeout=240)
time.sleep(5)
obj = OpTestInstallUtil.InstallUtil()
if not obj.update_kernel_cmdline(self.distro, args="fadump=on crashkernel=2G-128G:4096M,128G-:8192M",
reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to update kernel args")
self.cv_SYSTEM.goto_state(OpSystemState.OFF)
self.cv_SYSTEM.goto_state(OpSystemState.OS)

Expand Down Expand Up @@ -682,9 +679,10 @@ def runTest(self):
log.debug("======================fadump is supported=======================")
log.info("========== Testing Fadump enable followed by crash ==============")
boot_type = self.kernel_crash()
self.verify_dump_file(boot_type)
if not self.is_lpar:
self.verify_dump_dt_node(boot_type)
self.verify_dump_file(boot_type)
self.verify_dump_file(boot_type)


class KernelCrash_OnlyKdumpEnable(PowerNVDump):
Expand All @@ -711,14 +709,20 @@ def runTest(self):
self.c.run_command("zypper install -y ServiceReport; servicereport -r -p kdump;"
"update-bootloader --refresh", timeout=240)
time.sleep(5)

obj = OpTestInstallUtil.InstallUtil()
if not obj.update_kernel_cmdline(self.distro, args="crashkernel=2048M",
reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to update kernel args")

self.cv_SYSTEM.goto_state(OpSystemState.OFF)
self.cv_SYSTEM.goto_state(OpSystemState.OS)

if self.distro == "ubuntu":
self.cv_HOST.host_check_command("kdump")
elif self.distro == "rhel":
self.cv_HOST.host_check_command("kdumpctl")
self.c.run_command("git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
self.c.run_command("rm -rf ServiceReport; git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
"python ./servicereport --plugins kdump package --repair", timeout=240)
time.sleep(10)
elif self.distro == "sles":
Expand All @@ -733,9 +737,10 @@ def runTest(self):
self.cv_HOST.host_enable_kdump_service(os_level)
log.info("========= Testing Only kdump enable followed by crash ===========")
boot_type = self.kernel_crash()
self.verify_dump_file(boot_type)
if self.is_lpar:
boot_type = self.kernel_crash(crash_type="hmc")
self.verify_dump_file(boot_type)
self.verify_dump_file(boot_type)


class KernelCrash_DisableAll(PowerNVDump):
Expand Down Expand Up @@ -1127,6 +1132,10 @@ class KernelCrash_XIVE_off(PowerNVDump):
'''

def runTest(self):
obj = OpTestInstallUtil.InstallUtil()
if not obj.update_kernel_cmdline(self.distro, remove_args="default_hugepagesz=1GB hugepagesz=1GB hugepages=80",
reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to remove kernel args:default_hugepagesz=1GB hugepagesz=1GB hugepages=80")
self.cv_SYSTEM.goto_state(OpSystemState.OS)
self.setup_test()
log.info("=============== Testing kdump/fadump with xive=off ===============")
Expand Down Expand Up @@ -1171,6 +1180,10 @@ class KernelCrash_disable_radix(PowerNVDump):
'''

def runTest(self):
obj = OpTestInstallUtil.InstallUtil()
if not obj.update_kernel_cmdline(self.distro, remove_args="xive=off",
reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to remove kernel args:xive=off")
self.cv_SYSTEM.goto_state(OpSystemState.OS)
self.setup_test()
log.info("Testing kdump/fadump with disable_radix")
Expand Down Expand Up @@ -1279,6 +1292,10 @@ def makedump_check(self):
self.c.run_command("rm -rf dump*")

def runTest(self):
obj = OpTestInstallUtil.InstallUtil()
if not obj.update_kernel_cmdline(self.distro, remove_args="disable_radix",
reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to remove kernel args:disable_radix")
self.kernel_crash()
self.makedump_check()

Expand Down

0 comments on commit 4fc59c9

Please sign in to comment.