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)
-
-
-
-
Show replies by date