Skip to content

Commit

Permalink
Add timeout value for console based run commands in kdump tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin P Bappalige <[email protected]>
  • Loading branch information
Sachin P Bappalige committed Aug 23, 2024
1 parent e197972 commit 94c3a65
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions testcases/PowerNVDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,21 +649,21 @@ def setup_fadump(self):
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")
self.c.run_command("touch /etc/sysconfig/kdump; systemctl restart kdump.service; sync", timeout=180)
self.c.run_command("sed -i \'/^KDUMP_SAVEDIR=/c\KDUMP_SAVEDIR=\"/var/crash\"\' /etc/sysconfig/kdump;", timeout=180)
self.c.run_command("sed -i '/KDUMP_FADUMP=\"no\"/c\KDUMP_FADUMP=\"yes\"' /etc/sysconfig/kdump", timeout=180)
self.c.run_command("touch /etc/sysconfig/kdump; systemctl restart kdump.service; sync", timeout=900)
self.c.run_command("mkdumprd -f", timeout=120)
self.c.run_command("update-bootloader --refresh")
self.c.run_command("update-bootloader --refresh", timeout=900)
self.c.run_command("zypper install -y ServiceReport; servicereport -r -p kdump;"
"update-bootloader --refresh", timeout=240)
"update-bootloader --refresh", timeout=900)
time.sleep(5)
self.cv_SYSTEM.goto_state(OpSystemState.OFF)
self.cv_SYSTEM.goto_state(OpSystemState.OS)

def runTest(self):
self.setup_test()
self.setup_fadump()
self.c.run_command("fsfreeze -f /boot; fsfreeze -u /boot")
self.c.run_command("fsfreeze -f /boot; fsfreeze -u /boot", timeout=900)
if not self.is_lpar:
if not self.is_mpipl_supported():
raise self.skipTest("MPIPL support is not found")
Expand Down Expand Up @@ -711,13 +711,13 @@ def runTest(self):
reboot=True, reboot_cmd=True):
self.fail("KernelArgTest failed to update kernel args")
elif 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=\"yes\"/c\KDUMP_FADUMP=\"no\"' /etc/sysconfig/kdump")
self.c.run_command("touch /etc/sysconfig/kdump; systemctl restart kdump.service; sync", timeout=180)
self.c.run_command("mkdumprd -f", timeout=120)
self.c.run_command("update-bootloader --refresh")
self.c.run_command("sed -i \'/^KDUMP_SAVEDIR=/c\KDUMP_SAVEDIR=\"/var/crash\"\' /etc/sysconfig/kdump;", timeout=180)
self.c.run_command("sed -i '/KDUMP_FADUMP=\"yes\"/c\KDUMP_FADUMP=\"no\"' /etc/sysconfig/kdump", timeout=180)
self.c.run_command("touch /etc/sysconfig/kdump; systemctl restart kdump.service; sync", timeout=900)
self.c.run_command("mkdumprd -f", timeout=900)
self.c.run_command("update-bootloader --refresh", timeout=900)
self.c.run_command("zypper install -y ServiceReport; servicereport -r -p kdump;"
"update-bootloader --refresh", timeout=240)
"update-bootloader --refresh", timeout=900)
time.sleep(5)
self.cv_SYSTEM.goto_state(OpSystemState.OFF)
self.cv_SYSTEM.goto_state(OpSystemState.OS)
Expand Down Expand Up @@ -1144,7 +1144,6 @@ def runTest(self):
self.cv_SYSTEM.goto_state(OpSystemState.OS)
self.setup_test()
log.info("=============== Testing kdump/fadump with xive=off ===============")
self.cv_SYSTEM.goto_state(OpSystemState.OS)
obj = OpTestInstallUtil.InstallUtil()
if not obj.update_kernel_cmdline(self.distro, args="xive=off",
reboot=True, reboot_cmd=True):
Expand Down Expand Up @@ -1236,7 +1235,7 @@ class OpTestMakedump(PowerNVDump):
'''

def check_run(self, cmd, condition):
res = self.c.run_command(cmd)
res = self.c.run_command(cmd, timeout=900)
for value in res:
if condition in value:
log.info("command %s works well" % cmd)
Expand All @@ -1247,9 +1246,9 @@ def makedump_check(self):
'''
Function will verify all makdump options on already colleted vmcore
'''
res = self.c.run_command("ls -1 /var/crash/")
res = self.c.run_command("ls -1 /var/crash/", timeout=180)
crash_dir = self.c.run_command("cd /var/crash/%s" % res[0])
res = self.c.run_command("ls")
res = self.c.run_command("ls", timeout=180)
if 'vmcore' not in res[0]:
self.fail("vmcore is not saved")
else:
Expand All @@ -1260,48 +1259,48 @@ def makedump_check(self):
So, convert flattened format to kdump compress format.
'''
if self.distro == "sles":
self.c.run_command("mv vmcore vmcore.orig; makedumpfile -R vmcore <vmcore.orig", timeout=60)
self.c.run_command("mv vmcore vmcore.orig; makedumpfile -R vmcore <vmcore.orig", timeout=900)

self.c.run_command("makedumpfile -v")
self.c.run_command("makedumpfile -v", timeout=180)
self.check_run("makedumpfile --split -d 31 -l vmcore dump3 dump4",
"The dumpfiles are saved to dump3, and dump4")
self.check_run("makedumpfile --reassemble dump3 dump4 dump5",
"The dumpfile is saved to dump5")
self.c.run_command("rm -rf dump*")
self.c.run_command("rm -rf dump*", timeout=180)
self.check_run("makedumpfile -b 8 -d 31 -l vmcore dump2",
"The dumpfile is saved to dump2")
self.check_run("makedumpfile -f -d 31 -l vmcore dump6",
"The dumpfile is saved to dump6")
self.check_run("makedumpfile --dump-dmesg vmcore log",
"The dmesg log is saved to log")
self.c.run_command("rm -rf dump*")
self.c.run_command("rm -rf log")
self.c.run_command("rm -rf dump*", timeout=180)
self.c.run_command("rm -rf log", timeout=180)
self.check_run("makedumpfile --cyclic-buffer 1024 vmcore dump10",
"The dumpfile is saved to dump10")
self.c.run_command("rm -rf dump*")
self.c.run_command("rm -rf dump*", timeout=180)
self.check_run("makedumpfile --split --splitblock-size 1024 vmcore dump12 dump13 dump14",
"The dumpfiles are saved to dump12, dump13, and dump14")
self.c.run_command("rm -rf dump*")
self.c.run_command("rm -rf dump*", timeout=180)
self.check_run("makedumpfile --work-dir /tmp vmcore dump20",
"The dumpfile is saved to dump20")
self.check_run("makedumpfile --non-mmap vmcore dump22",
"The dumpfile is saved to dump22")
self.c.run_command("rm -rf dump*")
self.c.run_command("rm -rf dump*", timeout=180)
self.check_run("makedumpfile -D -d 31 -l vmcore dump1",
"The dumpfile is saved to dump1")
self.check_run("makedumpfile -D -d 31 -l vmcore dump41 --num-threads 8",
"The dumpfile is saved to dump41")
self.c.run_command("rm -rf dump*")
self.c.run_command("rm -rf dump*", timeout=180)
self.check_run("makedumpfile -d 31 -c vmcore dump42",
"The dumpfile is saved to dump42")
self.check_run("makedumpfile -d 31 -p vmcore dump43",
"The dumpfile is saved to dump43")
self.c.run_command("rm -rf dump*")
self.c.run_command("rm -rf dump*", timeout=180)
self.check_run("makedumpfile -d 31 -e vmcore --work-dir /tmp dump44",
"The dumpfile is saved to dump44")
self.c.run_command(
"makedumpfile -d 31 -c vmcore dump51 --message-level 21")
self.c.run_command("rm -rf dump*")
"makedumpfile -d 31 -c vmcore dump51 --message-level 21", timeout=900)
self.c.run_command("rm -rf dump*", timeout=180)

def runTest(self):
obj = OpTestInstallUtil.InstallUtil()
Expand Down

0 comments on commit 94c3a65

Please sign in to comment.