Skip to content

Commit 170e259

Browse files
Merge pull request #828 from SACHIN-BAPPALIGE/fix_fadump_config_setup
Fix kdump/Fadump config
2 parents e4c4fb6 + cc923c7 commit 170e259

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

op-test

+2-2
Original file line numberDiff line numberDiff line change
@@ -693,15 +693,15 @@ class OSdumpfadumpSuite():
693693
def __init__(self):
694694
self.s = unittest.TestSuite()
695695
self.s.addTest(PowerNVDump.KernelCrash_FadumpEnable())
696-
self.s.addTest(PowerNVDump.OpTestMakedump())
697696
self.s.addTest(PowerNVDump.KernelCrash_KdumpDLPAR())
698697
self.s.addTest(PowerNVDump.KernelCrash_KdumpWorkLoad())
699698
self.s.addTest(PowerNVDump.KernelCrash_hugepage_checks())
700699
self.s.addTest(PowerNVDump.KernelCrash_XIVE_off())
701700
self.s.addTest(PowerNVDump.KernelCrash_disable_radix())
702-
self.s.addTest(PowerNVDump.KernelCrash_FadumpNocma())
701+
self.s.addTest(PowerNVDump.OpTestMakedump())
703702
self.s.addTest(PowerNVDump.KernelCrash_KdumpSSH())
704703
self.s.addTest(PowerNVDump.KernelCrash_KdumpNFS())
704+
self.s.addTest(PowerNVDump.KernelCrash_FadumpNocma())
705705

706706
def suite(self):
707707
return self.s

testcases/PowerNVDump.py

+24-10
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ def verify_dump_file(self, boot_type=BootType.NORMAL, dump_place="local"):
256256
"ssh root@%s -i %s \"ls -l %s | grep '^d'\" | awk '{print $9}'" % (self.dump_server_ip, self.rsa_path, self.dump_path))
257257
self.crash_content = list(
258258
set(crash_content_after) - set(self.crash_content))
259-
self.crash_content = list(filter(lambda x: re.search('\d{4}-\d{2}-\d{2}-\d{2}:\d{2}', x), self.crash_content))
259+
if self.distro == "sles":
260+
self.crash_content = list(filter(lambda x: re.search('\d{4}-\d{2}-\d{2}-\d{2}-\d{2}', x), self.crash_content))
261+
else:
262+
self.crash_content = list(filter(lambda x: re.search('\d{4}-\d{2}-\d{2}-\d{2}:\d{2}', x), self.crash_content))
260263
if len(self.crash_content):
261264
if dump_place == "net":
262265
self.c.run_command('scp -i %s -r root@%s:/%s/%s /var/crash/' %
@@ -294,8 +297,7 @@ def verify_fadump_reg(self):
294297
if int(res) == 1:
295298
return True
296299
else:
297-
self.c.run_command("echo 1 > /sys/kernel/fadump_registered")
298-
self.c.run_command('\r\n')
300+
self.c.run_command("echo 1 > /sys/kernel/fadump_registered; sleep 10")
299301
self.c.run_command("cat /sys/kernel/fadump_registered")
300302

301303
if not self.is_lpar:
@@ -330,14 +332,12 @@ def verify_fadump_unreg(self):
330332
if int(res) == 0:
331333
return True
332334
else:
333-
self.c.run_command("echo 0 > /sys/kernel/fadump_registered")
334-
self.c.run_command('\r\n')
335+
self.c.run_command("echo 0 > /sys/kernel/fadump_registered; sleep 10")
335336

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

342342
opal_data = " ".join(self.c.run_command(
343343
"%s | diff -a /tmp/opal_log -" % BMC_CONST.OPAL_MSG_LOG))
@@ -632,7 +632,7 @@ def setup_fadump(self):
632632
'''
633633
self.cv_SYSTEM.set_state(OpSystemState.OS)
634634
if self.distro == "rhel":
635-
self.c.run_command("git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
635+
self.c.run_command("rm -rf ServiceReport; git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
636636
"python ./servicereport --plugins kdump package --repair", timeout=240)
637637
time.sleep(10)
638638
self.c.run_command("sed -e '/nfs/ s/^#*/#/' -i /etc/kdump.conf; sync")
@@ -718,7 +718,7 @@ def runTest(self):
718718
self.cv_HOST.host_check_command("kdump")
719719
elif self.distro == "rhel":
720720
self.cv_HOST.host_check_command("kdumpctl")
721-
self.c.run_command("git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
721+
self.c.run_command("rm -rf ServiceReport; git clone https://github.com/linux-ras/ServiceReport; cd ServiceReport;"
722722
"python ./servicereport --plugins kdump package --repair", timeout=240)
723723
time.sleep(10)
724724
elif self.distro == "sles":
@@ -733,9 +733,11 @@ def runTest(self):
733733
self.cv_HOST.host_enable_kdump_service(os_level)
734734
log.info("========= Testing Only kdump enable followed by crash ===========")
735735
boot_type = self.kernel_crash()
736+
self.verify_dump_file(boot_type)
736737
if self.is_lpar:
738+
log.info("========= Testing kdump with HMC dumprestart ===========")
737739
boot_type = self.kernel_crash(crash_type="hmc")
738-
self.verify_dump_file(boot_type)
740+
self.verify_dump_file(boot_type)
739741

740742

741743
class KernelCrash_DisableAll(PowerNVDump):
@@ -1127,6 +1129,10 @@ class KernelCrash_XIVE_off(PowerNVDump):
11271129
'''
11281130

11291131
def runTest(self):
1132+
obj = OpTestInstallUtil.InstallUtil()
1133+
if not obj.update_kernel_cmdline(self.distro, remove_args="default_hugepagesz=1GB hugepagesz=1GB hugepages=80",
1134+
reboot=True, reboot_cmd=True):
1135+
self.fail("KernelArgTest failed to remove kernel args:default_hugepagesz=1GB hugepagesz=1GB hugepages=80")
11301136
self.cv_SYSTEM.goto_state(OpSystemState.OS)
11311137
self.setup_test()
11321138
log.info("=============== Testing kdump/fadump with xive=off ===============")
@@ -1171,6 +1177,10 @@ class KernelCrash_disable_radix(PowerNVDump):
11711177
'''
11721178

11731179
def runTest(self):
1180+
obj = OpTestInstallUtil.InstallUtil()
1181+
if not obj.update_kernel_cmdline(self.distro, remove_args="xive=off",
1182+
reboot=True, reboot_cmd=True):
1183+
self.fail("KernelArgTest failed to remove kernel args:xive=off")
11741184
self.cv_SYSTEM.goto_state(OpSystemState.OS)
11751185
self.setup_test()
11761186
log.info("Testing kdump/fadump with disable_radix")
@@ -1279,6 +1289,10 @@ def makedump_check(self):
12791289
self.c.run_command("rm -rf dump*")
12801290

12811291
def runTest(self):
1292+
obj = OpTestInstallUtil.InstallUtil()
1293+
if not obj.update_kernel_cmdline(self.distro, remove_args="disable_radix",
1294+
reboot=True, reboot_cmd=True):
1295+
self.fail("KernelArgTest failed to remove kernel args:disable_radix")
12821296
self.kernel_crash()
12831297
self.makedump_check()
12841298

0 commit comments

Comments
 (0)