tp-libvirt
tp-libvirt copied to clipboard
[virsh_cmd:domain] Fix list index out of range issue
In commit a9211f84bf, 'host bridge' filter was added for aarch64. But on some host, lspci doesn't include any 'host bridge' strings. So the way by get_pci_id_using_filter will return an empty list.
This patch checks the pci_id, if it's empty, return test error. And also changes the way to get the host bridge on a host.
JOB ID : d0a92de5f442aef4a83896a0107e7636114470ed
JOB LOG : /var/lib/avocado/job-results/job-2024-03-15T00.37-d0a92de/job.log
(1/1) type_specific.io-github-autotest-libvirt.virsh.detach_device_alias.live.hostdev.pci: CANCEL: The PCI device with xml '<hostdev type="pci" mode="subsystem" managed="yes"><alias name="ua-04b02c7f-db89-409d-9e88-a9ce43de15d3" /><source><address domain="0x0000" slot="0x00" bus="0x00" function="0x0" /></source></hostdev>' does not support attaching to... (52.41 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 1
JOB HTML : /var/lib/avocado/job-results/job-2024-03-15T00.37-d0a92de/results.html
JOB TIME : 52.77 s
Depends on https://github.com/avocado-framework/avocado-vt/pull/3872
@dzhengfy @chunfuwen Please help to review this PR, thanks.
JOB ID : 6022c530e7cb034ed4252690bd8a54f71573cad6
JOB LOG : /var/lib/avocado/job-results/job-2024-05-27T06.38-6022c53/job.log
(1/1) type_specific.io-github-autotest-libvirt.virsh.detach_device_alias.live.hostdev.pci: CANCEL: The PCI device with xml '<hostdev type="pci" mode="subsystem" managed="yes"><alias name="ua-6de3a394-f3e1-4efe-8573-9fea153d66cc" /><source><address domain="0x0000" slot="0x00" bus="0x00" function="0x0" /></source></hostdev>' does not support attaching to... (82.69 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 1
JOB HTML : /var/lib/avocado/job-results/job-2024-05-27T06.38-6022c53/results.html
JOB TIME : 86.20 s
``
@dzhengfy Please help to review again, thanks.