r717 - in tags: . v7-V1-3R5/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-17 21:16:10 +0000 (Mon, 17 Jan 2011)
New Revision: 717
Added:
tags/v7-V1-3R5/
tags/v7-V1-3R5/v7/version.py
Log:
tag version
Copied: tags/v7-V1-3R5 (from rev 716, trunk)
Copied: tags/v7-V1-3R5/v7/version.py (from rev 335, trunk/v7/version.py)
===================================================================
--- tags/v7-V1-3R5/v7/version.py (rev 0)
+++ tags/v7-V1-3R5/v7/version.py 2011-01-17 21:16:10 UTC (rev 717)
@@ -0,0 +1,5 @@
+
+# v7/version.py is automatically-generated - DO NOT EDIT
+version = '1.3'
+release = '5'
+rhel_version = '5'
13 years, 3 months
r716 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-17 21:15:01 +0000 (Mon, 17 Jan 2011)
New Revision: 716
Modified:
trunk/Makefile
Log:
R5
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2011-01-17 21:03:44 UTC (rev 715)
+++ trunk/Makefile 2011-01-17 21:15:01 UTC (rev 716)
@@ -14,7 +14,7 @@
# Author: Greg Nichols
V7_VERSION := 1.3
-V7_RELEASE := 4
+V7_RELEASE := 5
V7_VERSION_RELEASE := $(V7_VERSION)-$(V7_RELEASE)
V7_VERSION_PY := v7/version.py
V7_SVN_MODULE := svn+ssh://svn.fedorahosted.org/svn/v7
13 years, 3 months
r715 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-17 21:03:44 +0000 (Mon, 17 Jan 2011)
New Revision: 715
Modified:
trunk/v7/tags.py
Log:
521609 - v7 plan --server says server is not running
Modified: trunk/v7/tags.py
===================================================================
--- trunk/v7/tags.py 2011-01-17 21:03:33 UTC (rev 714)
+++ trunk/v7/tags.py 2011-01-17 21:03:44 UTC (rev 715)
@@ -61,6 +61,9 @@
agent="agent"
subtest="subtest"
tag="tag"
+ image="image"
+ host="host"
+ v7_image="v7-image"
class Attributes:
@@ -96,6 +99,7 @@
user="user"
password="password"
priority="priority"
+ time="time"
@@ -137,6 +141,7 @@
memory = "mem"
disk = "disk"
v7serverstatus = "v7serverstatus"
+ v7serverMinimumVersion = "1.0"
running = "running"
failed = "failed"
V7 = "V7"
13 years, 3 months
r714 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-17 21:03:33 +0000 (Mon, 17 Jan 2011)
New Revision: 714
Modified:
trunk/v7/hardwaretest.py
Log:
521609 - v7 plan --server says server is not running
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-01-17 20:55:55 UTC (rev 713)
+++ trunk/v7/hardwaretest.py 2011-01-17 21:03:33 UTC (rev 714)
@@ -518,23 +518,30 @@
nvrPattern = re.compile("%s[^0-9]+(?P<version>[0-9]+\.[0-9]+)[^0-9]+(?P<release>[0-9]+)" % Constants.v7)
statusPattern = re.compile("%s=(?P<status>[a-zA-Z]+)" % Constants.v7serverstatus)
serverRunning = False
- for line in response:
- match = nvrPattern.search(line)
- if match:
- v7ServerVersion = match.group("version")
- v7ServerRelease = match.group("release")
- print "Version %s Release %s" % (v7ServerVersion, v7ServerRelease)
- if v7ServerVersion + "." + v7ServerRelease < "5.2.18":
- print "Warning: V7 server is from a prior release."
- print "Status can not be determined"
+ if response:
+ for line in response:
+ match = nvrPattern.search(line)
+ if match:
+ v7ServerVersion = match.group("version")
+ v7ServerRelease = match.group("release")
+ print "Version %s Release %s" % (v7ServerVersion, v7ServerRelease)
+ if v7ServerVersion + "." + v7ServerRelease < Constants.v7serverMinimumVersion:
+ print "Warning: V7 server is from a prior release."
+ print "Status can not be determined"
+ return False
+ match = statusPattern.search(line)
+ if match:
+ print "Status: %s" % match.group("status")
+ if match.group("status") == Constants.running:
+ serverRunning = True
+ else:
+ print "Warning: The v7 server on %s is reporting errors" % server
+ for line in response:
+ if "Error:" in line:
+ sys.stdout.write("%s says: %s" % (server, line))
return False
- match = statusPattern.search(line)
- if match:
- print "Status: %s" % match.group("status")
- if match.group("status") == Constants.running:
- serverRunning = True
- if not serverRunning:
- print "Warning: The V7 server on %s is not running" % server
+ else:
+ "Warning: The V7 server on %s is not running" % server
return False
except urllib2.URLError, exception:
13 years, 3 months
r713 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-17 20:55:55 +0000 (Mon, 17 Jan 2011)
New Revision: 713
Modified:
trunk/v7/rundocument.py
Log:
665272 - Why so many tests lost their output?
Modified: trunk/v7/rundocument.py
===================================================================
--- trunk/v7/rundocument.py 2011-01-17 20:54:47 UTC (rev 712)
+++ trunk/v7/rundocument.py 2011-01-17 20:55:55 UTC (rev 713)
@@ -169,12 +169,13 @@
textNode = self.addTextNode(outputElement, section)
def setTestOutput(self, outputFile):
+ errors = ""
try:
self.merge(outputFile, nodeIndex=0)
return True
except Exception, e:
- print "Warning: could not merge output XML, reading as text file."
- print e
+ errors = "Warning: could not merge output XML, reading as text file.\n"
+ errors += e.message + "\n"
# parser failed, just read the file
try:
@@ -183,11 +184,20 @@
if output and len(output) > 0:
outputElement = self.findOrCreateElement(self.element, Tags.output)
textNode = self.setTextNode(outputElement, "".join(output))
- return True
+ return True
+ else:
+ errors += "Error: log file is empty or missing.\n"
except Exception, e:
- print "Error: could not read log file " + outputFile
- print e
- return False
+ errors += "Error: could not read log file " + outputFile + "\n"
+ print e.message + "\n"
+
+ # otherwise - couldn't read log, or empty log - print them, and copy them to run output
+ if errors:
+ print errors
+ outputElement = self.findOrCreateElement(self.element, Tags.output)
+ textNode = self.setTextNode(outputElement, errors)
+
+ return False
def getResults(self, environment, resultsFile):
try:
13 years, 3 months
r712 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-17 20:54:47 +0000 (Mon, 17 Jan 2011)
New Revision: 712
Modified:
trunk/v7/hardwaretest.py
Log:
665272 - Why so many tests lost their output?
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-01-17 20:48:21 UTC (rev 711)
+++ trunk/v7/hardwaretest.py 2011-01-17 20:54:47 UTC (rev 712)
@@ -1044,7 +1044,9 @@
def saveOutput(self, run, retval, outputFilePath):
print "saveOutput: %s" % outputFilePath
run.setReturnValue(retval)
- run.setTestOutput(outputFilePath)
+ if not run.setTestOutput(outputFilePath):
+ print "Error: could not save test logs, marking as failed."
+ run.setSummary(Constants.FAIL)
def _getTestsFromOptions(self):
if self.options.device:
13 years, 3 months
r711 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-17 20:48:21 +0000 (Mon, 17 Jan 2011)
New Revision: 711
Modified:
trunk/v7/hardwaretest.py
Log:
646277 - core test reports PASS when clock jitter test fails
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2011-01-14 19:47:28 UTC (rev 710)
+++ trunk/v7/hardwaretest.py 2011-01-17 20:48:21 UTC (rev 711)
@@ -386,18 +386,17 @@
while True:
missingRPMs = list()
+ print "Checking installed rpms:"
for rpm in requiredRPMs.keys():
try:
rpmQ = Command("rpm -q " + rpm)
- rpmQ.getString("not installed") # this should throw and exception if rpm is there
- missingRPMs.append(rpm)
+ rpmQ.echo()
except V7CommandException, e:
- # "not installed" not there, so we're ok
- pass
+ missingRPMs.append(rpm)
if len(missingRPMs) > 0:
print "The following rpms are required for testing:"
missingRPMList = ""
- for rpm in missingRPMs:
+ for rpm in missingRPMs:
missingRPMList = "%s %s" % (missingRPMList, rpm)
print missingRPMList
if self.options.mode == Constants.auto or self.ui.promptConfirm("Would you like to install them now?"):
13 years, 3 months
r710 - in tags: . v7-V1-3R4/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-14 19:47:28 +0000 (Fri, 14 Jan 2011)
New Revision: 710
Added:
tags/v7-V1-3R4/
tags/v7-V1-3R4/v7/version.py
Log:
tag version
Copied: tags/v7-V1-3R4 (from rev 709, trunk)
Copied: tags/v7-V1-3R4/v7/version.py (from rev 335, trunk/v7/version.py)
===================================================================
--- tags/v7-V1-3R4/v7/version.py (rev 0)
+++ tags/v7-V1-3R4/v7/version.py 2011-01-14 19:47:28 UTC (rev 710)
@@ -0,0 +1,5 @@
+
+# v7/version.py is automatically-generated - DO NOT EDIT
+version = '1.3'
+release = '4'
+rhel_version = '5'
13 years, 4 months
r709 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-14 19:46:50 +0000 (Fri, 14 Jan 2011)
New Revision: 709
Modified:
trunk/v7.spec.in
Log:
R4
Modified: trunk/v7.spec.in
===================================================================
--- trunk/v7.spec.in 2011-01-14 19:42:36 UTC (rev 708)
+++ trunk/v7.spec.in 2011-01-14 19:46:50 UTC (rev 709)
@@ -69,9 +69,15 @@
/etc/init.d/v7
%changelog
+* Fri Jan 14 2011 Greg Nichols <gnichols(a)redhat.com>
+
+V7 1.3 R4
+
+ 646277 - core test reports PASS when clock jitter test fails
+
* Wed Jan 05 2011 Greg Nichols <gnichols(a)redhat.com>
-V7 1.2 R3
+V7 1.3 R3
659789 - Enhance command set for better usability and control of testing
13 years, 4 months
r708 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2011-01-14 19:42:36 +0000 (Fri, 14 Jan 2011)
New Revision: 708
Modified:
trunk/v7/command.py
Log:
646277 - core test reports PASS when clock jitter test fails
Modified: trunk/v7/command.py
===================================================================
--- trunk/v7/command.py 2011-01-14 19:42:13 UTC (rev 707)
+++ trunk/v7/command.py 2011-01-14 19:42:36 UTC (rev 708)
@@ -19,7 +19,7 @@
# __main__ self test function at the end of this file.
-import os,re, commands, subprocess, string, sys
+import os,re, commands, subprocess, string, sys, datetime
class Command:
@@ -50,8 +50,12 @@
self.output = output.splitlines()
if errors:
self.errors = errors.splitlines()
- self.returnValue = (self.pipe.returncode >> 8) & 0xFF
- self.signal = self.pipe.returncode & 0xFF
+ self.signal = 0
+ self.returnValue = 0
+ if self.pipe.returncode < 0:
+ self.signal = self.pipe.returncode
+ else:
+ self.returnValue = self.pipe.returncode
def start(self):
self.pipe = subprocess.Popen(self.command, shell=True,
@@ -63,12 +67,16 @@
if self.errors and len(self.errors) > 0:
raise V7CommandException(self, "has output on stderr")
- if self.returnValue != 0:
+ if self.returnValue != 0 or self.signal != 0:
# if error returned, show stdout whether echo or run was called
- for line in self.output:
- sys.stdout.write( line )
- sys.stdout.flush()
- raise V7CommandException(self, "returned %d" % self.returnValue)
+ if self.output:
+ for line in self.output:
+ sys.stdout.write( line )
+ sys.stdout.flush()
+ if self.returnValue != 0:
+ raise V7CommandException(self, "returned %d" % self.returnValue)
+ if self.signal != 0:
+ raise V7CommandException(self, "was killed, signal %d" % self.signal)
def run(self):
""" This method runs the command to produce an action. Any output
@@ -243,7 +251,8 @@
-def unit_test():
+def unitTest():
+ result = True
try:
# positive test: run
command = Command("ls -a")
@@ -251,9 +260,10 @@
command.run()
# positive test: simple match
+ year = "%u" % datetime.date.today().year
command = Command("date")
- print "is it 2008?"
- print command.getString("2008")
+ print "is it %s" % year
+ print command.getString(year)
# positive test: regex on single line
command = Command("date")
@@ -261,7 +271,7 @@
# positive test: regex on multiline
command = Command("who")
- print "a device via who: %s" % command.getString(regex="^(?P<user>[a-z]+) (?P<device>[a-z/]+[0-9]*)[ \t]*(?P<date>2008-\d+-\d+).*$", regexGroup="device", singleLine=False)
+ print "a device via who: %s" % command.getString(regex="^(?P<user>[a-z]+) (?P<device>[a-z/]+[0-9]*)[ \t]*(?P<date>2\d+-\d+-\d+).*$", regexGroup="device", singleLine=False)
#positive test: integer - simple match
command = Command("du .")
@@ -272,13 +282,18 @@
print "blocks via df: %u" % command.getInteger(regex="^[ \t]+(?P<blocks>[0-9]+[ \t]+).*$", regexGroup="blocks", singleLine=False)
except V7CommandException, e:
+ print "Error: positive test failed:"
+ print command.command
print e
+ result = False
# negative test: fail simple match
try:
print "is it 1999?:"
command = Command("date")
command.getString(regex="1999")
+ print "Error: invalid string match should raise exception"
+ result = False
except V7CommandException, e:
print e
@@ -286,25 +301,54 @@
try:
print "negative test: return value:"
command = Command("exit 1")
- print "call exit(1)" % command.getString()
+ print "call exit(1)"
+ command.echo()
+ print "Error: non-zero return value should raise exception"
+ result = False
except V7CommandException, e:
print e
+ print "passed"
+
+ # negative test: killed subprocess
+ # disabling this test - to test it, use "killall sleep" while the unit test has paused.
+ if False:
+ try:
+ print "negative test: killed subprocess:"
+ sleep = Command("sleep 10")
+ print "call sleep 10"
+ sleep.echo()
+ print "Error: killed process should raise exception"
+ result = False
+ except V7CommandException, e:
+ print e
+ sleep.printErrors()
+ print "passed"
# negative test: expect single line, get multiple
try:
print "negative test: more than one line of output"
command = Command("who")
print "who: %s" % command.getString()
+ print "Error: multi-line output when one line is expected should raise exception"
+ result = False
except V7CommandException, e:
print e
- # negative test: expect single line, get multiple
+ # negative test: output on stderr
try:
print "negative test: output on stderr"
command = Command("echo \"boguserror\" >&2; echo \"boguserror\"")
print "error echo: %s" % command.getString(regex="boguserror", singleLine=False)
+ print "Error: output on stderr should raise exception"
+ result = False
except V7CommandException, e:
print e
+
+ return result
if __name__ == "__main__":
- unit_test()
+ if not unitTest():
+ print "command.py unit test FAILED"
+ exit(1)
+ print "command.py unit test passed"
+ exit(0)
13 years, 4 months