r1159 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-01-20 17:50:46 +0000 (Fri, 20 Jan 2012)
New Revision: 1159
Modified:
trunk/v7.spec.in
Log:
changelog
Modified: trunk/v7.spec.in
===================================================================
--- trunk/v7.spec.in 2012-01-20 17:49:19 UTC (rev 1158)
+++ trunk/v7.spec.in 2012-01-20 17:50:46 UTC (rev 1159)
@@ -77,7 +77,7 @@
%changelog
-* Fri Jan 21 2011 Greg Nichols <gnichols(a)redhat.com>
+* Fri Jan 21 2012 Greg Nichols <gnichols(a)redhat.com>
V7 1.5 R0
12 years, 3 months
r1158 - trunk/tests/storage
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-01-20 17:49:19 +0000 (Fri, 20 Jan 2012)
New Revision: 1158
Modified:
trunk/tests/storage/storage.py
Log:
Bug 782197 - FEAT: v7 should support dbus udisks in place of hal/kudzu/hardware.py for storage test
Modified: trunk/tests/storage/storage.py
===================================================================
--- trunk/tests/storage/storage.py 2012-01-20 17:47:55 UTC (rev 1157)
+++ trunk/tests/storage/storage.py 2012-01-20 17:49:19 UTC (rev 1158)
@@ -25,6 +25,7 @@
from v7.test import Test, TestTag
from v7.command import Command, V7CommandException
from v7.tags import DeviceClass
+from v7.dbusDevice import UDisksDrive
class StorageTest(Test):
@@ -46,52 +47,78 @@
tests = dict()
controllers = ''
for device in devices:
- disk = None
- # via HAL
- 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 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
- controllers = 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
+ disk = self.planUDisks(device, devices)
+
+ if not disk:
+ disk = self.planHAL(device, devices)
+
+ if not disk:
+ disk = self.planKudzu(device)
- # via Kudzu
- elif "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")
-
+
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")
+ print "found device file " + disk
+ # 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 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
+ controllers = 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):
+ 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")
+
+ return disk
+
def doDt(self, minBs, maxBs, size, options):
"""Helper function: run dt with various block sizes and reasonable defaults."""
12 years, 3 months
r1157 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-01-20 17:47:55 +0000 (Fri, 20 Jan 2012)
New Revision: 1157
Modified:
trunk/v7.spec.in
Log:
changelog
Modified: trunk/v7.spec.in
===================================================================
--- trunk/v7.spec.in 2012-01-20 17:45:36 UTC (rev 1156)
+++ trunk/v7.spec.in 2012-01-20 17:47:55 UTC (rev 1157)
@@ -77,6 +77,16 @@
%changelog
+* Fri Jan 21 2011 Greg Nichols <gnichols(a)redhat.com>
+
+V7 1.5 R0
+
+ 755787 - RFE: rebase CD/DVD/Blu-ray tests
+ 754919 - bluray: not choosing the most capable media type as default
+ 707144 - Regression with BLURAY test in v7 version 1.3-43-el6
+ 705999 - v7 --help doesn't give information about "v7 save"
+ 782197 - FEAT: v7 should support dbus udisks in place of hal/kudzu/hardware.py for storage test
+
* Thu Nov 03 2011 Greg Nichols <gnichols(a)redhat.com>
V7 1.4 R38
12 years, 3 months
r1156 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-01-20 17:45:36 +0000 (Fri, 20 Jan 2012)
New Revision: 1156
Added:
trunk/v7/dbusDevice.py
trunk/v7/udisksDeviceDetector.py
Modified:
trunk/v7/certificationtest.py
trunk/v7/device.py
trunk/v7/deviceclassdocument.py
trunk/v7/tags.py
Log:
Bug 782197 - FEAT: v7 should support dbus udisks in place of hal/kudzu/hardware.py for storage test
Modified: trunk/v7/certificationtest.py
===================================================================
--- trunk/v7/certificationtest.py 2012-01-20 17:41:14 UTC (rev 1155)
+++ trunk/v7/certificationtest.py 2012-01-20 17:45:36 UTC (rev 1156)
@@ -134,7 +134,7 @@
def appendDevice(self, device):
for name in self.deviceClasses:
if self.deviceClasses[name].registerDevice(device):
- # print "%s registered device %s" % (name, device.getUDI())
+ print "%s registered device %s" % (name, device.getUDI())
pass
def setOS(self, tag, value):
Added: trunk/v7/dbusDevice.py
===================================================================
--- trunk/v7/dbusDevice.py (rev 0)
+++ trunk/v7/dbusDevice.py 2012-01-20 17:45:36 UTC (rev 1156)
@@ -0,0 +1,111 @@
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Greg Nichols
+#
+import string
+import os
+import sys
+import dbus
+
+from tags import Constants
+from device import Device
+
+class DBusDevice(Device):
+ def __init__(self, dbusClass, dbusObject):
+ Device.__init__(self)
+ self.dbusClass = dbusClass
+ self.dbusObject = dbusObject
+ self.dbusInterface = dbus.Interface(self.dbusObject, dbus.PROPERTIES_IFACE)
+ self.getProperties()
+
+ def dump(self):
+ print "\nUDI: " + self.getUDI() + "\n----------------------------------------"
+ # print self.dbusObject.Introspect()
+ for (name, value) in self.getProperties().iteritems():
+ print "%s: %s" % (name, value)
+
+
+ def getProperty(self, name):
+ try:
+ return self.dbusObject.Get(self.dbusClass, name)
+ except:
+ return ""
+
+ def getProperties(self):
+ # refresh them
+ self.properties = dict()
+ for (property, value) in self.dbusObject.GetAll(self.dbusClass).iteritems():
+ # skip binary blobs alltogether
+ if "Blob" in property:
+ continue
+ # convert list values to strings with comma separation
+ try:
+ if isinstance(value, dbus.Array):
+ value = ", ".join(value)
+ except TypeError:
+ pass
+ self.properties[property] = value
+ return self.properties
+
+
+class UDisksDevice(DBusDevice):
+
+ def __init__(self, object):
+ DBusDevice.__init__(self, dbusClass="org.freedesktop.UDisks.Device", dbusObject=object)
+ self.setUDI(self.getProperty("NativePath"))
+
+ def dump(self):
+ DBusDevice.dump(self)
+ for attribute in ["DeviceFile", "NativePath", "IdLabel", "IdUsage", "IdUuid", "DeviceSize"]:
+ print attribute + ": " + str(self.getProperty(attribute))
+
+ def getMountPaths(self):
+ paths = list()
+ if self.getProperty("DeviceIsMounted"):
+ paths = self.getProperty("DeviceMountPaths")
+ return paths
+
+ def getSource(self):
+ return Constants.udisks
+
+
+
+class UDisksDrive(UDisksDevice):
+
+ def __init__(self, object):
+ UDisksDevice.__init__(self, object)
+
+ def dump(self):
+ UDisksDevice.dump(self)
+
+ def getProduct(self):
+ return self.getProperty("DriveModel")
+
+class UDisksPartition(UDisksDevice):
+
+ def __init__(self, object):
+ UDisksDevice.__init__(self, object)
+
+class UDisksAdapter(DBusDevice):
+
+ def __init__(self, object):
+ DBusDevice.__init__(self, dbusClass="org.freedesktop.UDisks.Adapter", dbusObject=object)
+ self.setUDI(self.getProperty("NativePath"))
+
+ def getSource(self):
+ return Constants.udisks
+
+ def getProduct(self):
+ return self.getProperty("Model")
+
Modified: trunk/v7/device.py
===================================================================
--- trunk/v7/device.py 2012-01-20 17:41:14 UTC (rev 1155)
+++ trunk/v7/device.py 2012-01-20 17:45:36 UTC (rev 1156)
@@ -37,10 +37,10 @@
return None
def getUDI(self):
- return self.getProperty(Constants.info_dot_udi)
+ return self.udi
def setUDI(self, udi):
- self.properties[Constants.info_dot_udi] = udi
+ self.udi = udi
def getClass(self):
return self.deviceClass
Modified: trunk/v7/deviceclassdocument.py
===================================================================
--- trunk/v7/deviceclassdocument.py 2012-01-20 17:41:14 UTC (rev 1155)
+++ trunk/v7/deviceclassdocument.py 2012-01-20 17:45:36 UTC (rev 1156)
@@ -24,6 +24,7 @@
from testdocument import TestDocument
import version
from deviceDetector import DeviceDetector
+from dbusDevice import UDisksDevice, UDisksDrive
# A DeviceClassDocument is a collection of devices and tests for those devices
@@ -45,9 +46,9 @@
def registerDevice(self, device):
if self.hasDevice(device):
- self.appendDevice(device)
if self.getName() != "system":
device.setClass(self.getName())
+ self.appendDevice(device)
return True
return False
@@ -245,6 +246,9 @@
self.setFunction(SystemFunction.storage)
def hasDevice(self, device):
+
+ if device.getSource() == Constants.udisks and isinstance(device, UDisksDrive) and device.getProperty("DeviceIsSystemInternal"):
+ return True
if (device.getSource() == Constants.hal
and ('storage' in device.getProperty("info.capabilities")
or device.getProperty("info.linux.driver") == "cciss"
Modified: trunk/v7/tags.py
===================================================================
--- trunk/v7/tags.py 2012-01-20 17:41:14 UTC (rev 1155)
+++ trunk/v7/tags.py 2012-01-20 17:45:36 UTC (rev 1156)
@@ -31,6 +31,7 @@
arch="arch"
test="test"
hal="hal"
+ udisks="udisks"
kudzu="kudzu"
system="system"
output="output"
@@ -135,6 +136,7 @@
forced = "forced"
ALL = "ALL"
hal = "hal"
+ udisks="udisks"
kudzu = "kudzu"
proc = "proc"
user = "user"
Added: trunk/v7/udisksDeviceDetector.py
===================================================================
--- trunk/v7/udisksDeviceDetector.py (rev 0)
+++ trunk/v7/udisksDeviceDetector.py 2012-01-20 17:45:36 UTC (rev 1156)
@@ -0,0 +1,85 @@
+#!/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
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Authors: Greg Nichols
+#
+# A v7 DeviceDetector generalized from HAL to add udisks and upower
+
+import dbus
+import re
+import string
+import sys
+
+from v7.device import Device
+from v7.dbusDevice import UDisksDevice, UDisksDrive, UDisksPartition, UDisksAdapter
+from v7.deviceDetector import DeviceDetector
+from v7.tags import Constants
+
+class UDisksDeviceDetector(DeviceDetector):
+ def __init__(self):
+ DeviceDetector.__init__(self, name=Constants.udisks)
+ self.debugging = True
+ self.rootObject ='org.freedesktop.UDisks'
+ self.rootPath = '/org/freedesktop/UDisks'
+ self.interface = None
+ try:
+ self.bus = dbus.SystemBus()
+ dbusObject = self.bus.get_object(self.rootObject, self.rootPath)
+ self.interface = dbus.Interface(dbusObject, self.rootObject)
+ if self.interface and self.debugging:
+ print "found interface for " + self.name
+ except Exception, exception:
+ if self.debugging:
+ print "Warning: "
+ print exception
+
+ def getDevices(self):
+ devices = list()
+ for devicePath in self.interface.EnumerateDevices():
+ device = self.bus.get_object(self.rootObject, devicePath)
+ deviceProperties = dbus.Interface(device, dbus.PROPERTIES_IFACE)
+ #try:
+ if True:
+ if deviceProperties.Get("org.freedesktop.UDisks.Device", "DeviceIsDrive"):
+ devices.append(UDisksDrive(device))
+ elif deviceProperties.Get("org.freedesktop.UDisks.Device", "DeviceIsPartition"):
+ devices.append(UDisksPartition(device))
+ else:
+ devices.append(UDisksDevice(device))
+ #except Exception, e:
+ #print e
+
+ for adapterPath in self.interface.EnumerateAdapters():
+ adapter = self.bus.get_object(self.rootObject, adapterPath)
+ devices.append(UDisksAdapter(adapter))
+
+ return devices
+
+
+ def dump(self):
+ print "--------------------------------------------------------------"
+ print " Devices:"
+ for device in self.getDevices():
+ device.dump()
+ device.getProduct()
+
+def unit_test():
+
+ udisks=UDisksDeviceDetector()
+ udisks.dump()
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(unit_test())
12 years, 3 months
r1155 - trunk/v7
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-01-20 17:41:14 +0000 (Fri, 20 Jan 2012)
New Revision: 1155
Modified:
trunk/v7/hardwaretest.py
Log:
705999 - v7 --help doesn't give information about v7 save
Modified: trunk/v7/hardwaretest.py
===================================================================
--- trunk/v7/hardwaretest.py 2012-01-20 17:35:11 UTC (rev 1154)
+++ trunk/v7/hardwaretest.py 2012-01-20 17:41:14 UTC (rev 1155)
@@ -89,7 +89,8 @@
"\trun \t- run specific certification tests\n"\
"\tcontinue \t- continue a test run\n"\
"\tversion\t- prints the version of v7\n"\
- "\tserver (start | stop | status | daemon) - run v7 as a test server\n"
+ "\tserver (start | stop | status | daemon) - run v7 as a test server\n"\
+ "\tsave\t- save a copy of the current test results\n"
parser = OptionParser(usage)
12 years, 3 months
r1153 - trunk
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-01-19 16:11:57 +0000 (Thu, 19 Jan 2012)
New Revision: 1153
Modified:
trunk/Makefile
Log:
Start 1.5 at R0
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2012-01-19 16:09:54 UTC (rev 1152)
+++ trunk/Makefile 2012-01-19 16:11:57 UTC (rev 1153)
@@ -13,8 +13,8 @@
#
# Author: Greg Nichols
-V7_VERSION := 1.4
-V7_RELEASE := 38
+V7_VERSION := 1.5
+V7_RELEASE := 0
V7_VERSION_RELEASE := $(V7_VERSION)-$(V7_RELEASE)
V7_VERSION_PY := v7/version.py
V7_SVN_MODULE := svn+ssh://svn.fedorahosted.org/svn/v7
12 years, 3 months
r1152 - branches
by gnichols@fedoraproject.org
Author: gnichols
Date: 2012-01-19 16:09:54 +0000 (Thu, 19 Jan 2012)
New Revision: 1152
Added:
branches/v7-1.4/
Log:
branch from R38
12 years, 3 months