diff mbox

[v2,3/6] tests: qemuxml2xml: Allow test cases to pass in qemuCaps

Message ID 67cd8f62bb6bf13952c229bdf0f18be2ea038dbd.1455032128.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson Feb. 9, 2016, 3:58 p.m. UTC
Similar to how we do it for qemuxml2argvtest. This will be used in future
patches.
---
 tests/qemuxml2xmltest.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

-- 
2.5.0

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

Comments

Cole Robinson Feb. 9, 2016, 8:28 p.m. UTC | #1
On 02/09/2016 02:57 PM, Laine Stump wrote:
> On 02/09/2016 10:58 AM, Cole Robinson wrote:

>> Similar to how we do it for qemuxml2argvtest. This will be used in future

>> patches.

>> ---

>>   tests/qemuxml2xmltest.c | 27 ++++++++++++++++-----------

>>   1 file changed, 16 insertions(+), 11 deletions(-)

> 

> My one problem with this patch is that the commit log uses "pass" in a manner

> that the meaning is at first ambiguous (at first I thought "okay, this allows

> the test cases to pass. But weren't they already passing?" Then I reread and

> reparsed.) Maybe say "specify qemuCaps flags in test cases" or something like

> that.

> 

> Otherwise makes sense (and the test cases *do* pass :-)

> 

> ACK.

> 


Fixed the commit message and pushed, thanks

- Cole

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

Patch

diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index ec4aabb..d4e94f0 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -250,12 +250,13 @@  mymain(void)
     /* TODO: test with format probing disabled too */
     driver.config->allowDiskFormatProbing = true;
 
-# define DO_TEST_FULL(name, when)                                              \
+# define DO_TEST_FULL(name, when, ...)                                        \
     do {                                                                       \
         if (testInfoSet(&info, name, when) < 0) {                             \
             VIR_TEST_DEBUG("Failed to generate test data for '%s'", name);    \
             return -1;                                                         \
         }                                                                      \
+        virQEMUCapsSetList(info.qemuCaps, __VA_ARGS__, QEMU_CAPS_LAST);        \
                                                                                \
         if (info.outInactiveName) {                                            \
             if (virtTestRun("QEMU XML-2-XML-inactive " name,                   \
@@ -275,8 +276,12 @@  mymain(void)
         testInfoFree(&info);                                                   \
     } while (0)
 
+# define NONE QEMU_CAPS_LAST
+
 # define DO_TEST(name) \
-    DO_TEST_FULL(name, WHEN_BOTH)
+    DO_TEST_FULL(name, WHEN_BOTH, NONE)
+
+
 
     /* Unset or set all envvars here that are copied in qemudBuildCommandLine
      * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected
@@ -381,9 +386,9 @@  mymain(void)
     DO_TEST("disk-virtio-scsi-ioeventfd");
     DO_TEST("disk-scsi-megasas");
     DO_TEST("disk-mirror-old");
-    DO_TEST_FULL("disk-mirror", WHEN_ACTIVE);
-    DO_TEST_FULL("disk-mirror", WHEN_INACTIVE);
-    DO_TEST_FULL("disk-active-commit", WHEN_ACTIVE);
+    DO_TEST_FULL("disk-mirror", WHEN_ACTIVE, NONE);
+    DO_TEST_FULL("disk-mirror", WHEN_INACTIVE, NONE);
+    DO_TEST_FULL("disk-active-commit", WHEN_ACTIVE, NONE);
     DO_TEST("graphics-listen-network");
     DO_TEST("graphics-vnc");
     DO_TEST("graphics-vnc-websocket");
@@ -478,17 +483,17 @@  mymain(void)
     DO_TEST("blkdeviotune");
     DO_TEST("controller-usb-order");
 
-    DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE);
-    DO_TEST_FULL("seclabel-dynamic-override", WHEN_INACTIVE);
-    DO_TEST_FULL("seclabel-dynamic-labelskip", WHEN_INACTIVE);
-    DO_TEST_FULL("seclabel-dynamic-relabel", WHEN_INACTIVE);
+    DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE, NONE);
+    DO_TEST_FULL("seclabel-dynamic-override", WHEN_INACTIVE, NONE);
+    DO_TEST_FULL("seclabel-dynamic-labelskip", WHEN_INACTIVE, NONE);
+    DO_TEST_FULL("seclabel-dynamic-relabel", WHEN_INACTIVE, NONE);
     DO_TEST("seclabel-static");
-    DO_TEST_FULL("seclabel-static-labelskip", WHEN_ACTIVE);
+    DO_TEST_FULL("seclabel-static-labelskip", WHEN_ACTIVE, NONE);
     DO_TEST("seclabel-none");
     DO_TEST("seclabel-dac-none");
     DO_TEST("seclabel-dynamic-none");
     DO_TEST("seclabel-device-multiple");
-    DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE);
+    DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE, NONE);
     DO_TEST("numad-static-vcpu-no-numatune");
     DO_TEST("disk-scsi-lun-passthrough-sgio");