Author: gnichols
Date: 2012-03-16 16:30:06 +0000 (Fri, 16 Mar 2012)
New Revision: 1223
Modified:
trunk/tests/kdump/kdump.py
Log:
799897 - v7 server starts/stops returns 1\n 752753 - v7 server status reporting /var/v7/export is exported in v7-1.4
Modified: trunk/tests/kdump/kdump.py
===================================================================
--- trunk/tests/kdump/kdump.py 2012-03-16 16:24:42 UTC (rev 1222)
+++ trunk/tests/kdump/kdump.py 2012-03-16 16:30:06 UTC (rev 1223)
@@ -74,7 +74,17 @@
return [TestTag.noninteractive, TestTag.certification]
def startServer(self):
- os.system("service nfs start")
+ result = True
+ try:
+ start = Command("service nfs start")
+ start.echo()
+ if "[FAILED]" in "".join(start.output):
+ result = False
+ except Exception, e:
+ print "Error: could not start NFS service"
+ print e
+ result = False
+
serverDirectory = self.environment.getServerDirectory()
exportDirectory = os.path.join(serverDirectory, self.environment.getServerExport())
for directory in (serverDirectory, exportDirectory):
@@ -85,12 +95,25 @@
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):
+ if not os.system("exportfs -o rw,no_root_squash,insecure *:%s" % exportDirectory) is 0:
print "Error: could not export %s" % exportDirectory
+ result = False
+ return result
+
def stopServer(self):
# nfs
- os.system("service nfs stop")
+ try:
+ stop = Command("service nfs stop")
+ stop.echo()
+ if "[FAILED]" in "".join(stop.output):
+ return False
+ except Exception, e:
+ print "Error: could not stop nfs"
+ print e
+ return False
+
+ return True
def statusServer(self):
result = True
@@ -99,7 +122,7 @@
# lock file not readable by non-root users.F
exportfs = Command("cat /var/lib/nfs/etab")
exportfs.getString(regex=".*%s/%s" % (self.environment.getServerDirectory(), self.environment.getServerExport()), singleLine=False)
- print "%s/export is exported" % self.environment.getDataDirectory()
+ print "%s/%s is exported" % (self.environment.getServerDirectory(), self.environment.getServerExport())
except V7CommandException, exception:
print "Error: %s/export is not available" % self.environment.getDataDirectory()
result = False