From 671bdcec0f91442e02e56a90bb26f5ddbdbb4512 Mon Sep 17 00:00:00 2001 From: Sachin P Bappalige Date: Wed, 20 Sep 2023 06:03:41 -0500 Subject: [PATCH] Add softlockup scenario for kdump/Fadump testing Signed-off-by: Sachin P Bappalige --- testcases/PowerNVDump.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/testcases/PowerNVDump.py b/testcases/PowerNVDump.py index 9b1db455b..ff83fd37d 100644 --- a/testcases/PowerNVDump.py +++ b/testcases/PowerNVDump.py @@ -64,6 +64,7 @@ import time import re import tempfile +import shutil import OpTestConfiguration import OpTestLogger @@ -370,6 +371,8 @@ def kernel_crash(self, crash_type="echo_c"): elif crash_type == "hmc": self.cv_HMC.run_command("chsysstate -r lpar -m %s -n %s -o dumprestart" % (self.system_name, self.lpar_name), timeout=300) + elif crash_type == "lock": + self.c.pty.sendline("insmod /tmp/kernel-module-bug-196448/softlockup.ko") done = False boot_type = BootType.NORMAL rc = -1 @@ -1323,6 +1326,39 @@ def runTest(self): if not obj.update_kernel_cmdline(self.distro, remove_args="fadump=nocma", reboot=True, reboot_cmd=True): self.fail("KernelArgTest failed to update kernel args") +class KernelCrash_KdumpSoftlockup(PowerNVDump): + + # This test verifies kdump/fadump after inserting softlockup kernel module. + # Linux-Debugging url needs to be given in ~/.op-test-framework.conf. + # Ex: url=http://liquidtelecom.dl.sourceforge.net/project/ebizzy/ebizzy/0.3/ebizzy-0.3.tar.gz + + + def runTest(self): + self.setup_test() + directory_path = "/tmp/kernel-module-bug-196448" + # Make sure /tmp/skiboot directory does not exist + self.c.run_command("cd /tmp; ls -1; rm -rf %s" % directory_path) + + #clone this repo + r_cmd = "git clone git@github.ibm.com:sjain014/kernel-module-bug-196448.git /tmp/kernel-module-bug-196448" + self.c.run_command(r_cmd) + time.sleep(20) + + #compile kernel modeules + self.c.run_command("cd /tmp/kernel-module-bug-196448; make") + time.sleep(30) + + #Enable softlockup + self.c.run_command("sysctl -w kernel.softlockup_panic=1") + + boot_type = self.kernel_crash(crash_type="lock") + self.verify_dump_file(boot_type) + + #Insert kernel module for softlockup + #self.c.pty.sendline("insmod /tmp/kernel-module-bug-196448/softlockup.ko") + #time.sleep(500) + #self.verify_dump_file() + def crash_suite(): s = unittest.TestSuite() @@ -1354,5 +1390,6 @@ def crash_suite(): s.addTest(KernelCrash_DisableAll()) s.addTest(SkirootKernelCrash()) s.addTest(OPALCrash_MPIPL()) + s.addTest(KernelCrash_KdumpSoftlockup()) return s