Skip to content

Commit 3f8acff

Browse files
authored
Merge pull request #780 from SACHIN-BAPPALIGE/fix_kdump_FalsePositives
Fix false positives with op-test kdump testcase
2 parents c0924ba + 86eeefb commit 3f8acff

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

testcases/PowerNVDump.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,19 @@ def verify_dump_file(self, boot_type=BootType.NORMAL, dump_place="local"):
265265
self.c.run_command("ls /var/crash/%s/dump*" %
266266
self.crash_content[0])
267267
else:
268-
self.c.run_command("ls /var/crash/%s/vmcore*" %
269-
self.crash_content[0])
268+
res = self.c.run_command("ls /var/crash/%s/vmcore*" %
269+
self.crash_content[0])
270+
paths = res[0].split()
271+
file_names = [os.path.basename(path) for path in paths]
272+
# Check if vmcore-dmesg-incomplete.txt is present in file_names
273+
if "vmcore-dmesg-incomplete.txt" in file_names:
274+
raise OpTestError("kdump failed to create vmcore file")
275+
else:
276+
filtered_files = [f for f in file_names if f.startswith("vmcore") and not f == "vmcore-dmesg.txt"]
277+
if filtered_files:
278+
log.debug("vmcore file %s exists in crash dir" % filtered_files)
279+
else:
280+
raise OpTestError("kdump failed to create vmcore file")
270281
if boot_type == BootType.MPIPL:
271282
self.c.run_command("ls /var/crash/%s/opalcore*" %
272283
self.crash_content[0])

0 commit comments

Comments
 (0)