Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 600568 Details for
Bug 843565
v7 test planning should not use a generic device dictionary
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch revising test planning by removel of generic device list
bz843565-on-1.6.4-0.patch (text/plain), 43.32 KB, created by
Greg Nichols
on 2012-07-26 17:56:24 UTC
(
hide
)
Description:
patch revising test planning by removel of generic device list
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2012-07-26 17:56:24 UTC
Size:
43.32 KB
patch
obsolete
>Index: v7/deviceclassdocument.py >=================================================================== >--- v7/deviceclassdocument.py (revision 1160) >+++ v7/deviceclassdocument.py (working copy) >@@ -174,8 +174,6 @@ > and ('processor' in device.getProperty("info.category") > or device.getProperty("info.product") == "Computer")): > return True >- if (device.getSource() == Constants.kudzu and device.getProperty("class") == "CPU"): >- return True > if (device.getSource() == Constants.udev and device.getProperty("DRIVER") == "processor"): > return True > return False >@@ -255,9 +253,7 @@ > # pick up the controller(s) - 1 is Mass Storage > or device.getProperty("pci.device_class") == PCIDeviceClass.massStorage)): > return True >- if (device.getSource() == Constants.kudzu >- and device.getPropertyString("class") in ["HD", "IDE", "SCSI", "RAID"]): >- return True >+ > if (device.getSource() == Constants.udev > and device.getProperty("MAJOR") in [DeviceNumberMajor.scsiBlock, DeviceNumberMajor.ideBlock]): > return True >@@ -276,8 +272,6 @@ > def hasDevice(self, device): > if device.getSource() == Constants.hal and 'storage.cdrom' in device.getProperty("info.capabilities"): > return True >- if device.getSource() == Constants.kudzu and 'CDROM' in device.getProperty("class"): >- return True > if (device.getSource() == Constants.udev > and (device.getProperty("DEVTYPE") == 'disk' and device.getProperty("ID_CDROM") == "1")): > return True >@@ -321,8 +315,6 @@ > def hasDevice(self, device): > if device.getSource() == Constants.hal and "net" in device.getProperty("info.capabilities"): > return True >- if device.getSource() == Constants.kudzu and device.getProperty("class").lower() == "network": >- return True > if device.getSource() == Constants.udev and device.getProperty("INTERFACE") != "": > return True > return False >Index: v7/planner.py >=================================================================== >--- v7/planner.py (revision 1251) >+++ v7/planner.py (working copy) >@@ -25,7 +25,6 @@ > from v7.opticalDiskTest import OpticalDiskTest > from v7.fvtest import FvTest > from v7.hal import Hal >-from v7.v7kudzu import Kudzu > from v7.udevDeviceDetector import UdevDeviceDetector > from v7.procDeviceDetector import ProcDeviceDetector > from v7.udisksDeviceDetector import UDisksDeviceDetector >@@ -47,6 +46,27 @@ > self.virtualization = virtualization > self.plannedTests = list() > self.redHatRelease = redHatRelease >+ self.__initializeDeviceDetectors() >+ >+ def __initializeDeviceDetectors(self): >+ self.deviceDetectors = dict() >+ detector = Hal() >+ self.deviceDetectors[detector.getName()] = detector >+ detector = UdevDeviceDetector() >+ self.deviceDetectors[detector.getName()] = detector >+ detector = ProcDeviceDetector() >+ self.deviceDetectors[detector.getName()] = detector >+ detector = UDisksDeviceDetector() >+ self.deviceDetectors[detector.getName()] = detector >+ >+ def getHalDeviceDetector(self): >+ return self.deviceDetectors[Constants.hal] >+ def getUdevDeviceDetector(self): >+ return self.deviceDetectors[Constants.udev] >+ def getProcDeviceDetector(self): >+ return self.deviceDetectors[Constants.proc] >+ def getUDisksDeviceDetector(self): >+ return self.deviceDetectors[Constants.udisks] > > def analyse(self, testDirectory): > """Walk through the test directory looking for v7.Test classes""" >@@ -91,13 +111,13 @@ > if self.Debugging: > print "...Done." > >- def __plan(self, devices): >+ def __plan(self): > tests = list() > > for test in self.deviceTests: > if self.Debugging: print "Planning test %s" % test.Name() > >- someTests = test.plan(self.devices) >+ someTests = test.plan(self) > if someTests: > if self.Debugging: print " planned %u tests" % len(someTests) > tests.extend(someTests) >@@ -112,8 +132,7 @@ > return tests > > def plan(self): >- self.__loadDevices() >- self.plannedTests = self.__plan(self.devices) >+ self.plannedTests = self.__plan() > return self.plannedTests > > def __loadDevices(self): >@@ -123,13 +142,8 @@ > self.devices.extend(udev.getDevices()) > proc = ProcDeviceDetector() > self.devices.extend(proc.getDevices()) >- if not hal.enabled: >- kudzu = Kudzu() >- self.devices.extend(kudzu.getDevices()) >- # run udisks only on RHEL 6 and beyond >- if not "Red Hat Enterprise Linux" in self.redHatRelease.getProduct() or self.redHatRelease.getVersion() > 5: >- udisks = UDisksDeviceDetector() >- self.devices.extend(udisks.getDevices()) >+ udisks = UDisksDeviceDetector() >+ self.devices.extend(udisks.getDevices()) > > def getTestsFor(self, device): > devices = list() >Index: v7/device.py >=================================================================== >--- v7/device.py (revision 1187) >+++ v7/device.py (working copy) >@@ -118,31 +118,7 @@ > #otherwise > return "" > >- >-class KudzuDevice(Device): >- def __init__(self, properties=None): >- Device.__init__(self, None, properties=properties) >- self.udi = self.getProperty("udi") >- >- def getSource(self): >- return Constants.kudzu > >- def getProduct(self): >- return "" >- >- def write(self, file): >- separator = " : " >- quote = "\'" >- file.write("\'class\' : \'%s\'\n" % self.getClass()) >- keys = self.properties.keys() >- keys.sort() >- for key in keys: >- file.write(" %s%s%s%s" % (quote, key, quote, separator)) >- if self.properties[key]: >- file.write("%s%s%s" % (quote, self.properties[key], quote)) >- file.write("\n") >- file.write("\n\n") >- > class ProcDevice(Device): > def __init__(self, properties=None): > Device.__init__(self, 'SerialNumber', properties) >Index: v7/v7kudzu.py >=================================================================== >--- v7/v7kudzu.py (revision 953) >+++ v7/v7kudzu.py (working copy) >@@ -1,111 +0,0 @@ >-#!/usr/bin/python >-# >-# Author: Greg Nichols >- >-import os >- >-from v7.device import KudzuDevice >-from v7.deviceDetector import DeviceDetector >-from v7.tags import Constants >-from v7.certificationtest import DocumentWrapper >- >-class Kudzu(DeviceDetector): >- "A class for working with Kudzu." >- >- classNetwork = "NETWORK" >- >- def __init__(self): >- DeviceDetector.__init__(self, name=Constants.kudzu) >- self.devices = None >- >- def isValid(self): >- self.getDevices() >- return self.devices and len(self.devices) > 0 >- >- >- def getDevices(self): >- if self.devices is not None: >- return self.devices >- # otherwise >- self.devices = list() >- if os.path.exists("/usr/share/rhn/up2date_client/hardware.py"): >- self.__getDevices("python /usr/share/rhn/up2date_client/hardware.py", "\n") >- else: >- print "Warning: no command /usr/share/rhn/up2date_client/hardware.py" >- >- self.__getDevices("kudzu -p", "-\n") >- return self.devices >- >- def __getDevices(self, command, recordSeparator): >- self.hardwareCommand = command >- self.recordSeparator = recordSeparator >- pipe = os.popen(self.hardwareCommand) >- >- properties = dict() >- docWrapper = DocumentWrapper() >- while 1: >- line = pipe.readline() >- if line: >- if line == self.recordSeparator: >- if len(properties) > 0: >- self.devices.append(KudzuDevice(properties)) >- properties = dict() >- else: >- line = docWrapper.removeBadCharacters(line) >- keyvalue = line.split(":", 1) >- if len(keyvalue) is 2: >- # strip leading and trailing spaces, single quotes, and newlines. >- key = keyvalue[0].strip('\ \'\n') >- value = keyvalue[1].strip('\ \'\n') >- properties[key] = value >- else: >- break >- >- pipe.close() >- >- return self.devices >- >- def getDevice(self, udi): >- for device in self.getDevices(): >- if device.getProperty("udi") == udi: >- return KudzuDevice(device) >- return None >- >- def dump(self): >- for device in self.getDevices(): >- print device.getProperties() >- >- def dumpDevice(self, className=None, busName=None, logicalDeviceName=None): >- output = "" >- if not className and not busName and not logicalDeviceName: >- return "" >- >- for device in self.devices: >- if logicalDeviceName: >- if device.hasPropertyValue(logicalDeviceName): >- output += device.dump() >- if className: >- if device.getClass() == className: >- output += device.dump() >- if busName: >- if device.getBus() == busName: >- output += device.dump() >- return output >- >- def getProduct(self, device): >- return device.getProperty("desc") >- >- def getPCIBusAndID(self, device): >- """rely on Kudzu to check PCI info""" >- try: >- domAndBus = "%s:%s" % (device.getProperty('pcidom'), device.getProperty('pcibus')) >- devAndFn = "%s.%s" % (device.getProperty('pcidev'), device.getProperty('pcifn')) >- deviceID = "%s:%s" % (domAndBus, devAndFn) >- return (domAndBus, devAndFn, deviceID) >- except: >- pass >- return None >- >-if __name__ == "__main__": >- kudzu=Kudzu() >- print kudzu.dump() >Index: v7/test.py >=================================================================== >--- v7/test.py (revision 1160) >+++ v7/test.py (working copy) >@@ -47,7 +47,7 @@ > self.deviceClass = None > self.logicalDeviceName = "" > self.mandatory = None # either pre or post for mandatory tests (for each run) >- self.source = None # either hal, kudzu, or manual >+ self.source = None # either hal, udev, udisks, etc, or manual > self.marking = False # is <output> sub-section currently active? > > >@@ -224,7 +224,7 @@ > def install(self): > pass > >- def plan(self, devices): >+ def plan(self, planner): > """ returns a list of test instances for the input list of > device objects (v7.device) > This default implementation plans the test once, independant of device """ >@@ -232,11 +232,12 @@ > tests.append(self.makeCopy()) > return tests > >- def planWith(self, devices, properties, all=True, strict=False): >+ def planWith(self, detector, properties, all=True, strict=False): > """ Plan for devices matching any property. > if all is true, multiple devices that match will be planned > if strict is true, all properties must match. """ > tests = list() >+ devices = detector.getDevices() > for device in devices: > match = False > for key in properties.keys(): >Index: v7/tags.py >=================================================================== >--- v7/tags.py (revision 1216) >+++ v7/tags.py (working copy) >@@ -33,7 +33,6 @@ > test="test" > hal="hal" > udisks="udisks" >- kudzu="kudzu" > system="system" > output="output" > summary="summary" >@@ -146,7 +145,6 @@ > ALL = "ALL" > hal = "hal" > udisks="udisks" >- kudzu = "kudzu" > proc = "proc" > user = "user" > DEVICE = "DEVICE" >Index: v7/opticalDiskTest.py >=================================================================== >--- v7/opticalDiskTest.py (revision 1309) >+++ v7/opticalDiskTest.py (working copy) >@@ -32,7 +32,6 @@ > from v7.hal import Hal > from v7.device import Device > from v7.command import Command, V7CommandException >-from v7.v7kudzu import Kudzu > from v7.redhatrelease import RedHatRelease > > class OpticalDiskTest(Test): >@@ -43,9 +42,6 @@ > self.supportedMedia = None > self.deviceClass = "CDROM" > self.deviceDetector = Hal() >- devices = self.deviceDetector.getDevices() >- if len(devices) is 0: >- self.deviceDetector = Kudzu() > > def hasAnyCDROMType(self, device): > for type in self.mediaTypes: >@@ -67,8 +63,9 @@ > return disk > return None > >- def plan(self, devices): >+ def plan(self, planner): > tests = dict() >+ devices = planner.getHalDeviceDetector().getDevices() > for device in devices: > disk = None > if 'storage.cdrom' in device.getProperty("info.capabilities") and self.hasAnyCDROMType(device): >Index: v7/fvtest.py >=================================================================== >--- v7/fvtest.py (revision 1336) >+++ v7/fvtest.py (working copy) >@@ -169,7 +169,7 @@ > self.__setUpHypervisor() > > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > osSupport = False > # if Red Hat and not RT kernel >Index: v7/udisksDeviceDetector.py >=================================================================== >--- v7/udisksDeviceDetector.py (revision 1248) >+++ v7/udisksDeviceDetector.py (working copy) >@@ -29,7 +29,7 @@ > class UDisksDeviceDetector(DeviceDetector): > def __init__(self): > DeviceDetector.__init__(self, name=Constants.udisks) >- self.debugging = True >+ self.debugging = False > self.rootObject ='org.freedesktop.UDisks' > self.rootPath = '/org/freedesktop/UDisks' > self.interface = None >Index: v7/deviceDetector.py >=================================================================== >--- v7/deviceDetector.py (revision 1160) >+++ v7/deviceDetector.py (working copy) >@@ -14,7 +14,7 @@ > # Author: Greg Nichols > # > # DeviceDetector is an abstract base class for classes using various >-# means to detect hardware devices, such as HAL, Kudzu, or the /proc filesystem. >+# means to detect hardware devices, such as HAL, or the /proc filesystem. > import string, os, sys, copy > > >Index: v7/hardwaretest.py >=================================================================== >--- v7/hardwaretest.py (revision 1333) >+++ v7/hardwaretest.py (working copy) >@@ -39,7 +39,6 @@ > from v7.planner import Planner > import v7.version > from v7.hal import Hal >-from v7.v7kudzu import Kudzu > from v7.device import Device, HalDevice > from v7.command import Command, V7CommandException > from v7.resultsengine import ResultsEngine >@@ -833,17 +832,7 @@ > except dbus_bindings.DBusException, e: > print "Test error: %s" % e > syslog.syslog("Test error: %s" % e) >- success = False >- >- # use Kudzu for old rhr's hardware.out >- if self.redHatRelease.getVersion() <= 6: >- if self.debugLevel != Constants.off: >- print "Getting devices from kudzu" >- kudzu = Kudzu() >- if not kudzu.isValid(): >- success = False >- else: >- run.appendDevices(deviceClass.getDevicesFromDetector(kudzu)) >+ success = False > > return success > >Index: v7/documentbase.py >=================================================================== >--- v7/documentbase.py (revision 1344) >+++ v7/documentbase.py (working copy) >@@ -20,7 +20,7 @@ > import xml.dom.ext > from tags import Tags, Attributes, Constants > import version >-from device import Device, HalDevice, ProcDevice, KudzuDevice, UdevDevice >+from device import Device, HalDevice, ProcDevice, UdevDevice > from command import Command, V7CommandException > > class DocumentWrapper: >@@ -191,8 +191,6 @@ > return ProcDevice(properties) > elif source == Constants.udev: > return UdevDevice(properties) >- elif source == Constants.kudzu: >- return KudzuDevice(properties) > > # should never, ever get here! > print "Error: unknown device source %s" % source >Index: v7/certificationtest.py >=================================================================== >--- v7/certificationtest.py (revision 1290) >+++ v7/certificationtest.py (working copy) >@@ -197,10 +197,7 @@ > > def appendDevice(self, device): > for name in self.deviceClasses: >- if self.deviceClasses[name].registerDevice(device): >- print "%s registered device %s" % (name, device.getUDI()) >- pass >- >+ self.deviceClasses[name].registerDevice(device) > > > def appendTest(self, test): >Index: tools/beaker/xen-reserve-x86_64.xml >=================================================================== >--- tools/beaker/xen-reserve-x86_64.xml (revision 0) >+++ tools/beaker/xen-reserve-x86_64.xml (working copy) >@@ -0,0 +1,50 @@ >+<job retention_tag="scratch"> >+ <whiteboard> >+ v7 xen virtualization reserve - RHEL5 x86_64 >+ </whiteboard> >+ <recipeSet priority="Normal"> >+ <recipe kernel_options="" kernel_options_post="" ks_meta="method=nfs" role="None" whiteboard="xen"> >+ <autopick random="false"/> >+ <watchdog panic="None"/> >+ <packages/> >+ <ks_appends/> >+ <repos> >+ <repo name="v7" url="http://qafiler.bos.redhat.com/testkits/V7/RHEL5"/> >+ </repos> >+ <distroRequires> >+ <and> >+ <distro_name op="=" value="RHEL5-Server-U8"/> >+ <distro_method op="=" value="nfs"/> >+ <distro_variant op="=" value=""/> >+ <distro_arch op="=" value="x86_64"/> >+ </and> >+ <distro_virt op="=" value=""/> >+ </distroRequires> >+ <hostRequires> >+ <and> >+ <arch op="=" value="x86_64"/> >+ <key_value key="HVM" op="=" value="1"/> >+ <memory op=">=" value="2048"/> >+ </and> >+ <system_type value="Machine"/> >+ </hostRequires> >+ <partitions/> >+ <task name="/distribution/install" role="STANDALONE"> >+ <params/> >+ </task> >+ <task name="/distribution/kernelinstall" role="STANDALONE"> >+ <params> >+ <param name="KERNELARGNAME" value="kernel"/> >+ <param name="KERNELARGVERSION" value="2.6.18-304.el5"/> >+ <param name="KERNELARGVARIANT" value="xen"/> >+ </params> >+ </task> >+ <task name="/distribution/reservesys" role="STANDALONE"> >+ <params> >+ <param name="RESERVEBY" value="gnichols@redhat.com"/> >+ <param name="RESERVETIME" value="86400"/> >+ </params> >+ </task> >+ </recipe> >+ </recipeSet> >+</job> >Index: tools/fv-guest/fv-domU-readme.txt >=================================================================== >--- tools/fv-guest/fv-domU-readme.txt (revision 1295) >+++ tools/fv-guest/fv-domU-readme.txt (working copy) >@@ -49,8 +49,8 @@ > > 7) On a xen system, use virt-install to create the image: > >- service start xend >- service start libvirtd >+ service xend start >+ service libvirtd start > virt-install --hvm --name=v7i386 --ram=512 --vcpus=1 --network=bridge:xenbr0 --vnc --file=/var/lib/xen/images/v7i386.img --file-size=6 --cdrom /var/lib/xen/images/boot.iso > > 8) add the v7-dependant packages: dt/lmbench/stress >Index: tests/usb/usb.py >=================================================================== >--- tests/usb/usb.py (revision 1021) >+++ tests/usb/usb.py (working copy) >@@ -53,10 +53,11 @@ > self.requires = "" > > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > isXenGuest = False > hasUSB = False >+ devices = planner.getHalDeviceDetector().getDevices() > # run if there's a device with info.product == usb and it's not a Xen guest. > for device in devices: > if device.getProperty("info.product") == "Computer" and device.getProperty("smbios.bios.vendor") == "Xen": >Index: tests/reboot/reboot.py >=================================================================== >--- tests/reboot/reboot.py (revision 1345) >+++ tests/reboot/reboot.py (working copy) >@@ -42,7 +42,7 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > # manual planning only > return tests >Index: tests/infiniband/infiniband.py >=================================================================== >--- tests/infiniband/infiniband.py (revision 1257) >+++ tests/infiniband/infiniband.py (working copy) >@@ -33,20 +33,20 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ 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(devices, properties, all=False, strict=True) >+ 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(devices, properties, all=False, strict=True) >+ return self.planWith(planner.getHalDeviceDetector(), properties, all=False, strict=True) > > > def getRequiredRPMs(self): >Index: tests/hwlatdetect/v7_hwlatdetect.py >=================================================================== >--- tests/hwlatdetect/v7_hwlatdetect.py (revision 953) >+++ tests/hwlatdetect/v7_hwlatdetect.py (working copy) >@@ -70,7 +70,7 @@ > print "Could not open /sys/class/dmi/id/%s ... are you running the right kernel?" % name > return None > >- def plan(self, devices): >+ def plan(self, planner): > ret = list() > if not self.realtime: > return ret >Index: tests/kdump/kdump.py >=================================================================== >--- tests/kdump/kdump.py (revision 1301) >+++ tests/kdump/kdump.py (working copy) >@@ -53,7 +53,7 @@ > > return rpms > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > # plan kdump twice: once on storage (local disk) and once over network > for dumpMethod in [Constants.nfs, Constants.local]: >Index: tests/profiler/profiler.py >=================================================================== >--- tests/profiler/profiler.py (revision 1148) >+++ tests/profiler/profiler.py (working copy) >@@ -30,7 +30,7 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > > tests = list() > # don't run on FV or PV >Index: tests/info/runtest.sh >=================================================================== >--- tests/info/runtest.sh (revision 953) >+++ tests/info/runtest.sh (working copy) >@@ -1,3 +0,0 @@ >-#!/bin/bash >- >-v7-run-simple-test info ./info.py >Index: tests/rteval/v7_rteval.py >=================================================================== >--- tests/rteval/v7_rteval.py (revision 984) >+++ tests/rteval/v7_rteval.py (working copy) >@@ -61,7 +61,7 @@ > return None > > >- def plan(self, devices): >+ def plan(self, planner): > ret = list() > if not self.realtime: > return ret >Index: tests/audio/audio.py >=================================================================== >--- tests/audio/audio.py (revision 1228) >+++ tests/audio/audio.py (working copy) >@@ -26,14 +26,11 @@ > Test.__init__(self, name="audio") > self.deviceClass = DeviceClass.audio > >- def plan(self, devices): >+ def plan(self, planner): > properties = dict() > properties['alsa.pcm_class'] = 'generic' > properties['alsa.type'] = 'playback' >- tests = self.planWith(devices, properties, all=False) >- properties = dict() >- properties['class'] = 'AUDIO' >- tests.extend(self.planWith(devices, properties, all=False)) >+ tests = self.planWith(planner.getHalDeviceDetector(), properties, all=False) > return tests > > def getRequiredRPMs(self): >Index: tests/storage/storage.py >=================================================================== >--- tests/storage/storage.py (revision 1339) >+++ tests/storage/storage.py (working copy) >@@ -43,81 +43,73 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > tests = dict() > self.controllers = '' >+ self.planUDisks(planner, tests) >+ self.planHAL(planner, tests) >+ >+ >+ return tests.values() >+ >+ def planUDisks(self, planner, tests): >+ >+ devices = planner.getUDisksDeviceDetector().getDevices() > for device in devices: >- disk = self.planUDisks(device, devices) >- >- if not disk: >- disk = self.planHAL(device, devices) >- >- if not disk: >- disk = self.planKudzu(device) >- >- >+ disk = None >+ if isinstance(device, UDisksDrive): >+ if device.getProperty("DeviceIsPartitionTable"): >+ disk = device.getProperty("DeviceFile") >+ # get rid of the "/dev/" >+ if '/'in disk: >+ disk = disk.split('/')[-1] > if disk and not disk in tests: > test = self.makeCopy() > test.setDevice(device) > test.setLogicalDeviceName(disk) > tests[disk] = test >- return tests.values() >- >- def planUDisks(self, device, devices): >- disk = None >- if isinstance(device, UDisksDrive): >- if device.getProperty("DeviceIsPartitionTable"): >- disk = device.getProperty("DeviceFile") >- # get rid of the "/dev/" >- if '/'in disk: >- disk = disk.split('/')[-1] >- return disk >- >- def planHAL(self, device, devices): >- disk = None >- if 'storage' in device.getProperty("info.capabilities") and device.getProperty("storage.drive_type") in ["disk", "sd_mmc"]: >- disk = device.getProperty("block.device") >- # bug#437866 , plan by each controller, block device's parent is the HD, HD's parent is the controller, so need to track back twice >- # what's the HD's ID ? >- blockDeviceParent = device.getProperty("info.parent") >- # and what's the HD's parent's ID ? >- controllerId = 'none' >- for deviceItem in devices: >- if blockDeviceParent in deviceItem.getProperty("info.udi"): >- # then the contoller's ID is found >- controllerId = deviceItem.getProperty("info.parent") >- continue >- if controllerId in self.controllers: >- print "the controller %s is already in testplan, will skip the block device %s" % (controllerId, disk) >- disk = '' >- else: >- # add the controller to the plan and record it >- self.controllers = self.controllers + ', ' + controllerId >- # chop off /dev/ (5 characters) >- if disk and len(disk) > 5: >- disk = disk[5:] >- # handle cciss devices >- elif device.getProperty("info.linux.driver") == "cciss": >- sysfsPath = device.getProperty("pci.linux.sysfs_path") >- # grep for the block device name, if one cciss controller has >- # multiple "drives" attached, we pick only one(the first one) to test >- storageDevice = commands.getoutput("ls %s | grep block | head -n 1 | colrm 1 12" % sysfsPath) >- disk = 'cciss/' + storageDevice > >- return disk >+ > >- def planKudzu(self, device): >+ def planHAL(self, planner, tests): > disk = None >- if "HD" in device.getPropertyString("class"): >- if "SERVERAID" in device.getProperty("desc"): >- disk = device.getProperty("device") >- elif "cciss" in device.getProperty("device"): >- disk = device.getProperty("device") # the value should be something like 'cciss/c0d0' etc. >- else: >- disk = device.getProperty("device") >+ devices = planner.getHalDeviceDetector().getDevices() >+ for device in devices: >+ disk = None >+ if 'storage' in device.getProperty("info.capabilities") and device.getProperty("storage.drive_type") in ["disk", "sd_mmc"]: >+ disk = device.getProperty("block.device") >+ # bug#437866 , plan by each controller, block device's parent is the HD, HD's parent is the controller, so need to track back twice >+ # what's the HD's ID ? >+ blockDeviceParent = device.getProperty("info.parent") >+ # and what's the HD's parent's ID ? >+ controllerId = 'none' >+ for deviceItem in devices: >+ if blockDeviceParent in deviceItem.getProperty("info.udi"): >+ # then the contoller's ID is found >+ controllerId = deviceItem.getProperty("info.parent") >+ continue >+ if controllerId in self.controllers: >+ print "the controller %s is already in testplan, will skip the block device %s" % (controllerId, disk) >+ disk = '' >+ else: >+ # add the controller to the plan and record it >+ self.controllers = self.controllers + ', ' + controllerId >+ # chop off /dev/ (5 characters) >+ if disk and len(disk) > 5: >+ disk = disk[5:] >+ # handle cciss devices >+ elif device.getProperty("info.linux.driver") == "cciss": >+ sysfsPath = device.getProperty("pci.linux.sysfs_path") >+ # grep for the block device name, if one cciss controller has >+ # multiple "drives" attached, we pick only one(the first one) to test >+ storageDevice = commands.getoutput("ls %s | grep block | head -n 1 | colrm 1 12" % sysfsPath) >+ disk = 'cciss/' + storageDevice >+ >+ if disk and not disk in tests: >+ test = self.makeCopy() >+ test.setDevice(device) >+ test.setLogicalDeviceName(disk) > >- return disk >- > > def doDt(self, minBs, maxBs, size, options): > """Helper function: run dt with various block sizes and reasonable defaults.""" >Index: tests/video/video.py >=================================================================== >--- tests/video/video.py (revision 1256) >+++ tests/video/video.py (working copy) >@@ -59,16 +59,12 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > # HAL discovery > properties = dict() > properties["pci.device_subclass"] = 0 > properties["pci.device_class"] = 3 >- tests = self.planWith(devices, properties, all=False, strict=True) >- # Kudzu Discovery >- properties = dict() >- properties["class"] = "VIDEO" >- tests.extend(self.planWith(devices, properties, all=False, strict=True)) >+ tests = self.planWith(planner.getHalDeviceDetector(), properties, all=False, strict=True) > return tests > > def getRequiredRPMs(self): >Index: tests/fencing/fencing.py >=================================================================== >--- tests/fencing/fencing.py (revision 1183) >+++ tests/fencing/fencing.py (working copy) >@@ -41,7 +41,7 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > # manual planning only, for now > # tests.append(self.makeCopy()) >Index: tests/battery/battery.py >=================================================================== >--- tests/battery/battery.py (revision 995) >+++ tests/battery/battery.py (working copy) >@@ -35,9 +35,10 @@ > def getACAdapterDevice(self): > return self.acAdapterDevice > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > acAdapterDevice = None >+ devices = planner.getHalDeviceDetector().getDevices() > for device in devices: > if 'battery' in device.getProperty("info.category") and device.getProperty("battery.present"): > test = self.makeCopy() >Index: tests/tape/tape.py >=================================================================== >--- tests/tape/tape.py (revision 995) >+++ tests/tape/tape.py (working copy) >@@ -35,8 +35,9 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() >+ devices = planner.getHalDeviceDetector().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': > test = self.makeCopy() >Index: tests/wlan/wlan.py >=================================================================== >--- tests/wlan/wlan.py (revision 953) >+++ tests/wlan/wlan.py (working copy) >@@ -26,7 +26,6 @@ > from v7.tags import Constants, DeviceClass > from v7.hal import Hal > from v7.test import Test, TestTag >-from v7.v7kudzu import Kudzu > from v7.command import Command, V7CommandException > from v7.environment import Environment > >@@ -44,14 +43,13 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > tests = dict() >+ devices = planner.getHalDeviceDetector().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') >- elif device.getProperty("class") == Kudzu.classNetwork: >- logicalDevice = device.getProperty('device') > > """ if network logical device was found, and not already planned, > and it's not in the ignore list, add it""" >Index: tests/cpuscaling/aperfmperf.py >=================================================================== >--- tests/cpuscaling/aperfmperf.py (revision 1063) >+++ tests/cpuscaling/aperfmperf.py (working copy) >@@ -14,9 +14,9 @@ > # > > import struct >- > >- >+ >+ > class EffectiveFrequency: > """ > Simple mechanism to use the Effective Frequency Interface >Index: tests/cpuscaling/cpuscaling.py >=================================================================== >--- tests/cpuscaling/cpuscaling.py (revision 1324) >+++ tests/cpuscaling/cpuscaling.py (working copy) >@@ -209,7 +209,7 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > # check the /sys file system to see if scaling looks possible > self.getCPUFreqDirectories() > cpuScalingSupported = False >Index: tests/network/network.py >=================================================================== >--- tests/network/network.py (revision 1253) >+++ tests/network/network.py (working copy) >@@ -27,7 +27,6 @@ > from v7.tags import Constants, DeviceClass > from v7.hal import Hal > from v7.test import Test, TestTag >-from v7.v7kudzu import Kudzu > from v7.command import Command, V7CommandException > from v7.environment import Environment > from v7.hash import hashModule >@@ -67,14 +66,13 @@ > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >- def plan(self, devices): >+ def plan(self, planner): > tests = dict() >+ devices = planner.getHalDeviceDetector().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') >- elif device.getProperty("class") == Kudzu.classNetwork: >- logicalDevice = device.getProperty('device') > > """ if network logical device was found, and not already planned, > and it's not in the ignore list, add it""" >@@ -753,15 +751,7 @@ > except V7CommandException: > print "Warning: could not determine MAC address" > >- try: >- kudzu = Command("kudzu -p -c NETWORK ") >- kudzu.run() >- print "+-----Kudzu-----+" >- kudzu.printOutput() >- print "" >- except V7CommandException, exception: >- # ignore kudzu if it errors >- pass >+ > print "+-----dmesg-----+" > Command("cat /var/log/dmesg | grep %s" % self.interface).echoIgnoreErrors() > print "" >Index: tests/pccard/pccard.py >=================================================================== >--- tests/pccard/pccard.py (revision 997) >+++ tests/pccard/pccard.py (working copy) >@@ -29,11 +29,11 @@ > return [TestTag.noninteractive, TestTag.certification] > > >- def plan(self, devices): >+ def plan(self, planner): > properties = dict() > properties['pci.device_subclass'] = 7 > properties['pci.device_class'] = 6 >- return self.planWith(devices, properties, all=False, strict=True) >+ return self.planWith(planner.getHalDeviceDetector(), properties, all=False, strict=True) > > def run(self): > try: >Index: tests/lid/lid.py >=================================================================== >--- tests/lid/lid.py (revision 995) >+++ tests/lid/lid.py (working copy) >@@ -29,8 +29,9 @@ > def tags(self): > return [TestTag.interactive, TestTag.certification, TestTag.portable] > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() >+ devices = planner.getHalDeviceDetector().getDevices() > for device in devices: > if 'lid' == device.getProperty("button.type"): > test = self.makeCopy() >Index: tests/suspend/suspend.py >=================================================================== >--- tests/suspend/suspend.py (revision 998) >+++ tests/suspend/suspend.py (working copy) >@@ -41,9 +41,10 @@ > def tags(self): > return [TestTag.interactive, TestTag.certification, TestTag.portable] > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > acAdapterDevice = None >+ devices = planner.getHalDeviceDetector().getDevices() > for device in devices: > if 'battery' in device.getProperty("info.category"): > test = self.makeCopy() >Index: tests/expresscard/expresscard.py >=================================================================== >--- tests/expresscard/expresscard.py (revision 995) >+++ tests/expresscard/expresscard.py (working copy) >@@ -29,7 +29,6 @@ > from v7.tags import Constants, DeviceClass > from v7.hal import Hal > from v7.procDeviceDetector import ProcDeviceDetector >-from v7.v7kudzu import Kudzu > from v7.test import Test > from v7.device import Device > from v7.usbTest import USBTestBase >@@ -41,13 +40,14 @@ > self.deviceClass = DeviceClass.expresscard > > >- def plan(self, devices): >+ def plan(self, planner): > tests = list() > isXenGuest = False > hasUSB = False > hasBattery = False > hasPCIE = False > # run if there's a device with info.product == usb and it's not a Xen guest. >+ devices = planner.getHalDeviceDetector().getDevices() > for device in devices: > if device.getProperty("info.product") == "Computer" and device.getProperty("smbios.bios.vendor") == "Xen": > isXenGuest = True >@@ -66,17 +66,7 @@ > > self.deviceDetector = Hal() > devices = self.deviceDetector.getDevices() >- if len(devices) is 0: >- print "Note: could not detect PCI devices via HAL, using Kudzu.\n" >- self.deviceDetector = Kudzu() >- allDevices = self.deviceDetector.getDevices() >- devices = list() >- for dev in allDevices: >- if dev.getProperty('bus') == "PCI": >- devices.append(dev) >- return devices >- else: >- return devices >+ return devices > > > def checkAllPCIPlugged(self): >@@ -202,14 +192,12 @@ > self.count = self.count - 1 > self.pciInfoOld = self.pciInfo() > self.halInfoOld = self.halInfo() >- self.kudzuInfoOld = self.kudzuInfo() > if not self.promptContinue("Please plug in an ExpressCard device"): > result = Constants.ABORT > return FAILED > # gather new HW info > self.pciInfoNew = self.pciInfo() > self.halInfoNew = self.halInfo() >- self.kudzuInfoNew = self.kudzuInfo() > > foundUSB = None > if self.count > 0 or not testedUSB: >@@ -250,7 +238,6 @@ > # print out the detailed HW info for reviewers > pciDiff = self.contextDiff(self.pciInfoOld, self.pciInfoNew) > halDiff = self.contextDiff(self.halInfoOld, self.halInfoNew) >- kudzuDiff = self.contextDiff(self.kudzuInfoOld, self.kudzuInfoNew) > print "\n========== Detailed HW info ========== \ > \n---------- lspci ---------- \ > \n%s \ >@@ -258,11 +245,8 @@ > \n---------- HAL ---------- \ > \n%s \ > \n-------------------------------------- \ >- \n---------- kudzu ---------- \ >- \n%s \ >- \n-------------------------------------- \ > \n======================================\n"\ >- % (pciDiff, halDiff, kudzuDiff) >+ % (pciDiff, halDiff) > > > if returnValue == PASSED: >Index: docs/man/v7.8.in >=================================================================== >--- docs/man/v7.8.in (revision 953) >+++ docs/man/v7.8.in (working copy) >@@ -64,11 +64,11 @@ > tag is assumed. Available tags for the planned tests may be displayed using the print command. > > .SS clean >-.B v7 clean >+.B v7 clean [ results | all ] > .P > The > .I clean >-command deletes the test results database. >+command deletes the test results database. The results argument (default) deletes test plan/results and log files, while the all argument also deletes the hardware information for the system under test and the associated certification ID. > > .SS continue > .B v7 continue
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
czhang
: review+
Actions:
View
|
Diff
Attachments on
bug 843565
: 600568