Modify the test case of get_disk_mapping_rescue_with_config

Now running the test on AArch64 will get mismatch error, since
the default cdrom type on AArch64 is scsi, while the default cdrom
on X86 is ide, so I tweak the test and add AArch64 support.

Closes-bug: #1711093

Change-Id: I552f164107824fa28bfb47974c737da7d0f47e15
Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
This commit is contained in:
Kevin Zhao 2018-01-08 13:40:02 +08:00
parent 86d9f0e8cb
commit a7a04e273e
1 changed files with 6 additions and 2 deletions

View File

@ -253,12 +253,16 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
image_meta,
rescue=True)
expect_disk_config_rescue = {
'bus': 'ide', 'dev': 'hda', 'type': 'cdrom'}
if blockinfo.libvirt_utils.get_arch({}) == 'aarch64':
expect_disk_config_rescue['bus'] = 'scsi'
expect_disk_config_rescue['dev'] = 'sda'
expect = {
'disk.rescue': {'bus': 'virtio', 'dev': 'vda',
'type': 'disk', 'boot_index': '1'},
'disk': {'bus': 'virtio', 'dev': 'vdb', 'type': 'disk'},
'disk.config.rescue': {'bus': 'ide', 'dev': 'hda',
'type': 'cdrom'},
'disk.config.rescue': expect_disk_config_rescue,
'root': {'bus': 'virtio', 'dev': 'vda',
'type': 'disk', 'boot_index': '1'},
}