[blivet:rhel7-master 1/6] Change _matchNames so that it is less restrictive

mulhern amulhern at redhat.com
Fri Dec 12 15:59:42 UTC 2014


Also, omit transient parameter, it's not clear that it really helps much.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 tests/devicelibs_test/mdraid_interrogate_test.py | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/tests/devicelibs_test/mdraid_interrogate_test.py b/tests/devicelibs_test/mdraid_interrogate_test.py
index 034c929..49388b8 100755
--- a/tests/devicelibs_test/mdraid_interrogate_test.py
+++ b/tests/devicelibs_test/mdraid_interrogate_test.py
@@ -12,25 +12,17 @@ from blivet.size import Size
 
 class MDRaidInterrogateTestCase(mdraid_test.MDRaidAsRootTestCase):
 
-    def _matchNames(self, found, expected, transient=None):
+    def _matchNames(self, found, expected):
         """ Match names found against expected names.
 
             :param found: a list of names found in result
             :type found: list of str
             :param expected: a list of expected names
             :type expected: list of str
-            :param transient: a list of names that only sometimes appear
-            :type transient: list of str
         """
-        transient = transient or []
-
-        for n in (n for n in expected if n not in transient):
+        for n in expected:
             self.assertIn(n, found, msg="name '%s' not in info" % n)
 
-        for n in (n for n in found if n not in transient):
-            self.assertIn(n, expected, msg="unexpected name '%s' in info" % n)
-
-
 class MDExamineTestCase(MDRaidInterrogateTestCase):
 
     def __init__(self, methodName='runTest'):
@@ -87,7 +79,7 @@ class MDExamineTestCase(MDRaidInterrogateTestCase):
             :param int spares: the number of spares in this array
 
             Verifies that:
-              - exactly the predicted names are returned by mdexamine
+              - at least the predicted names are returned by mdexamine
               - RAID level and number of devices are correct
               - UUIDs have canonical form
         """
@@ -143,7 +135,6 @@ class MDDetailTestCase(MDRaidInterrogateTestCase):
         'PERSISTENCE',
         'RAID DEVICES',
         'RAID LEVEL',
-        'RESYNC STATUS',
         'SPARE DEVICES',
         'STATE',
         'TOTAL DEVICES',
@@ -164,7 +155,6 @@ class MDDetailTestCase(MDRaidInterrogateTestCase):
         'PREFERRED MINOR',
         'RAID DEVICES',
         'RAID LEVEL',
-        'RESYNC STATUS',
         'SPARE DEVICES',
         'STATE',
         'TOTAL DEVICES',
@@ -191,7 +181,7 @@ class MDDetailTestCase(MDRaidInterrogateTestCase):
             :param int spares: the number of spares for this array
 
             Verifies that:
-              - exactly the predicted names are returned by mddetail
+              - at least the predicted names are returned by mddetail
               - UUIDs have canonical form
         """
         level = mdraid.RAID_levels.raidLevel(level) if level is not None else raid.RAID1
@@ -202,7 +192,7 @@ class MDDetailTestCase(MDRaidInterrogateTestCase):
         info = mdraid.mddetail(self._dev_name)
 
         # info contains values for exactly names
-        self._matchNames(info.keys(), names, ['RESYNC STATUS'])
+        self._matchNames(info.keys(), names)
 
         # check names with predictable values
         self.assertEqual(info['RAID LEVEL'], str(level))
-- 
1.9.3



More information about the anaconda-patches mailing list