Author: gnichols
Date: 2010-06-16 21:16:40 +0000 (Wed, 16 Jun 2010)
New Revision: 555
Modified:
trunk/tests/fencing/fencing.py
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/tests/fencing/fencing.py
===================================================================
--- trunk/tests/fencing/fencing.py 2010-06-16 21:14:36 UTC (rev 554)
+++ trunk/tests/fencing/fencing.py 2010-06-16 21:16:40 UTC (rev 555)
@@ -37,9 +37,14 @@
self.priority = 1001 # run last
self.url = "/v7/cgi/v7web.py?command=daemon&subcommand=run&test=fencing"
+ def plan(self, devices):
+ tests = list()
+ tests.append(self.makeCopy())
+ return tests
+
def setInitConfig(self):
- chkconfig = Command("chkconfig --add v7")
- chkconfig.echo()
+ # chkconfig = Command("chkconfig --add v7")
+ # chkconfig.echo()
# get a timestamo, save it
theTime = time.gmtime(time.time())
runTimeStamp = self.documentWrapper.timeToString(theTime)
@@ -57,9 +62,9 @@
def sendFencingRequest(self):
request = self.url
- agentIPAddress = ""
+ agentIPAddress = "localhost"
agentType = ""
- request + request + "&agentIP=" + agentIPAddress + "&agentType=" + agentType
+ request = request + "&agentIP=" + agentIPAddress + "&agentType=" + agentType
print "Sending Request:"
print request
request = urllib2.Request('http://%s%s' % (self.getTestServer(), request))
@@ -75,13 +80,14 @@
waitTime = 60 #sec
print "Waiting for shutdown..."
sys.stdout.flush()
- time.sleep(waitTime)
+ time.sleep(waitTime)
+ self.getResults()
def getResults(self):
request = self.url
- agentIPAddress = ""
+ agentIPAddress = "localhost"
agentType = ""
- request + request + "&agentIP=" + agentIPAddress + "&agentType=" + agentType + "&results=1"
+ request = request + "&agentIP=" + agentIPAddress + "&agentType=" + agentType + "&results=1"
print "Sending Request:"
print request
request = urllib2.Request('http://%s%s' % (self.getTestServer(), request))
@@ -109,8 +115,19 @@
# otherwise
return FAILED
-
-
+
+ def runOnServer(self, args, outFile):
+ print "Server side test for %s\n" % self.Name()
+ outFile.write("Server side test for %s\n" % self.Name())
+
+ if True:
+ agentIP = args["agentIP"]
+ ping = Command("ping -c 1 " + agentIP)
+ ping.run()
+ for line in ping.output:
+ print line
+ outFile.write(line + "\n")
+
if __name__ == "__main__":
test = FencingTest()
returnValue = test.do(sys.argv)