Author: gnichols
Date: 2011-07-21 13:23:26 +0000 (Thu, 21 Jul 2011)
New Revision: 1020
Modified:
trunk/tests/kdump/kdump.py
Log:
https://bugzilla.redhat.com/show_bug.cgi?id=717779
Modified: trunk/tests/kdump/kdump.py
===================================================================
--- trunk/tests/kdump/kdump.py 2011-07-19 10:47:11 UTC (rev 1019)
+++ trunk/tests/kdump/kdump.py 2011-07-21 13:23:26 UTC (rev 1020)
@@ -38,6 +38,7 @@
self.rebootTimeLimit = self.environment.getRebootTimelimit()
self.priority = 1001 # run last
self.coreCollector = "makedumpfile -d 31"
+ self.linkDelay = 60 # sec
self.kdumpConfigPath = "/etc/kdump.conf"
self.redHatRelease = RedHatRelease()
self.serverMode = True # nfs for kdump to nfs
@@ -156,14 +157,44 @@
print e
verified = False
- # configure kdump to use makedumpfile -d 31
+
+ (success, restart) = self.setKdumpConfig()
+
+ if restart:
+ print "restarting kdump with new configuration..."
+ try:
+ Command("service kdump stop").echo()
+ Command("service kdump start").echo()
+ except V7CommandException, exception:
+ print "Error: kdump restart failed"
+ print exception
+ exception.command.printErrors()
+ verified = False
+
+
+ print "Checking kdump service"
try:
+ kdump = Command("service kdump status")
+ kdump.getString("is operational")
+ print "kdump is running"
+ except V7CommandException, e:
+ print "Error: kdump is not running - can not test it"
+ print e
+ verified = False
+
+ return verified
+
+ def setKdumpConfig(self):
+ """ set kdump configuration, returns (success, restart)
"""
+ # configure kdump to use makedumpfile -d 31
+ try:
configFile = ConfigFile(self.kdumpConfigPath)
coreCollector = configFile.getParameter("core_collector")
net = configFile.getParameter("net")
+ linkDelay = configFile.getParameter("link_delay")
except IOError, exception:
print "Error: %s" % exception
- return False
+ return (False, False)
restart = False
if not coreCollector:
@@ -190,34 +221,20 @@
restart = True
else:
print "Error: v7 test server not set for network kdump"
- return False
+ return (False, False)
+ if linkDelay:
+ print "link_delay set to %s" % linkDelay
+ else:
+ print "Setting link_delay=%u" % self.linkDelay
+ configFile.addParameter("link_delay", self.linkDelay)
+ restart = True
if restart:
configFile.save()
- print "restarting kdump with new configuration..."
- try:
- Command("service kdump stop").echo()
- Command("service kdump start").echo()
- except V7CommandException, exception:
- print "Error: kdump restart failed"
- print exception
- exception.command.printErrors()
- verified = False
-
-
- print "Checking kdump service"
- try:
- kdump = Command("service kdump status")
- kdump.getString("is operational")
- print "kdump is running"
- except V7CommandException, e:
- print "Error: kdump is not running - can not test it"
- print e
- verified = False
-
- return verified
+ return (True, restart)
+
def panic(self):
self.markOutput("initialize")