Skip to content

Commit

Permalink
tests: Remove resolve_device tests involving partition creation
Browse files Browse the repository at this point in the history
This is a partial revert of commit cf47eee that depends on full
object update after partitioning. That is still work in progress
(see storaged-project#955) and prone to race conditions.

  ======================================================================
  FAIL: test_60_resolve_device (test_10_basic.UdisksBaseTest)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/jenkins/workspace/udisks-pr/arch/x86_64/distro/centos_9s/type/udisks/src/tests/dbus-tests/test_10_basic.py", line 335, in test_60_resolve_device
      self.assertEquals(part_name_val, part_label)
  AssertionError: dbus.String('', variant_level=1) != 'PRTLBLX'
  • Loading branch information
tbzatek committed Nov 4, 2022
1 parent 0866490 commit 3c41385
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/tests/dbus-tests/test_10_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,34 +318,6 @@ def test_60_resolve_device(self):
self.assertEqual(len(devices), 1)
self.assertIn(object_path, devices)

# create a partition on another device
disk = self.get_object('/block_devices/' + os.path.basename(self.vdevs[2]))
self.assertIsNotNone(disk)
disk.Format('gpt', self.no_options, dbus_interface=self.iface_prefix + '.Block')
self.addCleanup(self._wipe, self.vdevs[2])
part_label = 'PRTLBLX'
path = disk.CreatePartition(dbus.UInt64(1024**2), dbus.UInt64(100 * 1024**2),
'', part_label, self.no_options,
dbus_interface=self.iface_prefix + '.PartitionTable')
part = self.bus.get_object(self.iface_prefix, path)
self.assertIsNotNone(part)
part_uuid = self.get_property_raw(part, '.Partition', 'UUID')
self.assertIsNotNone(part_uuid)
part_name_val = self.get_property_raw(part, '.Partition', 'Name')
self.assertEquals(part_name_val, part_label)

# check that partlabel and partuuid can be resolved
spec = dbus.Dictionary({'partlabel': part_label}, signature='sv')
devices = manager.ResolveDevice(spec, self.no_options)
object_path = '%s/block_devices/%s1' % (self.path_prefix, os.path.basename(self.vdevs[2]))
self.assertEqual(len(devices), 1)
self.assertIn(object_path, devices)
spec = dbus.Dictionary({'partuuid': part_uuid}, signature='sv')
devices = manager.ResolveDevice(spec, self.no_options)
object_path = '%s/block_devices/%s1' % (self.path_prefix, os.path.basename(self.vdevs[2]))
self.assertEqual(len(devices), 1)
self.assertIn(object_path, devices)

def test_80_device_presence(self):
'''Test the debug devices are present on the bus'''
for d in self.vdevs:
Expand Down

0 comments on commit 3c41385

Please sign in to comment.