[11/12] tests: qemuxml2xml: make GIC handling optional

Message ID 77c18aaabd25aa26c4aa2c41cca0d7ee71f562b8.1554137098.git.crobinso@redhat.com
State Accepted
Commit 02b562514cd3b2817f65a21465d442d770e1069d
Headers show
Series
  • tests: qemuxml2xml: add DO_TEST_CAPS*
Related show

Commit Message

Cole Robinson April 1, 2019, 4:47 p.m.
Make all users of GIC_X use ARG_GIC explicitly, and drop the
required gic parameter from DO_TEST_FULL

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 tests/qemuxml2xmltest.c | 85 ++++++++++++++++++++++++++---------------
 1 file changed, 55 insertions(+), 30 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Andrea Bolognani April 10, 2019, 4:59 p.m. | #1
On Mon, 2019-04-01 at 12:47 -0400, Cole Robinson wrote:
[...]
>  # define DO_TEST(name, ...) \

> -    DO_TEST_FULL(name, WHEN_BOTH, GIC_NONE, __VA_ARGS__)

> +    DO_TEST_FULL(name, WHEN_BOTH, ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)


Please move ARG_QEMU_CAPS and its arguments to a separate line.

[...]
> +    DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE,

> +            ARG_QEMU_CAPS, QEMU_CAPS_LAST);

> +    DO_TEST_FULL("seclabel-dynamic-override", WHEN_INACTIVE,

> +            ARG_QEMU_CAPS, QEMU_CAPS_LAST, NONE);

> +    DO_TEST_FULL("seclabel-dynamic-labelskip", WHEN_INACTIVE,

> +            ARG_QEMU_CAPS, NONE);

> +    DO_TEST_FULL("seclabel-dynamic-relabel", WHEN_INACTIVE,

> +            ARG_QEMU_CAPS, NONE);


The first two test cases use QEMU_CAPS_LAST instead of NONE. Also
the alignment is out of whack.

[...]
> +    DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE,

> +            ARG_QEMU_CAPS, NONE);


This is misaligned, too.

[...]
> +    DO_TEST_FULL("aarch64-gic-none", WHEN_BOTH,

> +                 ARG_GIC, GIC_NONE, ARG_QEMU_CAPS, NONE);


For this and all of the other "aarch64-gic-*" test cases, put
ARG_GIC and ARG_QEMU_CAPS on separate lines.

With the above addressed,

  Reviewed-by: Andrea Bolognani <abologna@redhat.com>


-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Patch

diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index e60c69872a..3b5314df78 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -175,11 +175,10 @@  mymain(void)
 
     cfg = virQEMUDriverGetConfig(&driver);
 
-# define DO_TEST_FULL(name, when, gic, ...) \
+# define DO_TEST_FULL(name, when, ...) \
     do { \
         if (testQemuInfoSetArgs(&info, capslatest, \
-                                ARG_GIC, gic, \
-                                ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST, \
+                                __VA_ARGS__, \
                                 ARG_END) < 0 || \
             qemuTestCapsCacheInsert(driver.qemuCapsCache, info.qemuCaps) < 0) { \
             VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \
@@ -211,7 +210,7 @@  mymain(void)
 # define NONE QEMU_CAPS_LAST
 
 # define DO_TEST(name, ...) \
-    DO_TEST_FULL(name, WHEN_BOTH, GIC_NONE, __VA_ARGS__)
+    DO_TEST_FULL(name, WHEN_BOTH, ARG_QEMU_CAPS, __VA_ARGS__, QEMU_CAPS_LAST)
 
 
 
@@ -490,17 +489,22 @@  mymain(void)
     DO_TEST("blkdeviotune-max-length", NONE);
     DO_TEST("controller-usb-order", NONE);
 
-    DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE, GIC_NONE, NONE);
-    DO_TEST_FULL("seclabel-dynamic-override", WHEN_INACTIVE, GIC_NONE, NONE);
-    DO_TEST_FULL("seclabel-dynamic-labelskip", WHEN_INACTIVE, GIC_NONE, NONE);
-    DO_TEST_FULL("seclabel-dynamic-relabel", WHEN_INACTIVE, GIC_NONE, NONE);
+    DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE,
+            ARG_QEMU_CAPS, QEMU_CAPS_LAST);
+    DO_TEST_FULL("seclabel-dynamic-override", WHEN_INACTIVE,
+            ARG_QEMU_CAPS, QEMU_CAPS_LAST, NONE);
+    DO_TEST_FULL("seclabel-dynamic-labelskip", WHEN_INACTIVE,
+            ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("seclabel-dynamic-relabel", WHEN_INACTIVE,
+            ARG_QEMU_CAPS, NONE);
     DO_TEST("seclabel-static", NONE);
     DO_TEST("seclabel-static-labelskip", NONE);
     DO_TEST("seclabel-none", NONE);
     DO_TEST("seclabel-dac-none", NONE);
     DO_TEST("seclabel-dynamic-none", NONE);
     DO_TEST("seclabel-device-multiple", NONE);
-    DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE, GIC_NONE, NONE);
+    DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE,
+            ARG_QEMU_CAPS, NONE);
     DO_TEST("numad-static-vcpu-no-numatune", NONE);
 
     DO_TEST("disk-scsi-lun-passthrough-sgio",
@@ -1048,27 +1052,48 @@  mymain(void)
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
             QEMU_CAPS_VNC);
 
-    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-none-tcg", WHEN_BOTH, GIC_BOTH, NONE);
-    DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH, GIC_NONE, NONE);
-    DO_TEST_FULL("aarch64-gic-default-v2", WHEN_BOTH, GIC_V2, NONE);
-    DO_TEST_FULL("aarch64-gic-default-v3", WHEN_BOTH, GIC_V3, NONE);
-    DO_TEST_FULL("aarch64-gic-default-both", 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_FULL("aarch64-gic-none", WHEN_BOTH,
+                 ARG_GIC, GIC_NONE, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-none-v2", WHEN_BOTH,
+                 ARG_GIC, GIC_V2, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-none-v3", WHEN_BOTH,
+                 ARG_GIC, GIC_V3, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-none-both", WHEN_BOTH,
+                 ARG_GIC, GIC_BOTH, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-none-tcg", WHEN_BOTH,
+                 ARG_GIC, GIC_BOTH, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-default", WHEN_BOTH,
+                 ARG_GIC, GIC_NONE, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-default-v2", WHEN_BOTH,
+                 ARG_GIC, GIC_V2, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-default-v3", WHEN_BOTH,
+                 ARG_GIC, GIC_V3, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-default-both", WHEN_BOTH,
+                 ARG_GIC, GIC_BOTH, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH,
+                 ARG_GIC, GIC_NONE, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH,
+                 ARG_GIC, GIC_V2, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH,
+                 ARG_GIC, GIC_V3, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v2", WHEN_BOTH,
+                 ARG_GIC, GIC_BOTH, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH,
+                 ARG_GIC, GIC_NONE, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH,
+                 ARG_GIC, GIC_V2, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH,
+                 ARG_GIC, GIC_V3, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-v3", WHEN_BOTH,
+                 ARG_GIC, GIC_BOTH, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH,
+                 ARG_GIC, GIC_NONE, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH,
+                 ARG_GIC, GIC_V2, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH,
+                 ARG_GIC, GIC_V3, ARG_QEMU_CAPS, NONE);
+    DO_TEST_FULL("aarch64-gic-host", WHEN_BOTH,
+                 ARG_GIC, GIC_BOTH, ARG_QEMU_CAPS, NONE);
 
     DO_TEST("memory-hotplug", NONE);
     DO_TEST("memory-hotplug-nonuma", NONE);