r694 - in tags: . v7-V1-3R1/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-16 01:52:46 +0000 (Thu, 16 Dec 2010)
New Revision: 694
Added:
tags/v7-V1-3R1/
tags/v7-V1-3R1/v7/version.py
Log:
tag version
Copied: tags/v7-V1-3R1 (from rev 693, trunk)
Copied: tags/v7-V1-3R1/v7/version.py (from rev 335, trunk/v7/version.py)
===================================================================
--- tags/v7-V1-3R1/v7/version.py (rev 0)
+++ tags/v7-V1-3R1/v7/version.py 2010-12-16 01:52:46 UTC (rev 694)
@@ -0,0 +1,5 @@
+
+# v7/version.py is automatically-generated - DO NOT EDIT
+version = '1.3'
+release = '1'
+rhel_version = '5'
13 years, 4 months
r693 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-16 01:48:08 +0000 (Thu, 16 Dec 2010)
New Revision: 693
Modified:
trunk/v7.spec.in
Log:
changelog
Modified: trunk/v7.spec.in
===================================================================
--- trunk/v7.spec.in 2010-12-15 17:07:57 UTC (rev 692)
+++ trunk/v7.spec.in 2010-12-16 01:48:08 UTC (rev 693)
@@ -69,6 +69,15 @@
/etc/init.d/v7
%changelog
+* Tue Dec 14 2010 Greg Nichols <gnichols(a)redhat.com>
+
+V7 1.3 R1
+
+ 649314 - v7 returns 1 on successful run
+ 649729 - RHEL5 fv_tests may fail on initial run due to kvm modules not installed
+ 659789 - Enhance command set for better usability and control of testing
+ 642029 - USB SCSI tape drives cause: UnicodeEncodeError
+
* Mon Sep 13 2010 Greg Nichols <gnichols(a)redhat.com>
V7 1.2 R25
13 years, 4 months
r692 - trunk/tests/info
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-15 17:07:57 +0000 (Wed, 15 Dec 2010)
New Revision: 692
Modified:
trunk/tests/info/info.py
Log:
659789 - Enhance command set for better usability and control of testing
Modified: trunk/tests/info/info.py
===================================================================
--- trunk/tests/info/info.py 2010-12-15 17:06:20 UTC (rev 691)
+++ trunk/tests/info/info.py 2010-12-15 17:07:57 UTC (rev 692)
@@ -18,7 +18,7 @@
import v7.version
from v7.test import Test
-from v7.tags import Constants, DeviceClass
+from v7.tags import Constants, DeviceClass, TestTag
from v7.command import Command, V7CommandException
from v7.redhatrelease import RedHatRelease
@@ -37,6 +37,9 @@
print "v7 version %s, release %s" % (v7.version.version, v7.version.release)
self.priority = 1000 # run last
+ def tags(self):
+ return [TestTag.noninteractive, TestTag.certification]
+
def getRequiredRPMs(self):
if "Red Hat" in self.redHatRelease.getProduct() and self.redHatRelease.getVersion() < 6:
# kernel-devel or varient is required for the ABI whitelist for RHEL5
13 years, 4 months
r691 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-15 17:06:20 +0000 (Wed, 15 Dec 2010)
New Revision: 691
Modified:
trunk/v7/certificationtest.py
Log:
659789 - Enhance command set for better usability and control of testing
Modified: trunk/v7/certificationtest.py
===================================================================
--- trunk/v7/certificationtest.py 2010-12-15 17:03:19 UTC (rev 690)
+++ trunk/v7/certificationtest.py 2010-12-15 17:06:20 UTC (rev 691)
@@ -180,7 +180,8 @@
else:
for name, deviceClass in self.deviceClasses.items():
tests.extend(deviceClass.getTests(names))
-
+
+ tests.sort()
return tests
def getFilteredTests(self, options):
13 years, 4 months
r690 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-15 17:03:19 +0000 (Wed, 15 Dec 2010)
New Revision: 690
Modified:
trunk/v7/deviceclassdocument.py
Log:
659789 - Enhance command set for better usability and control of testing
Modified: trunk/v7/deviceclassdocument.py
===================================================================
--- trunk/v7/deviceclassdocument.py 2010-12-15 17:02:51 UTC (rev 689)
+++ trunk/v7/deviceclassdocument.py 2010-12-15 17:03:19 UTC (rev 690)
@@ -135,7 +135,7 @@
self.setAttribute(testElement, Attributes.device_class, test.getDeviceClass())
self.setAttribute(testElement, Attributes.device_bus, test.getDeviceBus())
self.setAttribute(testElement, Attributes.name, test.Name())
- self.setAttribute(testElement, Attributes.interactive, test.Interactive())
+ self.setAttribute(testElement, Attributes.priority, test.Priority())
self.setAttribute(testElement, Attributes.mandatory, test.getMandatory())
self.setAttribute(testElement, Attributes.source, test.getSource())
self.element.appendChild(testElement)
13 years, 4 months
r689 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-15 17:02:51 +0000 (Wed, 15 Dec 2010)
New Revision: 689
Modified:
trunk/v7/testdocument.py
Log:
659789 - Enhance command set for better usability and control of testing
Modified: trunk/v7/testdocument.py
===================================================================
--- trunk/v7/testdocument.py 2010-12-15 17:02:29 UTC (rev 688)
+++ trunk/v7/testdocument.py 2010-12-15 17:02:51 UTC (rev 689)
@@ -18,7 +18,7 @@
import time
from xml.dom.minidom import getDOMImplementation, parse
import xml.dom.ext
-from tags import Tags, Attributes, Constants
+from tags import Tags, Attributes, Constants, TestTag
from documentbase import DocumentWrapper, DocumentBase
from rundocument import RunDocument
import version
@@ -35,6 +35,17 @@
self.document = document
self.mode = None
+ def __cmp__(self, other):
+ if TestTag.interactive in self.getTags() and not TestTag.interactive in other.getTags():
+ return -1
+ if not TestTag.interactive in self.getTags() and TestTag.interactive in other.getTags():
+ return 1
+ if self.getPriority() < other.getPriority():
+ return -1
+ if self.getPriority() > other.getPriority():
+ return 1
+ return 0
+
def getKey(self):
return "%s-%s-%s" % (self.getName(), self.getUDI(), self.getLogicalDeviceName())
@@ -42,6 +53,7 @@
def copyValueOf(self, originalTest):
print "copy Test"
self.setName(originalTest.getName())
+ self.setPriority(originalTest.getPriority())
self.setUDI(originalTest.getUDI())
self.setLabel(originalTest.getLabel())
self.setStatus(originalTest.getStatus())
@@ -57,6 +69,15 @@
def setName(self, name):
if name:
self.element.setAttribute(Attributes.name, name)
+ def getPriority(self):
+ priority = self.element.getAttribute(Attributes.priority)
+ if priority:
+ return int(priority)
+ return 999
+
+ def setPriority(self, priority):
+ if priority:
+ self.element.setAttribute(Attributes.priority, priority)
def getUDI(self):
return self.element.getAttribute(Attributes.udi)
@@ -135,7 +156,7 @@
return self.element.getAttribute(Attributes.source)
def isInteractive(self):
- return (Constants.yes in self.element.getAttribute(Attributes.interactive))
+ return (TestTag.interactive in self.getTags())
def getMandatory(self):
return self.element.getAttribute(Attributes.mandatory)
13 years, 4 months
r688 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-15 17:02:29 +0000 (Wed, 15 Dec 2010)
New Revision: 688
Modified:
trunk/v7/test.py
Log:
659789 - Enhance command set for better usability and control of testing
Modified: trunk/v7/test.py
===================================================================
--- trunk/v7/test.py 2010-12-15 17:00:33 UTC (rev 687)
+++ trunk/v7/test.py 2010-12-15 17:02:29 UTC (rev 688)
@@ -93,8 +93,9 @@
def __cmp__(self, other):
if TestTag.interactive in self.tags() and not TestTag.interactive in other.tags():
return -1
- if TestTag.interactive in other.tags() and not TestTag.interactive in self.tags():
+ if not TestTag.interactive in self.tags() and TestTag.interactive in other.tags():
return 1
+ # low means run before high
if self.priority < other.priority:
return -1
if self.priority > other.priority:
13 years, 4 months
r687 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-15 17:00:33 +0000 (Wed, 15 Dec 2010)
New Revision: 687
Modified:
trunk/v7/tags.py
Log:
659789 - Enhance command set for better usability and control of testing
Modified: trunk/v7/tags.py
===================================================================
--- trunk/v7/tags.py 2010-12-14 16:57:55 UTC (rev 686)
+++ trunk/v7/tags.py 2010-12-15 17:00:33 UTC (rev 687)
@@ -95,6 +95,7 @@
type="type"
user="user"
password="password"
+ priority="priority"
13 years, 4 months
r686 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-14 16:57:55 +0000 (Tue, 14 Dec 2010)
New Revision: 686
Modified:
trunk/v7/documentbase.py
Log:
642029 - [v7] USB SCSI tape drives cause: UnicodeEncodeError: 'ascii' codec can't encode characters in position 13-20: ordinal not in range(128)
Modified: trunk/v7/documentbase.py
===================================================================
--- trunk/v7/documentbase.py 2010-12-14 16:45:33 UTC (rev 685)
+++ trunk/v7/documentbase.py 2010-12-14 16:57:55 UTC (rev 686)
@@ -23,6 +23,8 @@
from device import Device, HalDevice, ProcDevice, KudzuDevice, UdevDevice
class DocumentWrapper:
+ # non-printing ascii unacceptable to xml
+ asciiBadForXML = map(chr, range(9) + range(11,13) + range(14,32))
def __init__(self):
self.document = None
@@ -60,20 +62,19 @@
parent.appendChild(child)
return child
- def setTextNode(self, element, value):
- value = self.removeBadCharacters(value)
+ def setTextNode(self, element, value, filter=True):
if value:
- value = self.removeBadCharacters(value)
+ if filter:
+ value = self.removeBadCharacters(value)
# is there an existing child text node?
textNode = self.getTextNode(element)
if textNode:
textNode.data = value
- return
+ else:
+ # else no existing text child note, create it
+ textNode = self.document.createTextNode(value)
+ element.appendChild(textNode)
- # else no existing text child note, create it
- textNode = self.document.createTextNode(value)
- element.appendChild(textNode)
-
def addTextNode(self, element, value):
if value:
if type(value) == unicode:
@@ -99,6 +100,7 @@
stop = datetime.datetime(*(time.strptime(stopTime, Constants.DATETIMEFORMAT)[0:5]))
return stop - start
+
def duration(self, startTime, stopTime):
duration = self.durationData(startTime, stopTime)
if duration.days > 0:
@@ -113,32 +115,24 @@
def timeStringToTimestamp(self, theTimeString):
+
return theTimeString.replace(" ", "").replace(":", "").replace("-", "")
def removeBadCharacters(self, value):
- if type(value) == unicode:
- badUnicode = [u'\xae']
- goodValue = u""
- for uc in value:
- if uc not in badUnicode:
- goodValue += uc
- value = goodValue.encode('ascii')
-
- try:
- # badnumbers = [0,8,27,246]
- badnumbers = range(9) # various non-printing characters
- badnumbers.extend(range(14,31)) # various control characters, escape
- badnumbers.extend(range(128, 256))
- badchars = ""
- for i in badnumbers:
- badchars += chr(i)
- badchars += "|"
- chars = ""
- for i in range(256):
- chars += chr(i)
- return value.translate(chars, badchars)
- except TypeError:
- return value
+ filtered = u''
+ filterStart = 0
+ # for c in value:
+ for i in range(len(value)):
+ c = value[i]
+ if c in self.asciiBadForXML or (type(value) != unicode and ord(c) >= 128):
+ if self.Debugging != Constants.off:
+ print "skipping bad char \\x%.2x" % ord(c)
+ if filterStart < i:
+ filtered += value[filterStart:i]
+ filterStart = i+1
+ filtered += value[filterStart:]
+ return filtered
+
def setAttribute(self, element, attribute, value):
if not value:
@@ -259,3 +253,58 @@
sys.exit(1)
file.close()
+
+
+
+if __name__ == '__main__':
+
+ """ Test class for read/write of documents to xml files """
+ class XmlFileTest(DocumentBase):
+ def __init__(self):
+ dom = getDOMImplementation()
+ self.document = dom.createDocument(None, "documentbase-test", None)
+ self.topElement = self.document.documentElement
+ stylesheet = self.document.createProcessingInstruction("xml-stylesheet", "href=\"/v7/css/results.css\" type=\"text/css\"")
+ self.document.insertBefore(stylesheet, self.topElement)
+ def test(self, data, id):
+ self.topElement.setAttribute("test", data.encode("utf-8"))
+ textNode = self.document.createTextNode(data)
+ self.topElement.appendChild(textNode)
+ file = open("documentbase-selftest-%s.xml" % id, "w")
+ xml.dom.ext.PrettyPrint(self.document, file)
+ file.close()
+ file = open("documentbase-selftest-%s.xml" % id, "r")
+ document = xml.dom.minidom.parse(file)
+ file.close()
+ print "data parsed, written, and read from xml file"
+
+ testData = list()
+ print "\nTesting ascii 0-127:"
+ bad = '' # str, not unicode
+ for i in range(128):
+ bad += chr(i)
+ sample = u'' + bad
+ testData.append((sample, "0-127"))
+
+ bad = u'' # unicode
+ for i in range(128,256):
+ bad += unichr(i)
+ sample = u'' + bad
+ testData.append((sample, "128-255"))
+
+ testData.append((u'\u1234\u20ac\u0000\u2332', "multibyte"))
+
+ testData.append((u'some\nwords\nget\nchopped', 'regular'))
+
+ testData.append((chr(0xc2), "ascii-value"))
+
+ wrapper = DocumentWrapper()
+ wrapper.Debugging = Constants.high
+
+ for (sample, id) in testData:
+ xmlFileTest = XmlFileTest()
+ sample = wrapper.removeBadCharacters(sample)
+ xmlFileTest.test(sample, id)
+
+
+
13 years, 4 months
r685 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2010-12-14 16:45:33 +0000 (Tue, 14 Dec 2010)
New Revision: 685
Modified:
trunk/v7/fvtest.py
Log:
649729 - RHEL5 fv_tests may fail on initial run due to kvm modules not installed
Modified: trunk/v7/fvtest.py
===================================================================
--- trunk/v7/fvtest.py 2010-12-14 16:39:31 UTC (rev 684)
+++ trunk/v7/fvtest.py 2010-12-14 16:45:33 UTC (rev 685)
@@ -101,6 +101,15 @@
print "Warning: libvirtd may not be running"
print e
+ # check the kvm modules
+ try:
+ kvmModulesScript = "/etc/sysconfig/modules/kvm.modules"
+ if os.path.exists(kvmModulesScript):
+ Command(kvmModulesScript).echo()
+ except V7CommandException, e:
+ print "Warning: kvm modules may not be running"
+ print e
+
def __isHVMCapableViaLibvirt(self):
""" determine if system is FV/hvm capable, via virsh from libvirt """
virsh = Command("virsh capabilities")
13 years, 4 months