@@ -124,10 +124,6 @@ def test_find_disk_dev(self):
124
124
dev = blockinfo .find_disk_dev_for_disk_bus (mapping , 'scsi' )
125
125
self .assertEqual ('sdb' , dev )
126
126
127
- dev = blockinfo .find_disk_dev_for_disk_bus (mapping , 'scsi' ,
128
- last_device = True )
129
- self .assertEqual ('sdz' , dev )
130
-
131
127
dev = blockinfo .find_disk_dev_for_disk_bus (mapping , 'virtio' )
132
128
self .assertEqual ('vda' , dev )
133
129
@@ -164,9 +160,8 @@ def test_get_next_disk_dev(self):
164
160
165
161
mapping ['disk.config' ] = blockinfo .get_next_disk_info (mapping ,
166
162
'ide' ,
167
- 'cdrom' ,
168
- True )
169
- self .assertEqual ({'dev' : 'hdd' , 'bus' : 'ide' , 'type' : 'cdrom' },
163
+ 'cdrom' )
164
+ self .assertEqual ({'dev' : 'hda' , 'bus' : 'ide' , 'type' : 'cdrom' },
170
165
mapping ['disk.config' ])
171
166
172
167
def test_get_next_disk_dev_boot_index (self ):
@@ -262,7 +257,7 @@ def test_get_disk_mapping_rescue_with_config(self):
262
257
'disk.rescue' : {'bus' : 'virtio' , 'dev' : 'vda' ,
263
258
'type' : 'disk' , 'boot_index' : '1' },
264
259
'disk' : {'bus' : 'virtio' , 'dev' : 'vdb' , 'type' : 'disk' },
265
- 'disk.config.rescue' : {'bus' : 'ide' , 'dev' : 'hdd ' ,
260
+ 'disk.config.rescue' : {'bus' : 'ide' , 'dev' : 'hda ' ,
266
261
'type' : 'cdrom' },
267
262
'root' : {'bus' : 'virtio' , 'dev' : 'vda' ,
268
263
'type' : 'disk' , 'boot_index' : '1' },
@@ -379,17 +374,17 @@ def test_get_disk_mapping_simple_configdrive(self):
379
374
"virtio" , "ide" ,
380
375
image_meta )
381
376
382
- # The last device is selected for this. on x86 is the last ide
383
- # device (hdd). Since power only support scsi, the last device
384
- # is sdz
377
+ # Pick the first drive letter on the bus that is available
378
+ # as the config drive. Delete the last device hardcode as
379
+ # the config drive here.
385
380
386
- bus_ppc = ("scsi" , "sdz " )
387
- bus_aarch64 = ("scsi" , "sdz " )
381
+ bus_ppc = ("scsi" , "sda " )
382
+ bus_aarch64 = ("scsi" , "sda " )
388
383
expect_bus = {"ppc" : bus_ppc , "ppc64" : bus_ppc ,
389
384
"ppc64le" : bus_ppc , "aarch64" : bus_aarch64 }
390
385
391
386
bus , dev = expect_bus .get (blockinfo .libvirt_utils .get_arch ({}),
392
- ("ide" , "hdd " ))
387
+ ("ide" , "hda " ))
393
388
394
389
expect = {
395
390
'disk' : {'bus' : 'virtio' , 'dev' : 'vda' ,
@@ -418,13 +413,13 @@ def test_get_disk_mapping_cdrom_configdrive(self):
418
413
"virtio" , "ide" ,
419
414
image_meta )
420
415
421
- bus_ppc = ("scsi" , "sdz " )
422
- bus_aarch64 = ("scsi" , "sdz " )
416
+ bus_ppc = ("scsi" , "sda " )
417
+ bus_aarch64 = ("scsi" , "sda " )
423
418
expect_bus = {"ppc" : bus_ppc , "ppc64" : bus_ppc ,
424
419
"ppc64le" : bus_ppc , "aarch64" : bus_aarch64 }
425
420
426
421
bus , dev = expect_bus .get (blockinfo .libvirt_utils .get_arch ({}),
427
- ("ide" , "hdd " ))
422
+ ("ide" , "hda " ))
428
423
429
424
expect = {
430
425
'disk' : {'bus' : 'virtio' , 'dev' : 'vda' ,
@@ -454,7 +449,7 @@ def test_get_disk_mapping_disk_configdrive(self):
454
449
'disk' : {'bus' : 'virtio' , 'dev' : 'vda' ,
455
450
'type' : 'disk' , 'boot_index' : '1' },
456
451
'disk.local' : {'bus' : 'virtio' , 'dev' : 'vdb' , 'type' : 'disk' },
457
- 'disk.config' : {'bus' : 'virtio' , 'dev' : 'vdz ' , 'type' : 'disk' },
452
+ 'disk.config' : {'bus' : 'virtio' , 'dev' : 'vdc ' , 'type' : 'disk' },
458
453
'root' : {'bus' : 'virtio' , 'dev' : 'vda' ,
459
454
'type' : 'disk' , 'boot_index' : '1' },
460
455
}
0 commit comments