]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Try different usable GIC versions
authorAndrea Bolognani <abologna@redhat.com>
Tue, 10 May 2016 10:36:10 +0000 (12:36 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 18 May 2016 09:27:56 +0000 (11:27 +0200)
The only case where the hardware capabilities influence the result
is when no <gic/> 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.

tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args [new symlink]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.xml [new symlink]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.args [new symlink]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.xml [new symlink]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.args [new symlink]
tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.xml [new symlink]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-both.xml [new symlink]
tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v2.xml [new symlink]
tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v3.xml [new symlink]
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args
new file mode 120000 (symlink)
index 0000000..5b20f61
--- /dev/null
@@ -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 (symlink)
index 0000000..d859f53
--- /dev/null
@@ -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 (symlink)
index 0000000..3234039
--- /dev/null
@@ -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 (symlink)
index 0000000..d859f53
--- /dev/null
@@ -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 (symlink)
index 0000000..5b20f61
--- /dev/null
@@ -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 (symlink)
index 0000000..88c660c
--- /dev/null
@@ -0,0 +1 @@
+qemuxml2argv-aarch64-gic-none-v2.xml
\ No newline at end of file
index 0641211190259cde90d3b461077ed50914ecbf7f..f41316102d2ab7f4ebe80ead20c5fca20c978bf6 100644 (file)
@@ -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",
+    DO_TEST_GIC("aarch64-gic-none", GIC_NONE,
+            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT);
+    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-none",
-            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT);
-    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("aarch64-gic-default",
+    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_GIC("aarch64-gic-default", GIC_V2,
             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_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_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_FAILURE("aarch64-gic-v3",
+    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_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",
+    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_GIC("aarch64-gic-host", GIC_V2,
+            QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT,
+            QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+    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",
+    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",
+    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 (symlink)
index 0000000..f586fa1
--- /dev/null
@@ -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 (symlink)
index 0000000..80a01c2
--- /dev/null
@@ -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 (symlink)
index 0000000..f586fa1
--- /dev/null
@@ -0,0 +1 @@
+../qemuxml2argvdata/qemuxml2argv-aarch64-gic-v3.xml
\ No newline at end of file
index 9d2109badd04043c85d1ca5c2935b913875d73de..404cd10b0817917201d81ba3a3da1f5aaea30b25 100644 (file)
@@ -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");