From 5a1ccaeb00d3cba7727b7022587f77b4fd2edd2b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 27 Jan 2016 17:47:14 -0500 Subject: [PATCH] tests: qemu: More aarch64 virtio and pci tests Clarify the point of some of the test cases by renaming them. Add more xml2xml tests. --- ...uxml2argv-aarch64-virtio-pci-default.args} | 0 ...muxml2argv-aarch64-virtio-pci-default.xml} | 0 ...-aarch64-virtio-pci-manual-addresses.args} | 0 ...v-aarch64-virtio-pci-manual-addresses.xml} | 0 tests/qemuxml2argvtest.c | 11 ++- ...muxml2xmlout-aarch64-aavmf-virtio-mmio.xml | 6 +- ...uxml2xmlout-aarch64-virtio-pci-default.xml | 69 +++++++++++++++++++ ...ut-aarch64-virtio-pci-manual-addresses.xml | 53 ++++++++++++++ tests/qemuxml2xmltest.c | 17 ++++- 9 files changed, 152 insertions(+), 4 deletions(-) rename tests/qemuxml2argvdata/{qemuxml2argv-aarch64-mmio-default-pci.args => qemuxml2argv-aarch64-virtio-pci-default.args} (100%) rename tests/qemuxml2argvdata/{qemuxml2argv-aarch64-mmio-default-pci.xml => qemuxml2argv-aarch64-virtio-pci-default.xml} (100%) rename tests/qemuxml2argvdata/{qemuxml2argv-aarch64-virtio-pci.args => qemuxml2argv-aarch64-virtio-pci-manual-addresses.args} (100%) rename tests/qemuxml2argvdata/{qemuxml2argv-aarch64-virtio-pci.xml => qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml} (100%) create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args similarity index 100% rename from tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.args rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml similarity index 100% rename from tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.xml rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args similarity index 100% rename from tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.args rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.args diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml similarity index 100% rename from tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.xml rename to tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-manual-addresses.xml diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 92043d2dc7..3c7693bf25 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1650,13 +1650,20 @@ mymain(void) QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); - DO_TEST("aarch64-mmio-default-pci", + + /* Demonstrates the virtio-pci default... namely that there isn't any! + q35 style PCI controllers will be added if the binary supports it, + but virtio-mmio is always used unless PCI addresses are manually + specified. */ + DO_TEST("aarch64-virtio-pci-default", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM, QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE); - DO_TEST("aarch64-virtio-pci", + /* Example of using virtio-pci with no explicit PCI controller + but with manual PCI addresses */ + DO_TEST("aarch64-virtio-pci-manual-addresses", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM, diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml index 4a31c8b1cc..f79c6e72a1 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-aavmf-virtio-mmio.xml @@ -31,10 +31,13 @@
- + +
+ +
@@ -44,6 +47,7 @@ /dev/random +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml new file mode 100644 index 0000000000..6f1c53b26d --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml @@ -0,0 +1,69 @@ + + aarch64test + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1048576 + 1 + + hvm + /aarch64.kernel + /aarch64.initrd + earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait + /aarch64.dtb + + + + + + + + + cortex-a53 + + + destroy + restart + restart + + /usr/bin/qemu-system-aarch64 + + + +
+ + + + +
+ + + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + + /dev/random +
+ + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml new file mode 100644 index 0000000000..4add271a83 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-manual-addresses.xml @@ -0,0 +1,53 @@ + + aarch64test + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1048576 + 1 + + hvm + /aarch64.kernel + /aarch64.initrd + earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait + /aarch64.dtb + + + + + + + + + cortex-a53 + + + destroy + restart + restart + + /usr/bin/qemu-system-aarch64 + + + +
+ + +
+ + + + +
+ + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 4429b6bbab..d9550ccee8 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -720,8 +720,23 @@ mymain(void) DO_TEST("shmem"); DO_TEST("smbios"); DO_TEST("smbios-multiple-type2"); - DO_TEST("aarch64-aavmf-virtio-mmio"); + DO_TEST_FULL("aarch64-aavmf-virtio-mmio", WHEN_ACTIVE, + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, + QEMU_CAPS_DEVICE_VIRTIO_MMIO, + QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); + DO_TEST_FULL("aarch64-virtio-pci-default", WHEN_ACTIVE, + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, + QEMU_CAPS_DEVICE_VIRTIO_MMIO, + QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM, + QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI); + DO_TEST_FULL("aarch64-virtio-pci-manual-addresses", WHEN_ACTIVE, + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB, + QEMU_CAPS_DEVICE_VIRTIO_MMIO, + QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM, + QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI); DO_TEST("aarch64-gic"); DO_TEST("aarch64-gicv3");