r1371 - trunk/tests/core
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-28 13:17:21 +0000 (Tue, 28 Aug 2012)
New Revision: 1371
Modified:
trunk/tests/core/Makefile
trunk/tests/core/clocktest.c
Log:
822246 - clocktest use of CPUSET_S not completely correct.
Modified: trunk/tests/core/Makefile
===================================================================
--- trunk/tests/core/Makefile 2012-08-28 12:44:45 UTC (rev 1370)
+++ trunk/tests/core/Makefile 2012-08-28 13:17:21 UTC (rev 1371)
@@ -29,6 +29,7 @@
CFLAGS+=-Wall
+CFLAGS+=-DCPU_ALLOC
# sched_setaffinity has no size_t argument on older systems.
ifeq ($(shell grep 'sched_setaffinity.*size_t' /usr/include/sched.h),)
CFLAGS+=-DOLD_SCHED_SETAFFINITY
Modified: trunk/tests/core/clocktest.c
===================================================================
--- trunk/tests/core/clocktest.c 2012-08-28 12:44:45 UTC (rev 1370)
+++ trunk/tests/core/clocktest.c 2012-08-28 13:17:21 UTC (rev 1371)
@@ -31,10 +31,14 @@
printf("using CPU_CALLOC\n");
return CPU_ALLOC(num_cpus);
}
+#define cpu_zero(cpumask) CPU_ZERO_S(num_cpus, cpumask)
+#define cpu_set(cpu,cpumask) CPU_SET_S(cpu, num_cpus, cpumask)
#else
cpu_set_t* cpu_alloc(unsigned num_cpus){
return malloc(sizeof(cpu_set_t));
}
+#define cpu_zero(cpumask) CPU_ZERO(cpumask)
+#define cpu_set(cpu,cpumask) CPU_SET(cpu,cpumask)
#endif
int test_clock_jitter(){
@@ -64,8 +68,8 @@
for (iter=0; iter<ITERATIONS; iter++){
for (cpu=0; cpu < num_cpus; cpu++) {
- CPU_ZERO(cpumask); CPU_SET(cpu,cpumask);
- if (setaffinity(cpumask) < 0){
+ cpu_zero(cpumask); cpu_set(cpu,cpumask);
+ if (setaffinity(cpumask) < 0){
perror ("sched_setaffinity"); return 1;
}
/*
11 years, 8 months
r1370 - trunk/tests/network
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-28 12:44:45 +0000 (Tue, 28 Aug 2012)
New Revision: 1370
Removed:
trunk/tests/network/runtest.sh
Modified:
trunk/tests/network/Makefile
trunk/tests/network/network.py
Log:
843609 - network test should not use HAL
Modified: trunk/tests/network/Makefile
===================================================================
--- trunk/tests/network/Makefile 2012-08-27 18:46:20 UTC (rev 1369)
+++ trunk/tests/network/Makefile 2012-08-28 12:44:45 UTC (rev 1370)
@@ -15,20 +15,18 @@
.PHONY: all install download clean
-FILES=runtest.sh network.py
+FILES=network.py
run: $(FILES) build
- ./runtest.sh
build: $(BUILT_FILES)
- chmod a+x ./runtest.sh ./network.py
+ chmod a+x ./network.py
clean:
rm -f $(BUILT_FILES)
-
+
server:
python network.py server $(RUNMODE)
# Include Common Makefile
include $(DESTDIR)/usr/share/v7/lib/v7-make.include
-
Modified: trunk/tests/network/network.py
===================================================================
--- trunk/tests/network/network.py 2012-08-27 18:46:20 UTC (rev 1369)
+++ trunk/tests/network/network.py 2012-08-28 12:44:45 UTC (rev 1370)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
-# is made available to anyone wishing to use, modify, copy, or
-# redistribute it subject to the terms and conditions of the GNU General
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
-#
+#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -25,7 +25,6 @@
# sys.path.append("/home/gnichols/devel/v7")
from v7.tags import Constants, DeviceClass
-from v7.hal import Hal
from v7.test import Test, TestTag
from v7.command import Command, V7CommandException
from v7.environment import Environment
@@ -35,7 +34,7 @@
FAILED = 1
PASSED = 0
-class NetworkTest(Test):
+class NetworkTest(Test):
def __init__(self):
Test.__init__(self, name="network")
@@ -44,18 +43,6 @@
self.allOtherInterfaces = list()
self.interfaceSpeed = 100 # speed in Mb/sec
self.oldHandler = None
-
- self.owner = "Greg Nichols <gnichols(a)redhat.com>"
- self.nameSpace = "V7"
- self.testPackage = "v7"
- self.spaceName = ""
- self.path = "v7/tests/network"
- self.version = "1.1"
- self.description = "Network IF test for tcp, udp, icmp and nfs"
- self.testTime = "5m"
- self.runFor = ""
- self.runOn = "\'net\' in info.capabilities"
- self.requires = "lmbench"
self.serverMode = True
self.priority = 2 # set priority high so it runs before longer tests
self.isNFSRootSystem = False
@@ -68,13 +55,13 @@
def plan(self, planner):
tests = dict()
- devices = planner.getHalDeviceDetector().getDevices()
+ devices = planner.getUdevDeviceDetector().getDevices()
for device in devices:
logicalDevice = None
- if "net" in device.getProperty("info.capabilities") and not "xen" in device.getProperty("net.physical_device"):
- logicalDevice = device.getProperty('net.interface')
+ if "net" in device.getProperty("SUBSYSTEM"):
+ logicalDevice = device.getProperty("INTERFACE")
- """ if network logical device was found, and not already planned,
+ """ if network logical device was found, and not already planned,
and it's not in the ignore list, add it"""
if logicalDevice and logicalDevice != "" and not logicalDevice in tests and not self.ignoreInterfaces.search(logicalDevice):
test = self.makeCopy()
@@ -100,7 +87,7 @@
errors.append("Could not determine IP Address.")
if self.getTestServer() == None or self.getTestServer() == "unknown":
- errors.append("No test server was set.")
+ errors.append("No test server was set.")
else:
self.checkTestServer(errors)
@@ -118,9 +105,9 @@
def checkTestServer(self, errors):
result = True
try:
- request = urllib2.Request('http://%s/v7/cgi/v7web.py?command=status' % self.getTestServer())
- opener = urllib2.build_opener()
- response = opener.open(request).readlines()
+ request = urllib2.Request('http://%s/v7/cgi/v7web.py?command=status' % self.getTestServer())
+ opener = urllib2.build_opener()
+ response = opener.open(request).readlines()
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
@@ -144,16 +131,16 @@
if "Error:" in line:
errors.append("%s says: %s" % (self.getTestServer(), line))
return False
- else:
+ else:
errors.append("Error: The V7 server %s is not running" % self.getTestServer())
return False
- except urllib2.URLError, exception:
+ except urllib2.URLError, exception:
errors.append("Error: Could not contact the V7 server on %s" % self.getTestServer())
errors.append("Error: %s" % exception)
return False
- return result
+ return result
@@ -183,7 +170,7 @@
interface = line.strip()
if not self.ignoreInterfaces.search(interface):
if interface != self.interface:
- self.allOtherInterfaces.append(interface)
+ self.allOtherInterfaces.append(interface)
elif self.debug != Constants.off:
print "ignoring interface %s" % interface
else:
@@ -352,7 +339,7 @@
return self.regenerateTestFile()
- def regenerateTestFile(self):
+ def regenerateTestFile(self):
try:
os.remove(self.testFile)
except OSError:
@@ -372,7 +359,7 @@
return True
- def getInterfaceSpeed(self):
+ def getInterfaceSpeed(self):
# default to 100 Mb/s
self.interfaceSpeed = 0
for interfaceString in (self.interface, "p%s" % self.interface):
@@ -424,12 +411,12 @@
# lat_tcp and bw_tcp report results on stderr, so
# we have to catch the V7CommandException and print the results
# for each of these tests. Also
- print "tcp test:"
+ print "tcp test:"
sys.stdout.flush()
cycles = 5
for p in range(cycles):
- print "test cycle %u of %u" % (p+1, cycles)
- try:
+ print "test cycle %u of %u" % (p+1, cycles)
+ try:
print "testing latency..."
Command("lat_tcp %s" % self.getTestServer()).echo()
except V7CommandException, exception:
@@ -440,7 +427,7 @@
else:
print exception.command.errors[0]
try:
- # bw_tcp is not consistent about return values.
+ # bw_tcp is not consistent about return values.
# it also produces output on stderr in all cases
# this test expects output like "0.0324 0.40 MB/sec"
# on stderr and fails otherwise
@@ -493,8 +480,8 @@
selinuxParams = Command("/usr/sbin/sestatus")
selinuxMode = selinuxParams.getString(regex="Current mode:[ \t]+(?P<selinuxMode>[a-zA-Z]+)", regexGroup="selinuxMode", singleLine=False)
if selinuxMode != "permissive":
- print "Warning: SELinux is in %s mode - it must be set to \"permissive\" for certification testing." % selinuxMode
- return False
+ print "Warning: SELinux is in %s mode - it must be set to \"permissive\" for certification testing." % selinuxMode
+ return False
except V7CommandException, exception:
print "Warning: could not determine selinux parameters"
return False
@@ -512,7 +499,7 @@
print "Error: could not stop %s" % service
print e
result = False
- print " done."
+ print " done."
# httpd
try:
@@ -587,8 +574,8 @@
print "Copying %s x %u mbit files to/from %s" % (files, self.interfaceSpeed, self.getTestServer())
- txtime=0
- rxtime=0
+ txtime=0
+ rxtime=0
t=0
mbit=files*self.interfaceSpeed # where does speed come from?
@@ -611,7 +598,7 @@
txtime = 0
for n in range(files):
print "copy from %s to %s/%s/%u" % (
- self.testFile,
+ self.testFile,
self.nfsdir, self.ipAddress, n)
(start_utime, start_stime, start_cutime, start_cstime, start_elapsed_time) = os.times()
@@ -633,7 +620,7 @@
try:
Command("mount -o %s %s:/var/v7/export %s" % (nfsopts, self.getTestServer(), self.nfsdir)).run()
except V7CommandException, e:
- print "Error: Mount command FAILED"
+ print "Error: Mount command FAILED"
print e
return False
@@ -644,7 +631,7 @@
for n in range(files):
print "copy from %s/%s/%u to %s" % (
self.nfsdir, self.ipAddress, n,
- self.testFile)
+ self.testFile)
(start_utime, start_stime, start_cutime, start_cstime, start_elapsed_time) = os.times()
Command("cp %s/%s/%u datafile.tmp" % (self.nfsdir, self.ipAddress, n)).run()
(stop_utime, stop_stime, stop_cutime, stop_cstime, stop_elapsed_time) = os.times()
@@ -666,7 +653,7 @@
def httpTransferTest(self):
""" transfer a file to the server via POST, then pull it back via GET and compare the files """
errorCount = 0
- for count in range(1,5):
+ for count in range(1,5):
self.regenerateTestFile()
(sentFileCheckSum, uploadIPAddress) = self.httpUpload()
if not uploadIPAddress:
@@ -720,12 +707,12 @@
def httpDownload(self, uploadIPAddress):
# GET the file back
fileURL = 'http://%s/v7/transfer/%s/%s' % (self.getTestServer(), uploadIPAddress, os.path.basename(self.testFile))
- print "getting file %s " % fileURL
+ print "getting file %s " % fileURL
sys.stdout.flush()
request = urllib2.Request(fileURL)
- opener = urllib2.build_opener()
+ opener = urllib2.build_opener()
- startTime = time.time()
+ startTime = time.time()
response = opener.open(request).read()
stopTime = time.time()
print "Download took %.2f seconds, %.2f MB/sec" % (stopTime-startTime, len(response)/((stopTime-startTime)*1000000))
@@ -775,7 +762,7 @@
print "Error: could not add route for testing"
return False
self.setSignalHandler(self.removeRoute)
- else:
+ else:
if not self.downAllOtherInterfaces():
print "Error: could not shutdown all other interfaces"
return False
@@ -791,7 +778,7 @@
return self.prepareForRun()
- def run(self):
+ def run(self):
if not self.runSubTest(self.prepareForRun, "Setup", "prepare for network testing"):
return FAILED
@@ -831,7 +818,3 @@
networkTest = NetworkTest()
returnValue = networkTest.do(sys.argv)
sys.exit(returnValue)
-
-
-
-
Deleted: trunk/tests/network/runtest.sh
===================================================================
--- trunk/tests/network/runtest.sh 2012-08-27 18:46:20 UTC (rev 1369)
+++ trunk/tests/network/runtest.sh 2012-08-28 12:44:45 UTC (rev 1370)
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-v7-run-simple-test ${TEST:-$(basename $PWD)} ./network.py
11 years, 8 months
r1369 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-27 18:46:20 +0000 (Mon, 27 Aug 2012)
New Revision: 1369
Modified:
trunk/Makefile
Log:
R2
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2012-08-27 18:44:38 UTC (rev 1368)
+++ trunk/Makefile 2012-08-27 18:46:20 UTC (rev 1369)
@@ -14,7 +14,7 @@
# Author: Greg Nichols
V7_VERSION := 1.6.4
-V7_RELEASE := 1
+V7_RELEASE := 2
V7_VERSION_RELEASE := $(V7_VERSION)-$(V7_RELEASE)
V7_VERSION_PY := v7/version.py
V7_SVN_MODULE := svn+ssh://svn.fedorahosted.org/svn/v7
11 years, 8 months
r1368 - trunk/tests/audio
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-27 18:44:38 +0000 (Mon, 27 Aug 2012)
New Revision: 1368
Removed:
trunk/tests/audio/runtest.sh
Modified:
trunk/tests/audio/Makefile
trunk/tests/audio/audio.py
Log:
843607 - audio test should not use HAL
Modified: trunk/tests/audio/Makefile
===================================================================
--- trunk/tests/audio/Makefile 2012-08-23 19:05:55 UTC (rev 1367)
+++ trunk/tests/audio/Makefile 2012-08-27 18:44:38 UTC (rev 1368)
@@ -15,22 +15,16 @@
.PHONY: all install download clean
-BUILT_FILES=
+BUILT_FILES=
FILES=runtest.sh audio.py
run: $(FILES) build
- ./runtest.sh
build: $(BUILT_FILES)
- chmod a+x ./runtest.sh audio.py
+ chmod a+x audio.py
clean:
- rm -f $(BUILT_FILES)
+ rm -f $(BUILT_FILES)
-
# Include Common Makefile
include $(DESTDIR)/usr/share/v7/lib/v7-make.include
-
-
-
-
Modified: trunk/tests/audio/audio.py
===================================================================
--- trunk/tests/audio/audio.py 2012-08-23 19:05:55 UTC (rev 1367)
+++ trunk/tests/audio/audio.py 2012-08-27 18:44:38 UTC (rev 1368)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (c) 2006 Red Hat, Inc. All rigv7 reserved. This copyrighted material
-# is made available to anyone wishing to use, modify, copy, or
-# redistribute it subject to the terms and conditions of the GNU General
+# Copyright (c) 2006 Red Hat, Inc. All rigv7 reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
-#
+#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -17,57 +17,47 @@
from v7.test import Test
from v7.tags import Constants, DeviceClass
-from v7.hal import Hal
-from v7.redhatrelease import RedHatRelease
+from v7.udevDeviceDetector import UdevDeviceDetector
-class AudioTest(Test):
-
+class AudioTest(Test):
+
def __init__(self):
Test.__init__(self, name="audio")
self.deviceClass = DeviceClass.audio
-
+
def plan(self, planner):
properties = dict()
- properties['alsa.pcm_class'] = 'generic'
- properties['alsa.type'] = 'playback'
- tests = self.planWith(planner.getHalDeviceDetector(), properties, all=False)
+ properties['SUBSYSTEM'] = 'sound'
+ properties['SOUND_INITIALIZED'] = '1'
+ tests = self.planWith(planner.getUdevDeviceDetector(), properties, all=False)
return tests
-
+
def getRequiredRPMs(self):
- rpms = ["sox"]
- redhat = RedHatRelease()
- if "Fedora" in redhat.getProduct() or ("Red Hat" in redhat.getProduct() and redhat.getVersion() >= 6):
- rpms.append("alsa-utils") # for sound samples in /usr/share/sounds/alsa
- else:
- rpms.append("system-config-soundcard") # for sound samples in /usr/share/system-config-soundcard
- return rpms
-
+ return ["sox", "alsa-utils"]
+
def logSoundCardInfo(self):
- if self.getUDI():
- hal = Hal()
- self.device = hal.getDevice(self.getUDI())
+ if self.udi:
+ self.device = UdevDeviceDetector().getDevice(self.udi)
if self.device:
- parentUDI = self.device.getProperty("info.parent")
- if parentUDI:
- print "\nSound Card:"
- print hal.dumpDevice(parentUDI)
- print ""
- return True
+ print "\nSound Card:"
+ print self.device.dump()
+ print ""
+ return True
# otherwise
return False
-
+
def run(self):
FAILED = 1
PASSED = 0
-
+
if not self.logSoundCardInfo():
print "Error: could not log sound card information"
return FAILED
-
+
if self.getMode() == Constants.auto:
print("Error: Test Mode: %s: The audio test can not be run in auto mode since audio functions must be verified by the tester." % self.getMode())
return FAILED
-
+
# otherwise
print "This test plays a sound sample and records it to another file."
print "Please use the Volume Control application and insure that the "
@@ -75,12 +65,11 @@
if not self.promptConfirm("Continue?"):
self.result = Constants.FAIL
return FAILED
-
- waveFiles=["/usr/share/system-config-soundcard/sound-sample.wav",
- "/usr/share/sounds/alsa/Front_Right.wav",
+
+ waveFiles=["/usr/share/sounds/alsa/Front_Right.wav",
"/usr/share/sounds/alsa/Front_Left.wav"]
recordedWaveFile="./test.wav"
- print "starting recording"
+ print "starting recording"
for waveFile in waveFiles:
if os.path.exists(waveFile):
if not os.system("play %s &" % waveFile) is 0:
@@ -91,40 +80,36 @@
print "Error: record command failed"
self.result = Constants.FAIL
return FAILED
-
+
waitTime = 7
print "Waiting %d sec" % waitTime
sys.stdout.flush()
time.sleep(waitTime)
os.system("killall -w -9 rec sox")
-
+
if not self.promptConfirm("Did you hear the sound?"):
self.result = Constants.FAIL
return FAILED
-
+
print "playing recorded sound"
if not os.system("play %s" % recordedWaveFile) is 0:
print "Error: play command failed"
self.result = Constants.FAIL
return FAILED
-
+
if not self.promptConfirm("Did you hear the sound?"):
self.result = Constants.FAIL
return FAILED
-
+
outputDirectory = os.path.dirname(self.outputFile)
shutil.copy(recordedWaveFile, outputDirectory)
print "Copied recorded sound %s to %s" % (recordedWaveFile, outputDirectory)
-
+
self.result = Constants.PASS
return PASSED
-
+
if __name__ == "__main__":
test = AudioTest()
returnValue = test.do(sys.argv)
sys.exit(returnValue)
-
-
-
-
Deleted: trunk/tests/audio/runtest.sh
===================================================================
--- trunk/tests/audio/runtest.sh 2012-08-23 19:05:55 UTC (rev 1367)
+++ trunk/tests/audio/runtest.sh 2012-08-27 18:44:38 UTC (rev 1368)
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-v7-run-simple-test info ./audio.py
11 years, 8 months
r1367 - tags
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-23 19:05:55 +0000 (Thu, 23 Aug 2012)
New Revision: 1367
Added:
tags/v7-V1-6.4R1/
Log:
tag version
11 years, 8 months
r1366 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-23 19:05:01 +0000 (Thu, 23 Aug 2012)
New Revision: 1366
Modified:
trunk/v7.spec.in
Log:
changelog
Modified: trunk/v7.spec.in
===================================================================
--- trunk/v7.spec.in 2012-08-23 19:03:41 UTC (rev 1365)
+++ trunk/v7.spec.in 2012-08-23 19:05:01 UTC (rev 1366)
@@ -80,11 +80,21 @@
%changelog
+* Thu Aug 23 2012 Greg Nichols <gnichols(a)redhat.com>
+
+V7 1.6.4 R1
+
+ 843606 - infiniband test should not use HAL
+ 843613 - tape test should not use HAL
+ 843611 - suspend test should not use HAL
+ 843610 - pccard test should not use HAL
+
* Thu Aug 02 2012 Greg Nichols <gnichols(a)redhat.com>
V7 1.6.4 R0
843565 - v7 test planning should not use a generic device dictionary
+ 843616 - wlan test should not use HAL
* Fri Jun 01 2012 Greg Nichols <gnichols(a)redhat.com>
11 years, 8 months
r1365 - trunk/tests/pccard
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-23 19:03:41 +0000 (Thu, 23 Aug 2012)
New Revision: 1365
Removed:
trunk/tests/pccard/runtest.sh
Modified:
trunk/tests/pccard/Makefile
trunk/tests/pccard/pccard.py
trunk/tests/pccard/pccard.sh
Log:
843610 - pccard test should not use HAL
Modified: trunk/tests/pccard/Makefile
===================================================================
--- trunk/tests/pccard/Makefile 2012-08-23 18:57:26 UTC (rev 1364)
+++ trunk/tests/pccard/Makefile 2012-08-23 19:03:41 UTC (rev 1365)
@@ -18,16 +18,12 @@
FILES=runtest.sh pccard.sh
run: $(FILES) build
- ./runtest.sh
build: $(BUILT_FILES)
- chmod a+x ./runtest.sh ./pccard.sh
+ chmod a+x ./pccard.sh ./pccard.py
clean:
rm -f $(BUILT_FILES)
# Include Common Makefile
include $(DESTDIR)/usr/share/v7/lib/v7-make.include
-
-
-
Modified: trunk/tests/pccard/pccard.py
===================================================================
--- trunk/tests/pccard/pccard.py 2012-08-23 18:57:26 UTC (rev 1364)
+++ trunk/tests/pccard/pccard.py 2012-08-23 19:03:41 UTC (rev 1365)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
-# is made available to anyone wishing to use, modify, copy, or
-# redistribute it subject to the terms and conditions of the GNU General
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
-#
+#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -19,7 +19,7 @@
from v7.tags import DeviceClass, TestTag
from v7.command import Command, V7CommandException
-class PCCardTest(Test):
+class PCCardTest(Test):
def __init__(self):
Test.__init__(self, name="pccard")
@@ -30,10 +30,14 @@
def plan(self, planner):
- properties = dict()
- properties['pci.device_subclass'] = 7
- properties['pci.device_class'] = 6
- return self.planWith(planner.getHalDeviceDetector(), properties, all=False, strict=True)
+ tests = list()
+ devices = planner.getUdevDeviceDetector().getDevices()
+ for device in devices:
+ if device.getProperty("PCI_CLASS") == "60700":
+ test = self.makeCopy()
+ tests.append(test)
+
+ return tests
def run(self):
try:
@@ -50,7 +54,3 @@
test = PCCardTest()
returnValue = test.do(sys.argv)
sys.exit(returnValue)
-
-
-
-
Modified: trunk/tests/pccard/pccard.sh
===================================================================
--- trunk/tests/pccard/pccard.sh 2012-08-23 18:57:26 UTC (rev 1364)
+++ trunk/tests/pccard/pccard.sh 2012-08-23 19:03:41 UTC (rev 1365)
@@ -28,14 +28,14 @@
socket_test() {
SOCKET_COUNT=`get_socket_count`
if [ $SOCKET_COUNT == "0" ]; then
- echo "Error: no sockets to test"
+ echo "Error: no sockets to test"
return 1
fi
local socket=0
# Verify the sockets are occupied when we start
until [ $socket -ge $SOCKET_COUNT ]; do
- pccardctl ident $socket | grep -q "no product" &&
+ pccardctl ident $socket | grep -q "no product" &&
echo "Error: Unable to stat Socket $socket." &&
return 1
let ++socket
@@ -49,11 +49,9 @@
pccardctl ident $socket
let ++socket
done
-
+
return 0
}
-# run the test
+# run the test
socket_test
-
-
Deleted: trunk/tests/pccard/runtest.sh
===================================================================
--- trunk/tests/pccard/runtest.sh 2012-08-23 18:57:26 UTC (rev 1364)
+++ trunk/tests/pccard/runtest.sh 2012-08-23 19:03:41 UTC (rev 1365)
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-v7-run-simple-test ${TEST:-$(basename $PWD)} ./pccard.sh
11 years, 8 months
r1364 - trunk/tests/suspend
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-23 18:57:26 +0000 (Thu, 23 Aug 2012)
New Revision: 1364
Removed:
trunk/tests/suspend/runtest.sh
Modified:
trunk/tests/suspend/Makefile
trunk/tests/suspend/suspend.py
Log:
843611 - suspend test should not use HAL
Modified: trunk/tests/suspend/Makefile
===================================================================
--- trunk/tests/suspend/Makefile 2012-08-23 18:49:55 UTC (rev 1363)
+++ trunk/tests/suspend/Makefile 2012-08-23 18:57:26 UTC (rev 1364)
@@ -18,17 +18,12 @@
FILES=runtest.sh suspend.py
run: $(FILES) build
- ./runtest.sh
build: $(BUILT_FILES)
- chmod a+x ./runtest.sh ./suspend.py
+ chmod a+x ./suspend.py
clean:
rm -f *~ $(BUILT_FILES)
# Include Common Makefile
include $(DESTDIR)/usr/share/v7/lib/v7-make.include
-
-
-
-
Deleted: trunk/tests/suspend/runtest.sh
===================================================================
--- trunk/tests/suspend/runtest.sh 2012-08-23 18:49:55 UTC (rev 1363)
+++ trunk/tests/suspend/runtest.sh 2012-08-23 18:57:26 UTC (rev 1364)
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-v7-run-simple-test ${TEST:-$(basename $PWD)} ./suspend.py
Modified: trunk/tests/suspend/suspend.py
===================================================================
--- trunk/tests/suspend/suspend.py 2012-08-23 18:49:55 UTC (rev 1363)
+++ trunk/tests/suspend/suspend.py 2012-08-23 18:57:26 UTC (rev 1364)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
-# is made available to anyone wishing to use, modify, copy, or
-# redistribute it subject to the terms and conditions of the GNU General
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
-#
+#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -18,12 +18,11 @@
from v7.test import Test
from v7.tags import Constants, DeviceClass, TestTag
-from v7.hal import Hal
from v7.controller import Controller
from v7.redhatrelease import RedHatRelease
-class SuspendTest(Test):
-
+class SuspendTest(Test):
+
def __init__(self):
Test.__init__(self, name="suspend")
self.acpiListen = None
@@ -37,30 +36,28 @@
self.suspendMessage = dict()
self.suspendMessage[Constants.memory] = "Suspending computer because the suspend button has been pressed"
self.suspendMessage[Constants.disk] = "Hibernating computer because the hibernate button has been pressed"
-
+
def tags(self):
return [TestTag.interactive, TestTag.certification, TestTag.portable]
-
+
def plan(self, planner):
tests = list()
acAdapterDevice = None
- devices = planner.getHalDeviceDetector().getDevices()
+ devices = planner.getUdevDeviceDetector().getDevices()
for device in devices:
- if 'battery' in device.getProperty("info.category"):
+ if "power_supply" in device.getProperty("SUBSYSTEM") and "BAT" in device.getProperty("POWER_SUPPLY_NAME"):
test = self.makeCopy()
test.setDevice(device)
tests.append(test)
# 450297: suspend test planned once per battery
- # change to only plan this test once, no matter how many
+ # change to only plan this test once, no matter how many
# batteries are reported
break
return tests
-
-
+
def getRequiredRPMs(self):
return ["pm-utils"]
-
def getSuspendMethods(self):
sysPowerState = open("/sys/power/state", "r")
if sysPowerState:
@@ -79,7 +76,7 @@
# otherwise
print "Error: could not determine allowable suspend methods"
return None
-
+
def suspendWithOSCommand(self, method):
""" suspend via pm-suspend/pm-hibernate """
if method == Constants.memory:
@@ -87,27 +84,27 @@
return False
elif method == Constants.disk:
if not os.system("pm-hibernate") is 0:
- return False
+ return False
else:
print "Error: unknown suspend method %s" % method
return False
-
+
# otherwise
return True
-
+
def suspendWithOSCommand2(self, method):
""" suspend using a write operation to /sys/power/state """
# if not os.system("echo \"%s\" > /sys/power/state" % method) is 0:
sysPowerState = open("/sys/power/state", "w")
if sysPowerState:
-
- sysPowerState.write(method)
+
+ sysPowerState.write(method)
sysPowerState.close()
else:
print "Error: could not suspend the system"
return False
return True
-
+
def suspend(self, source, method):
print "This test will suspend the operating system."
print "Please resume by pressing the power button after suspend has completed."
@@ -118,7 +115,7 @@
# self.acpiListen = os.popen("acpi_listen")
markerName = "%s-%s-%s" % (self.Name(), source, method)
syslog.syslog(self.v7Controller.getSystemLogMarker(markerName, "begin"))
- if source == Constants.OSCommand:
+ if source == Constants.OSCommand:
if not self.promptConfirm(" suspend? "):
return False
waitTime = 5
@@ -126,27 +123,27 @@
sys.stdout.flush()
time.sleep(waitTime)
return self.suspendWithOSCommand(method)
-
+
# otherwise
- if source == Constants.FunctionKey:
+ if source == Constants.FunctionKey:
if not self.promptConfirm("Does this system have a function key (Fn) to suspend the system to %s?" % method):
print "Warning: suspend test to %s not run from function key" % method
return False
if not self.promptConfirm("Please press the function key (Fn) to suspend the system to %s " % method):
return False
return True
-
+
# otherwise
print "Error: unknown suspend source"
return False
-
+
def checkResume(self, source, method):
self.verifiedResumeMethod = None
sys.stdout.flush()
self.promptConfirm("Has resume completed? ")
markerName = "%s-%s-%s" % (self.Name(), source, method)
- syslog.syslog(self.v7Controller.getSystemLogMarker(markerName, "end"))
-
+ syslog.syslog(self.v7Controller.getSystemLogMarker(markerName, "end"))
+
#check system log for acpi messages
log = self.v7Controller.getSystemLog("%s-%s-%s" % (self.Name(), source, method))
@@ -171,7 +168,7 @@
if not resumeMessage in log:
print "Error: could not verify resume"
return False
-
+
# check that they used the correct method
self.verifiedResumeMethod = Constants.memory
methodMessage = re.compile("(swsusp|PM): Need to copy")
@@ -182,12 +179,12 @@
if method != self.verifiedResumeMethod:
print "Error: The suspend method was %s and should have been %s" % (self.verifiedResumeMethod, method)
return False
-
+
# otherwise
print "Verified resume from %s" % self.verifiedResumeMethod
return True
-
+
def runSuspendResume(self, source, method):
if self.suspend(source, method):
return self.checkResume(source, method)
@@ -197,20 +194,20 @@
return True
#otherwise
return False
-
-
+
+
def run(self):
FAILED = 1
PASSED = 0
-
+
if self.getMode() == Constants.auto:
print "Error: suspend test can not be run in auto mode."
return FAILED
-
+
methods = self.getSuspendMethods()
if not methods or len(methods) is 0:
return FAILED
-
+
# forced mode - being run as preparations for other tests
if self.getMode() == Constants.forced:
result = PASSED
@@ -219,7 +216,7 @@
elif self.verifiedResumeMethod != methods[0]:
result = FAILED
return result
-
+
# otherwise, full test
result = PASSED
for source in [Constants.OSCommand, Constants.FunctionKey]:
@@ -233,21 +230,12 @@
self.markSummary(Constants.FAIL)
else:
self.markSummary(Constants.PASS)
-
+
self.closeOutput()
- return result
-
+ return result
+
if __name__ == "__main__":
test = SuspendTest()
returnValue = test.do(sys.argv)
sys.exit(returnValue)
-
-
-
-
-
-
-
-
-
11 years, 8 months
r1363 - trunk/tests/infiniband
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-23 18:49:55 +0000 (Thu, 23 Aug 2012)
New Revision: 1363
Modified:
trunk/tests/infiniband/infiniband.py
Log:
843606 - infiniband test should not use HAL
Modified: trunk/tests/infiniband/infiniband.py
===================================================================
--- trunk/tests/infiniband/infiniband.py 2012-08-23 18:44:20 UTC (rev 1362)
+++ trunk/tests/infiniband/infiniband.py 2012-08-23 18:49:55 UTC (rev 1363)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (c) 2012 Red Hat, Inc. All rights reserved. This copyrighted material
-# is made available to anyone wishing to use, modify, copy, or
-# redistribute it subject to the terms and conditions of the GNU General
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
-#
+#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -20,11 +20,10 @@
from v7.test import Test, TestTag
from v7.command import Command, V7CommandException
-
FAILED = 1
PASSED = 0
-class InfinibandTest(Test):
+class InfinibandTest(Test):
def __init__(self):
Test.__init__(self, name="infiniband")
@@ -34,20 +33,15 @@
return [TestTag.noninteractive, TestTag.certification]
def plan(self, planner):
- properties = dict()
tests = list()
- # x060a bridge to IB
- properties['pci.device_class'] = 6
- properties['pci.device_subclass'] = 10
- tests = self.planWith(planner.getHalDeviceDetector(), properties, all=False, strict=True)
- if tests:
- return tests
- # otherwise
- # x0c06 IB serial controller
- properties['pci.device_class'] = 12
- properties['pci.device_subclass'] = 6
- return self.planWith(planner.getHalDeviceDetector(), properties, all=False, strict=True)
-
+ devices = planner.getUdevDeviceDetector().getDevices()
+ for device in devices:
+ # x060a bridge to IB or x0c06 IB serial controller
+ if device.getProperty("PCI_CLASS") == "60A00" or device.getProperty("PCI_CLASS") == "C0600":
+ test = self.makeCopy()
+ tests.append(test)
+
+ return tests
def getRequiredRPMs(self):
rpms = ["infiniband-diags"]
@@ -65,7 +59,7 @@
return False
- def run(self):
+ def run(self):
result = PASSED
if not self.runSubTest(self.logStatus, "Log Status", "log infiniband status"):
@@ -78,7 +72,3 @@
test = InfinibandTest()
returnValue = test.do(sys.argv)
sys.exit(returnValue)
-
-
-
-
11 years, 8 months
r1362 - in trunk: tests/tape v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-08-23 18:44:20 +0000 (Thu, 23 Aug 2012)
New Revision: 1362
Removed:
trunk/tests/tape/runtest.sh
Modified:
trunk/tests/tape/Makefile
trunk/tests/tape/tape.py
trunk/v7/udevDeviceDetector.py
Log:
843613 - tape test should not use HA
Modified: trunk/tests/tape/Makefile
===================================================================
--- trunk/tests/tape/Makefile 2012-08-23 18:28:23 UTC (rev 1361)
+++ trunk/tests/tape/Makefile 2012-08-23 18:44:20 UTC (rev 1362)
@@ -15,13 +15,12 @@
.PHONY: all install download clean
-FILES=runtest.sh tape.py
+FILES=tape.py
run: $(FILES) build
- ./runtest.sh
build: $(BUILT_FILES)
- chmod a+x ./runtest.sh ./tape.py
+ chmod a+x ./tape.py
clean:
@@ -30,6 +29,3 @@
# Include Common Makefile
include $(DESTDIR)/usr/share/v7/lib/v7-make.include
-
-
-
Deleted: trunk/tests/tape/runtest.sh
===================================================================
--- trunk/tests/tape/runtest.sh 2012-08-23 18:28:23 UTC (rev 1361)
+++ trunk/tests/tape/runtest.sh 2012-08-23 18:44:20 UTC (rev 1362)
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-v7-run-simple-test ${TEST:-$(basename $PWD)} ./tape.py
Modified: trunk/tests/tape/tape.py
===================================================================
--- trunk/tests/tape/tape.py 2012-08-23 18:28:23 UTC (rev 1361)
+++ trunk/tests/tape/tape.py 2012-08-23 18:44:20 UTC (rev 1362)
@@ -1,9 +1,9 @@
#!/usr/bin/python
-# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
-# is made available to anyone wishing to use, modify, copy, or
-# redistribute it subject to the terms and conditions of the GNU General
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
-#
+#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
@@ -20,95 +20,86 @@
import string
import sys
import commands
+import re
from v7.test import Test
from v7.command import Command, V7CommandException
-from v7.hal import Hal
from v7.tags import DeviceClass, TestTag
+from v7.udevDeviceDetector import UdevDeviceDetector
-class TapeTest(Test):
-
+class TapeTest(Test):
+
def __init__(self):
Test.__init__(self, name="tape")
self.deviceClass = DeviceClass.sequential
-
+
def tags(self):
return [TestTag.noninteractive, TestTag.certification]
-
+
def plan(self, planner):
tests = list()
- devices = planner.getHalDeviceDetector().getDevices()
+ devices = planner.getUdevDeviceDetector().getDevices()
for device in devices:
- if 'tape' in device.getProperty("storage.drive_type") == 7 or device.getProperty("info.linux.driver") == 'st' or device.getProperty("info.linux.driver")[0:4] == 'tape':
+ if 'tape' in device.getProperty("SUBSYSTEM") and re.compile("\/dev\/st\d+$").match(device.getProperty("DEVNAME")):
test = self.makeCopy()
test.setDevice(device)
tests.append(test)
return tests
-
+
def getRequiredRPMs(self):
return ["mt-st"]
def getTapeDeviceName(self):
-
+
if self.getLogicalDeviceName():
- return self.getLogicalDeviceName()
-
+ return self.getLogicalDeviceName()
+
#otherwise
if not self.udi:
print "Error: no UDI or logical device name for tape"
return None
-
+
#otherwise
print "Using UDI to find the correct device name ."
- # first, try linux.sysfs_path
try:
- hal = Hal()
- device = hal.getDevice(self.udi)
+ device = UdevDeviceDetector().getDevice(self.udi)
if device:
- sysfsPath = "%s/tape" % device.getProperty("linux.sysfs_path")
- # was: ls -l %s | rev | sed 's/\// /g' | awk '{print $1}' | rev
- return Command("ls -l %s" % sysfsPath).getString(regex="[^/]+$")
-
- # otherwise, find .device_file in child UDI
- for device in hal.getDevices():
- # removed "and "rtibm" in device.getUDI()" - this might work elsewhere
- if self.udi in device.getProperty("info.parent") :
- return device.getProperty("linux.device_file")[5:]
-
+ return device.getProperty("DEVNAME")
+
except V7CommandException, exception:
print "Error: could not determine tape device name"
print exception
return None
-
-
+
+
def run(self):
tapeDevice = self.getTapeDeviceName()
if not tapeDevice:
return 1
-
+
print "Testing tape device %s" % tapeDevice
-
+
# set default block size to 32k (64 x 512byte = 32k)
bs=64
- # rewind the tape incase the tape is not rewinded.
- os.system("mt -f /dev/%s rewind 2>/dev/null" % tapeDevice)
- if os.system("tar -Pcb %s -f /dev/%s /usr" % (bs,tapeDevice)) is 0:
- print "Write data done. Start comparing ..."
- if os.system("tar -Pdb %s -f /dev/%s /usr" % (bs,tapeDevice)) is 0:
- print "Tape test on device %s passed." % tapeDevice
- return 0
+ try:
+ # rewind the tape incase the tape is not rewinded.
+ Command("mt -f %s rewind 2>/dev/null" % tapeDevice).run()
+ if Command("tar -Pcb %s -f %s /usr" % (bs, tapeDevice)).echo() is 0:
+ print "Write data done. Start comparing ..."
+ if Command("tar -Pdb %s -f %s /usr" % (bs, tapeDevice)).echo() is 0:
+ print "Tape test on device %s passed." % tapeDevice
+ return 0
+ else:
+ print "Error: Data comparison failed !"
+ return 1
else:
- print "Error: Data comparison failed !"
+ print "Error: Write data Error !"
return 1
- else:
- print "Error: Write data Error !"
+ except V7CommandException, exception:
+ print exception
return 1
if __name__ == "__main__":
test = TapeTest()
returnValue = test.do(sys.argv)
sys.exit(returnValue)
-
-
-
-
Modified: trunk/v7/udevDeviceDetector.py
===================================================================
--- trunk/v7/udevDeviceDetector.py 2012-08-23 18:28:23 UTC (rev 1361)
+++ trunk/v7/udevDeviceDetector.py 2012-08-23 18:44:20 UTC (rev 1362)
@@ -10,7 +10,7 @@
from v7.deviceDetector import DeviceDetector
from v7.tags import Constants
from v7.documentbase import DocumentWrapper
-from v7.command import Command
+from v7.command import Command, V7CommandException
class UdevDeviceDetector(DeviceDetector):
"A class for working with udev."
@@ -19,15 +19,14 @@
self.enabled = True
self.recordSeperator = "\n"
self.allDevicesCommand = "udevadm info --export-db"
- self.getDeviceCommand = "udevadm info --query=all --path %s"
-
- def getDevice(self,udi):
+ self.getDeviceCommand = "udevadm info --query=all --path %s"
+
+ def getDevice(self, udi):
"Return a Device object for the given UDI."
properties = None
try:
udevadm = Command(self.getDeviceCommand % udi)
- record = udevadm.getString(singleLine=False)
- lines = record.split("\n")
+ lines = udevadm.getStringList(regex=".*")
stringNumber=0
properties = dict()
for line in lines:
@@ -36,12 +35,12 @@
print "Error: could not find udev device %s" % udi
print e
return None
-
+
if properties:
return UdevDevice(properties)
# otherwise
return None
-
+
def __getProperty(self, line, properties, stringNumber):
docWrapper = DocumentWrapper()
line = docWrapper.removeBadCharacters(line)
@@ -59,16 +58,16 @@
stringNumber += 1
elif type == "P":
properties[Constants.info_dot_udi] = attribute
-
+
return stringNumber
-
- def getDevices(self):
+
+ def getDevices(self):
self.devices = list()
try:
pipe = Command(self.allDevicesCommand)
pipe.start()
properties = dict()
- stringNumber = 0
+ stringNumber = 0
while 1:
line = pipe.readline()
if line:
@@ -86,7 +85,7 @@
break
except Exception, e:
if self.debug != Constants.off:
- print "Warning: udev device detector could not load devices"
+ print "Warning: udev device detector could not load devices"
print e
pass
return self.devices
11 years, 8 months