提交 9e318ad7 编写于 作者: A Andrea Bolognani

tests: Improve target index validation coverage

Split one of the existing tests to ensure both configuration
errors it contained cause a failure, and introduce a new
test case.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
上级 7726d158
......@@ -12,10 +12,6 @@
<controller type='pci' index='0' model='pci-root'>
<target index='1'/>
</controller>
<!-- Other PHBs can't have target index 0 -->
<controller type='pci' index='1' model='pci-root'>
<target index='0'/>
</controller>
<controller type='usb' model='none'/>
<memballoon model='none'/>
</devices>
......
<domain type='qemu'>
<name>QEMUGuest1</name>
<uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
<memory unit='KiB'>524288</memory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='ppc64' machine='pseries'>hvm</type>
</os>
<devices>
<emulator>/usr/bin/qemu-system-ppc64</emulator>
<!-- PHBs other than the default one can't have target index 0 -->
<controller type='pci' index='1' model='pci-root'>
<target index='0'/>
</controller>
<controller type='usb' model='none'/>
<memballoon model='none'/>
</devices>
</domain>
<domain type='qemu'>
<name>QEMUGuest1</name>
<uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
<memory unit='KiB'>524288</memory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='ppc64' machine='pseries'>hvm</type>
</os>
<devices>
<emulator>/usr/bin/qemu-system-ppc64</emulator>
<!-- QEMU only supports 32 PHBs with target index in the range 0-31,
so attempting to use target index 32 should fail -->
<controller type='pci' model='pci-root'>
<target index='32'/>
</controller>
<controller type='usb' model='none'/>
<memballoon model='none'/>
</devices>
</domain>
......@@ -1764,13 +1764,15 @@ mymain(void)
DO_TEST("pseries-phb-default-missing",
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
DO_TEST_PARSE_ERROR("pseries-phb-wrong-target-index", NONE);
DO_TEST("pseries-phb-numa-node",
QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE);
DO_TEST_PARSE_ERROR("pseries-default-phb-numa-node", NONE);
DO_TEST_PARSE_ERROR("pseries-phb-invalid-target-index-1", NONE);
DO_TEST_PARSE_ERROR("pseries-phb-invalid-target-index-2", NONE);
DO_TEST_PARSE_ERROR("pseries-phb-invalid-target-index-3", NONE);
DO_TEST("pseries-many-devices",
QEMU_CAPS_NODEFCONFIG,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册