Author: gnichols
Date: 2011-07-13 16:22:43 +0000 (Wed, 13 Jul 2011)
New Revision: 1002
Modified:
trunk/tests/kdump/kdump.py
trunk/tests/network/network.py
Log:
521609 - v7 plan --server says server has error: /var/v7/export
Modified: trunk/tests/kdump/kdump.py
===================================================================
--- trunk/tests/kdump/kdump.py 2011-07-13 16:22:12 UTC (rev 1001)
+++ trunk/tests/kdump/kdump.py 2011-07-13 16:22:43 UTC (rev 1002)
@@ -40,7 +40,9 @@
self.coreCollector = "makedumpfile -d 31"
self.kdumpConfigPath = "/etc/kdump.conf"
self.redHatRelease = RedHatRelease()
+ self.serverMode = True # nfs for kdump to nfs
+
def getRequiredRPMs(self):
rpms = ["kexec-tools", "crash"]
variantString = ""
@@ -69,7 +71,48 @@
def tags(self):
# nanny-prompting in --mode normal, will run --mode auto
return [TestTag.noninteractive, TestTag.certification]
+
+ def startServer(self):
+ os.system("service nfs start")
+ dataDirectory = self.environment.getDataDirectory()
+ exportDirectory = dataDirectory + '/export'
+ for directory in (dataDirectory, exportDirectory):
+ try:
+ os.mkdir(directory)
+ print "Created %s" % directory
+ except OSError: # file probably exists
+ if not os.path.exists(directory):
+ print "Warning: unable to create directory %s." % directory
+ if os.system("exportfs -o rw,no_root_squash,insecure *:%s" % exportDirectory):
+ print "Error: could not export %s" % exportDirectory
+
+ def stopServer(self):
+ # nfs
+ os.system("service nfs stop")
+
+ def statusServer(self):
+ result = True
+ try:
+ # changed from using "exportfs" since this is called via httpd/cgi, and exportfs uses a
+ # lock file not readable by non-root users.F
+ exportfs = Command("cat /var/lib/nfs/etab")
+ exportfs.getString(regex=".*%s/export" % self.environment.getDataDirectory(), singleLine=False)
+ print "%s/export is exported" % self.environment.getDataDirectory()
+ except V7CommandException, exception:
+ print "Error: %s/export is not available" % self.environment.getDataDirectory()
+ result = False
+
+ try:
+ serviceNFSStatus = Command("service nfs status")
+ print "%s:" % serviceNFSStatus.command
+ serviceNFSStatus.echo()
+ except V7CommandException, exception:
+ print exception
+ result = False
+
+ return result
+
def configureKDump(self):
verified = True
# log required rpms installation
@@ -136,7 +179,9 @@
print "Network Dump set to %s" % net
elif self.getLogicalDeviceName() == Constants.nfs:
if self.getTestServer() and self.getTestServer() != "unknown":
- net = "%s:/var/v7/export" % self.getTestServer()
+ # Note: the assumption is that the environment for the SUT is the same as the environment
+ # for the server being used - both have the same data directory setting.
+ net = "%s:%s/export" % (self.getTestServer(), self.environment.getDataDirectory())
print "Adding net %s to %s" % (net, self.kdumpConfigPath)
configFile.addParameter("net", net)
restart = True
Modified: trunk/tests/network/network.py
===================================================================
--- trunk/tests/network/network.py 2011-07-13 16:22:12 UTC (rev 1001)
+++ trunk/tests/network/network.py 2011-07-13 16:22:43 UTC (rev 1002)
@@ -434,20 +434,6 @@
else:
print " done."
- # nfs - leaving in so we can test prior v7 clients.
- os.system("service nfs start")
- dataDirectory = self.environment.getDataDirectory()
- exportDirectory = dataDirectory + '/export'
- for directory in (dataDirectory, exportDirectory):
- try:
- os.mkdir(directory)
- print "Created %s" % directory
- except OSError: # file probably exists
- if not os.path.exists(directory):
- print "Warning: unable to create directory %s." % directory
-
- if os.system("exportfs -o rw,no_root_squash,insecure *:%s" % exportDirectory):
- print "Error: could not export %s" % exportDirectory
# httpd
os.system("service httpd start")
@@ -470,8 +456,7 @@
os.system("bw_tcp -S localhost")
os.system("lat_udp -S localhost")
print " done."
- # nfs
- os.system("service nfs stop")
+
# httpd
os.system("service httpd stop")
@@ -486,16 +471,8 @@
except V7CommandException:
print "Error: lmbench %s is NOT running" % tool
result = False
-
- try:
- Command("exportfs").getString(regex=".*%s/export" % self.environment.getDataDirectory(), singleLine=False)
- print "%s/export is exported" % self.environment.getDataDirectory()
- except V7CommandException:
- print "Error: %s/export is not available" % self.environment.getDataDirectory()
- result = False
try:
- Command("service nfs status ").echo()
# httpd
Command("service httpd status").echo()
except V7CommandException, exception: