Skip to content

Commit

Permalink
Merge pull request #838 from sourabhjains/fadump-new-sysfs
Browse files Browse the repository at this point in the history
testcases/PowerNVDump: use updated fadump sysfs files
  • Loading branch information
abdhaleegit authored May 8, 2024
2 parents 9695468 + 00929dd commit de70ae6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions testcases/PowerNVDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,20 @@ def is_fadump_enabled(self):
Method to verify fadump is enabled
returns True if fadump is configured
'''
res = self.c.run_command("cat /sys/kernel/fadump_enabled")[-1]
res = self.c.run_command("cat /sys/kernel/fadump/enabled")[-1]
if int(res) == 1:
return True
elif int(res) == 0:
return False
else:
raise Exception("Unknown fadump_enabled value")
raise Exception("Unknown /sys/kernel/fadump/enabled value")

def is_fadump_supported(self):
'''
Methods checks if fadump is supported
'''
try:
self.c.run_command("ls /sys/kernel/fadump_enabled")
self.c.run_command("ls /sys/kernel/fadump/enabled")
return True
except CommandFailed:
return False
Expand Down Expand Up @@ -293,12 +293,12 @@ def verify_fadump_reg(self):
'''
Enable and verify fadump registered by checking opal/dmesg logs
'''
res = self.c.run_command("cat /sys/kernel/fadump_registered")[-1]
res = self.c.run_command("cat /sys/kernel/fadump/registered")[-1]
if int(res) == 1:
return True
else:
self.c.run_command("echo 1 > /sys/kernel/fadump_registered; sleep 10")
self.c.run_command("cat /sys/kernel/fadump_registered")
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:
self.c.run_command("dmesg > /tmp/dmesg_log")
Expand Down Expand Up @@ -328,16 +328,16 @@ def verify_fadump_unreg(self):
'''
Disable and verify fadump unregistered by checking opal/dmesg logs
'''
res = self.c.run_command("cat /sys/kernel/fadump_registered")[-1]
res = self.c.run_command("cat /sys/kernel/fadump/registered")[-1]
if int(res) == 0:
return True
else:
self.c.run_command("echo 0 > /sys/kernel/fadump_registered; sleep 10")
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; sleep 10")
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))
Expand Down Expand Up @@ -667,7 +667,7 @@ def runTest(self):
raise self.skipTest(
"fadump not enabled in the kernel, does system has right firmware!!!")
if not self.is_fadump_enabled():
raise self.skipTest("fadump_enabled is off")
raise self.skipTest("fadump is disabled")
if self.distro == "ubuntu":
self.cv_HOST.host_check_command("kdump")
elif self.distro == "rhel":
Expand Down

0 comments on commit de70ae6

Please sign in to comment.