testsuite: Fix LVM tests
authorMartin Pitt <martin.pitt@ubuntu.com>
Wed, 17 Feb 2010 11:29:37 +0000 (12:29 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Wed, 17 Feb 2010 11:29:37 +0000 (12:29 +0100)
Turns out that current LVM versions/rules do create by-id symlinks for RAID
mirror images, on purpose. So do not fail on them, just check that they do not
have a real IdUsage/IdUuid.

tests/run

index 064764e..554626c 100755 (executable)
--- a/tests/run
+++ b/tests/run
@@ -1131,6 +1131,7 @@ class LVM(UDisksTestCase):
                 self.assertEqual(props.Get(I_D, 'DevicePresentationHide'), False)
                 self.assertEqual(props.Get(I_D, 'IdUsage'), 'filesystem')
                 self.assertEqual(props.Get(I_D, 'IdType'), 'ext3')
+                self.assertNotEqual(props.Get(I_D, 'IdUuid'), '')
 
                 # ensure that we have a UUID
                 found_uuid = False
@@ -1142,10 +1143,11 @@ class LVM(UDisksTestCase):
                 # mirror images should not have any real FS usage at all
                 self.assertEqual(props.Get(I_D, 'IdUsage'), '')
 
-                # mirror images should not have by-* symlinks (avoid probing);
+                # mirror images should not have an UUID, since they are not
+                # "real" devices (they do have by-id/ symlinks, though)
                 # that is actually the job of the lvm2 udev rules, but check it
                 # here to ensure proper system integration
-                self.assertEqual(props.Get(I_D, 'DeviceFileById'), [])
+                self.assertEqual(props.Get(I_D, 'IdUuid'), '')
 
             self.assertEqual(props.Get(I_D, 'DevicePresentationNopolicy'), True)