From f6ececa68d430fe1a068200b60efcc67438391a1 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Tue, 10 May 2016 12:36:10 +0200 Subject: [PATCH] tests: Try different usable GIC versions The only case where the hardware capabilities influence the result is when no element was provided. The test programs now ensure both that the correct GIC version is picked in that case, and that hardware capabilities are not taken into account when the user has already picked a GIC version. --- .../qemuxml2argv-aarch64-gic-none-both.args | 1 + .../qemuxml2argv-aarch64-gic-none-both.xml | 1 + .../qemuxml2argv-aarch64-gic-none-v2.args | 1 + .../qemuxml2argv-aarch64-gic-none-v2.xml | 1 + .../qemuxml2argv-aarch64-gic-none-v3.args | 1 + .../qemuxml2argv-aarch64-gic-none-v3.xml | 1 + tests/qemuxml2argvtest.c | 78 +++++++++++++++---- .../qemuxml2xmlout-aarch64-gic-none-both.xml | 1 + .../qemuxml2xmlout-aarch64-gic-none-v2.xml | 1 + .../qemuxml2xmlout-aarch64-gic-none-v3.xml | 1 + tests/qemuxml2xmltest.c | 25 ++++-- 11 files changed, 92 insertions(+), 20 deletions(-) create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.xml create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.args create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.xml create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.args create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-both.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v2.xml create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v3.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args new file mode 120000 index 0000000000..5b20f61585 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-v3.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.xml new file mode 120000 index 0000000000..d859f53f6e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.xml @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-none.xml \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.args new file mode 120000 index 0000000000..323403903d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.args @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-v2.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.xml new file mode 120000 index 0000000000..d859f53f6e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.xml @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-none.xml \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.args new file mode 120000 index 0000000000..5b20f61585 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.args @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-v3.args \ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.xml new file mode 120000 index 0000000000..88c660c21c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.xml @@ -0,0 +1 @@ +qemuxml2argv-aarch64-gic-none-v2.xml \ No newline at end of file diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0641211190..f41316102d 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -540,6 +540,9 @@ mymain(void) # define DO_TEST(name, ...) \ DO_TEST_FULL(name, NULL, -1, 0, 0, GIC_NONE, __VA_ARGS__) +# define DO_TEST_GIC(name, gic, ...) \ + DO_TEST_FULL(name, NULL, -1, 0, 0, gic, __VA_ARGS__) + # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ 0, GIC_NONE, __VA_ARGS__) @@ -1737,38 +1740,83 @@ mymain(void) DO_TEST("aarch64-cpu-passthrough", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_KVM); - DO_TEST("aarch64-gic-none", - QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, - QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST("aarch64-gic-none", + DO_TEST_GIC("aarch64-gic-none", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT); - DO_TEST("aarch64-gic-default", + DO_TEST_GIC("aarch64-gic-none", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST("aarch64-gic-default", + DO_TEST_GIC("aarch64-gic-none-v2", GIC_V2, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-none-v3", GIC_V3, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-none-both", GIC_BOTH, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-default", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT); - DO_TEST("aarch64-gic-v2", + DO_TEST_GIC("aarch64-gic-default", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST("aarch64-gic-v2", + DO_TEST_GIC("aarch64-gic-default", GIC_V2, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-default", GIC_V3, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-default", GIC_BOTH, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-v2", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT); - DO_TEST("aarch64-gic-v3", + DO_TEST_GIC("aarch64-gic-v2", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_FAILURE("aarch64-gic-v3", + DO_TEST_GIC("aarch64-gic-v2", GIC_V2, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-v2", GIC_V3, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-v2", GIC_BOTH, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_FAILURE("aarch64-gic-v3", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT); - DO_TEST("aarch64-gic-host", + DO_TEST_GIC("aarch64-gic-v3", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_FAILURE("aarch64-gic-host", + DO_TEST_GIC("aarch64-gic-v3", GIC_V2, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-v3", GIC_V3, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-v3", GIC_BOTH, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_FAILURE("aarch64-gic-host", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT); - DO_TEST_PARSE_ERROR("aarch64-gic-invalid", + DO_TEST_GIC("aarch64-gic-host", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_FAILURE("aarch64-gic-not-virt", + DO_TEST_GIC("aarch64-gic-host", GIC_V2, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); - DO_TEST_FAILURE("aarch64-gic-not-arm", + DO_TEST_GIC("aarch64-gic-host", GIC_V3, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_GIC("aarch64-gic-host", GIC_BOTH, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_PARSE_ERROR("aarch64-gic-invalid", GIC_NONE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_FAILURE("aarch64-gic-not-virt", GIC_NONE, + QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACH_VIRT_GIC_VERSION); + DO_TEST_FAILURE("aarch64-gic-not-arm", GIC_NONE, QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACH_VIRT_GIC_VERSION); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-both.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-both.xml new file mode 120000 index 0000000000..f586fa1954 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-both.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v2.xml new file mode 120000 index 0000000000..80a01c2185 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v2.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v2.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v3.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v3.xml new file mode 120000 index 0000000000..f586fa1954 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v3.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 9d2109badd..404cd10b08 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -775,11 +775,26 @@ mymain(void) QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI); - DO_TEST("aarch64-gic-none"); - DO_TEST("aarch64-gic-default"); - DO_TEST("aarch64-gic-v2"); - DO_TEST("aarch64-gic-v3"); - DO_TEST("aarch64-gic-host"); + DO_TEST_FULL("aarch64-gic-none", WHEN_BOTH, GIC_NONE, NONE); + DO_TEST_FULL("aarch64-gic-none-v2", WHEN_BOTH, GIC_V2, NONE); + DO_TEST_FULL("aarch64-gic-none-v3", WHEN_BOTH, GIC_V3, NONE); + DO_TEST_FULL("aarch64-gic-none-both", WHEN_BOTH, GIC_BOTH, NONE); + DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_NONE, NONE); + DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_V2, NONE); + DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_V3, NONE); + DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_BOTH, NONE); + DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH, GIC_NONE, NONE); + DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH, GIC_V2, NONE); + DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH, GIC_V3, NONE); + DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH, GIC_BOTH, NONE); + DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH, GIC_NONE, NONE); + DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH, GIC_V2, NONE); + DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH, GIC_V3, NONE); + DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH, GIC_BOTH, NONE); + DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH, GIC_NONE, NONE); + DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH, GIC_V2, NONE); + DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH, GIC_V3, NONE); + DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH, GIC_BOTH, NONE); DO_TEST("memory-hotplug"); DO_TEST("memory-hotplug-nonuma");