未验证 提交 e6f86f9a 编写于 作者: X Xu Han 提交者: GitHub

Merge pull request #2183 from leidwang/boot_order_check_q35

Fixed bug about boot_order_check when run it with q35
......@@ -5,6 +5,7 @@ import time
from avocado.utils import process
from virttest import error_context
from virttest import utils_misc
@error_context.context_aware
......@@ -29,13 +30,16 @@ def run(test, params, env):
device_found = dev
break
elif dev['class_info']['desc'] == 'PCI bridge':
device_found = _get_device(dev['pci_bridge']['devices'],
pci_bridge_devices = dev['pci_bridge'].get('devices')
if not pci_bridge_devices:
continue
device_found = _get_device(pci_bridge_devices,
dev_id)
if device_found:
break
return device_found
def _get_pci_addr_by_devid(vm, dev_id):
def _get_pci_addr_by_devid(dev_id):
dev_addr = ''
dev_addr_fmt = '%02d:%02d.%d'
pci_info = vm.monitor.info('pci', debug=False)
......@@ -71,6 +75,7 @@ def run(test, params, env):
process.system("ifconfig %s down" % nic.ifname)
vm.resume()
devices_load_timeout = int(params.get("devices_load_timeout", 10))
timeout = int(params.get("login_timeout", 240))
bootorder_type = params.get("bootorder_type")
......@@ -83,7 +88,8 @@ def run(test, params, env):
for nic in vm.virtnet:
boot_index = params['bootindex_%s' % nic.nic_name]
pci_addr = _get_pci_addr_by_devid(vm, nic.device_id)
pci_addr = utils_misc.wait_for(lambda: _get_pci_addr_by_devid(nic.device_id),
timeout=devices_load_timeout)
if not pci_addr:
test.fail("Cannot get the pci address of %s." % nic.nic_name)
list_nic_addr.append((pci_addr, boot_index))
......
......@@ -6,6 +6,7 @@
kill_vm = yes
boot_menu = on
enable_sga = yes
devices_load_timeout = 10
# we have QEMU machine with three NICs (virtio, e1000, rtl8139)
# and two disks (default, IDE). firmware should try to boot from the bootindex=1
# first. If this fails, it should try the bootindex=2 next, and so on.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册