From a7a04e273e477f13dea59c1c3b5aab8c41e041e5 Mon Sep 17 00:00:00 2001 From: Kevin Zhao Date: Mon, 8 Jan 2018 13:40:02 +0800 Subject: [PATCH] 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 --- nova/tests/unit/virt/libvirt/test_blockinfo.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nova/tests/unit/virt/libvirt/test_blockinfo.py b/nova/tests/unit/virt/libvirt/test_blockinfo.py index 4672c30263dd..71e425397a14 100644 --- a/nova/tests/unit/virt/libvirt/test_blockinfo.py +++ b/nova/tests/unit/virt/libvirt/test_blockinfo.py @@ -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'}, }