From 18615453209496f8e9748770197c09e1c1d3f099 Mon Sep 17 00:00:00 2001 From: Sachin P Bappalige Date: Tue, 23 Apr 2024 10:58:10 +0530 Subject: [PATCH] Fix kdump/Fadump config ServiceReport fails to estimate correct crashkernel size. This is a temporary fix to define crashkernel size. Signed-off-by: Sachin P Bappalige --- op-test | 4 ++-- testcases/PowerNVDump.py | 29 ++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/op-test b/op-test index a33c50a5..629f4a0f 100755 --- a/op-test +++ b/op-test @@ -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 diff --git a/testcases/PowerNVDump.py b/testcases/PowerNVDump.py index c54f57df..fce3cf1a 100644 --- a/testcases/PowerNVDump.py +++ b/testcases/PowerNVDump.py @@ -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: @@ -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)) @@ -632,7 +629,7 @@ 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") @@ -718,7 +715,7 @@ def runTest(self): 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": @@ -733,9 +730,11 @@ 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: + log.info("========= Testing kdump with HMC dumprestart ===========") boot_type = self.kernel_crash(crash_type="hmc") - self.verify_dump_file(boot_type) + self.verify_dump_file(boot_type) class KernelCrash_DisableAll(PowerNVDump): @@ -1127,6 +1126,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 ===============") @@ -1171,6 +1174,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") @@ -1279,6 +1286,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()