r564 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-18 18:03:54 +0000 (Fri, 18 Jun 2010)
New Revision: 564
Modified:
trunk/v7/hardwaretest.py
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2010-06-18 18:03:06 UTC (rev 563)
+++ trunk/v7/hardwaretest.py 2010-06-18 18:03:54 UTC (rev 564)
@@ -585,6 +585,13 @@
self.addMandatoryTests(tests)
+ # don't run suspend on a continue run
+ if continueRun:
+ for test in tests:
+ if test.getName() == 'suspend':
+ tests.remove(test)
+ break
+
if len(tests) is 0:
print "No matching tests found."
return False
13 years, 10 months
r563 - trunk/test-env/init
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-18 18:03:06 +0000 (Fri, 18 Jun 2010)
New Revision: 563
Modified:
trunk/test-env/init/v7
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/test-env/init/v7
===================================================================
--- trunk/test-env/init/v7 2010-06-18 00:29:51 UTC (rev 562)
+++ trunk/test-env/init/v7 2010-06-18 18:03:06 UTC (rev 563)
@@ -10,7 +10,7 @@
V7=/usr/bin
start() {
- $V7/v7 continue &>/dev/null &
+ $V7/v7 continue --mode auto &
}
stop() {
13 years, 10 months
r562 - trunk/tests/fencing
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-18 00:29:51 +0000 (Fri, 18 Jun 2010)
New Revision: 562
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-18 00:05:27 UTC (rev 561)
+++ trunk/tests/fencing/fencing.py 2010-06-18 00:29:51 UTC (rev 562)
@@ -81,7 +81,6 @@
print "Waiting for shutdown..."
sys.stdout.flush()
time.sleep(waitTime)
- self.getResults()
def getResults(self):
request = self.url
@@ -94,8 +93,12 @@
opener = urllib2.build_opener()
response = opener.open(request).readlines()
print "result: "
+ result = False
for line in response:
- sys.stdout.write(line)
+ sys.stdout.write(line)
+ if "<summary>%s</summary>" % Constants.PASS in line:
+ result = True
+ return result
def run(self):
PASSED = 0
@@ -122,13 +125,19 @@
print "Server side test for %s\n" % self.Name()
outFile.write("Server side test for %s\n" % self.Name())
- if True:
+ try:
agentIP = args["agentIP"]
ping = Command("ping -c 1 " + agentIP)
ping.run()
for line in ping.output:
print line
outFile.write(line + "\n")
+ except Exception, e:
+ print "Error: "
+ print e
+ outFile.write("Error: %s" % e)
+ return False
+ return True
if __name__ == "__main__":
test = FencingTest()
13 years, 10 months
r561 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-18 00:05:27 +0000 (Fri, 18 Jun 2010)
New Revision: 561
Modified:
trunk/v7/planner.py
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/v7/planner.py
===================================================================
--- trunk/v7/planner.py 2010-06-18 00:04:39 UTC (rev 560)
+++ trunk/v7/planner.py 2010-06-18 00:05:27 UTC (rev 561)
@@ -64,7 +64,7 @@
del sys.modules[moduleName]
except KeyError:
pass
- module = __import__(moduleName)
+ module = __import__(moduleName, globals(), locals(), [], -1)
for thing in dir(module):
if self.options.debug == Constants.high:
print "thing: %s" % thing
13 years, 10 months
r560 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-18 00:04:39 +0000 (Fri, 18 Jun 2010)
New Revision: 560
Modified:
trunk/v7/daemon.py
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/v7/daemon.py
===================================================================
--- trunk/v7/daemon.py 2010-06-16 21:50:35 UTC (rev 559)
+++ trunk/v7/daemon.py 2010-06-18 00:04:39 UTC (rev 560)
@@ -22,6 +22,7 @@
from v7.command import Command, V7CommandException
from v7.test import Test
from v7.planner import Planner
+from v7.log import Log
class V7Daemon(Controller):
@@ -135,7 +136,11 @@
try:
test = self.planner.getTest(args["test"])
log = self.openLogFile(args, "w")
- test.runOnServer(args, log)
+ log.write("<output>\n")
+ result = Constants.FAIL
+ if test.runOnServer(args, log):
+ result = Constants.PASS
+ log.write("<summary>%s</summary>\n</output>\n" % result)
log.close()
except KeyError:
print "Error: test not found"
13 years, 10 months
r559 - trunk/tests/fencing
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-16 21:50:35 +0000 (Wed, 16 Jun 2010)
New Revision: 559
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:49:56 UTC (rev 558)
+++ trunk/tests/fencing/fencing.py 2010-06-16 21:50:35 UTC (rev 559)
@@ -93,7 +93,9 @@
request = urllib2.Request('http://%s%s' % (self.getTestServer(), request))
opener = urllib2.build_opener()
response = opener.open(request).readlines()
- print response
+ print "result: "
+ for line in response:
+ sys.stdout.write(line)
def run(self):
PASSED = 0
13 years, 10 months
r558 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-16 21:49:56 +0000 (Wed, 16 Jun 2010)
New Revision: 558
Modified:
trunk/v7/daemon.py
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/v7/daemon.py
===================================================================
--- trunk/v7/daemon.py 2010-06-16 21:49:43 UTC (rev 557)
+++ trunk/v7/daemon.py 2010-06-16 21:49:56 UTC (rev 558)
@@ -106,7 +106,7 @@
logFileName = "v7-daemon-"
for (key, value) in args.items():
if key != "results":
- logFileName = logFileName + "%s=%s_"
+ logFileName = logFileName + "%s=%s_" % (key, value)
log = open(os.path.join(self.environment.getLogDirectory(), logFileName), mode)
return log
@@ -120,7 +120,7 @@
log = self.openLogFile(args, "r")
taskOutFile = open(self.environment.getTaskFilePath()+ ".out", 'w')
for line in log:
- taskOutFile.write(line + "\n")
+ taskOutFile.write(line)
taskOutFile.close()
log.close()
return True
13 years, 10 months
r557 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-16 21:49:43 +0000 (Wed, 16 Jun 2010)
New Revision: 557
Modified:
trunk/v7/hardwaretest.py
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2010-06-16 21:24:12 UTC (rev 556)
+++ trunk/v7/hardwaretest.py 2010-06-16 21:49:43 UTC (rev 557)
@@ -462,7 +462,7 @@
while True:
line = taskOutFile.readline()
if line:
- print line
+ sys.stdout.write(line)
sys.stdout.flush()
else:
break
13 years, 10 months
r556 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-06-16 21:24:12 +0000 (Wed, 16 Jun 2010)
New Revision: 556
Modified:
trunk/v7/hardwaretest.py
Log:
568518 - FEAT: add a BMC fencing testing
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2010-06-16 21:16:40 UTC (rev 555)
+++ trunk/v7/hardwaretest.py 2010-06-16 21:24:12 UTC (rev 556)
@@ -452,21 +452,25 @@
taskInFile = os.open(self.environment.getTaskFilePath() + ".in", os.O_WRONLY)
print "opened task file"
sys.stdout.flush()
- os.write(taskInFile, command)
- os.write(taskInFile, "\n")
+ os.write(taskInFile, command + "\n")
os.close(taskInFile)
- print "Reading Results"
+ print "Reading Results:"
+ print "</pre><hr><pre>"
+
+ sys.stdout.flush()
taskOutFile = open(self.environment.getTaskFilePath()+".out", "r")
while True:
line = taskOutFile.readline()
if line:
print line
+ sys.stdout.flush()
else:
break
taskOutFile.close()
+ print "</pre><hr><pre>"
print "done"
+ print "</pre>"
sys.stdout.flush()
- print "</pre>"
def doWebStatus(self):
print "<pre>"
13 years, 10 months
r555 - trunk/tests/fencing
by gnichols@fedoraproject.org
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)
13 years, 10 months