@@ -318,6 +318,34 @@ def test_60_resolve_device(self):
318
318
self .assertEqual (len (devices ), 1 )
319
319
self .assertIn (object_path , devices )
320
320
321
+ # create a partition on another device
322
+ disk = self .get_object ('/block_devices/' + os .path .basename (self .vdevs [2 ]))
323
+ self .assertIsNotNone (disk )
324
+ disk .Format ('gpt' , self .no_options , dbus_interface = self .iface_prefix + '.Block' )
325
+ self .addCleanup (self ._wipe , self .vdevs [2 ])
326
+ part_label = 'PRTLBLX'
327
+ path = disk .CreatePartition (dbus .UInt64 (1024 ** 2 ), dbus .UInt64 (100 * 1024 ** 2 ),
328
+ '' , part_label , self .no_options ,
329
+ dbus_interface = self .iface_prefix + '.PartitionTable' )
330
+ part = self .bus .get_object (self .iface_prefix , path )
331
+ self .assertIsNotNone (part )
332
+ part_uuid = self .get_property_raw (part , '.Partition' , 'UUID' )
333
+ self .assertIsNotNone (part_uuid )
334
+ part_name_val = self .get_property_raw (part , '.Partition' , 'Name' )
335
+ self .assertEquals (part_name_val , part_label )
336
+
337
+ # check that partlabel and partuuid can be resolved
338
+ spec = dbus .Dictionary ({'partlabel' : part_label }, signature = 'sv' )
339
+ devices = manager .ResolveDevice (spec , self .no_options )
340
+ object_path = '%s/block_devices/%s1' % (self .path_prefix , os .path .basename (self .vdevs [2 ]))
341
+ self .assertEqual (len (devices ), 1 )
342
+ self .assertIn (object_path , devices )
343
+ spec = dbus .Dictionary ({'partuuid' : part_uuid }, signature = 'sv' )
344
+ devices = manager .ResolveDevice (spec , self .no_options )
345
+ object_path = '%s/block_devices/%s1' % (self .path_prefix , os .path .basename (self .vdevs [2 ]))
346
+ self .assertEqual (len (devices ), 1 )
347
+ self .assertIn (object_path , devices )
348
+
321
349
def test_80_device_presence (self ):
322
350
'''Test the debug devices are present on the bus'''
323
351
for d in self .vdevs :
0 commit comments