diff mbox series

[v2,3/6] tests: qemuxml2xml: Convert virtio-*transitional to TEST_CAPS

Message ID d2aef8a0c8f8a26bd50fd04b17b77f8a126dd01d.1555369583.git.crobinso@redhat.com
State Accepted
Commit 7339f4d79bc6c91eee4828049ac13522f633796d
Headers show
Series tests: qemuxml2xml: add DO_TEST_CAPS* | expand

Commit Message

Cole Robinson April 15, 2019, 11:09 p.m. UTC
Convert these test cases to use DO_TEST_CAPS_LATEST

* virtio-transitional
* virtio-non-transitional

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

---
 ...virtio-non-transitional.x86_64-latest.xml} |  0
 ... => virtio-transitional.x86_64-latest.xml} |  0
 tests/qemuxml2xmltest.c                       | 20 ++-----------------
 3 files changed, 2 insertions(+), 18 deletions(-)
 rename tests/qemuxml2xmloutdata/{virtio-non-transitional.xml => virtio-non-transitional.x86_64-latest.xml} (100%)
 rename tests/qemuxml2xmloutdata/{virtio-transitional.xml => virtio-transitional.x86_64-latest.xml} (100%)

-- 
2.21.0

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

Comments

Andrea Bolognani April 16, 2019, 8:58 a.m. UTC | #1
On Mon, 2019-04-15 at 19:09 -0400, Cole Robinson wrote:
[...]
> +    DO_TEST_CAPS_LATEST("virtio-transitional");

> +    DO_TEST_CAPS_LATEST("virtio-non-transitional");


We should also add

  DO_TEST_CAPS_VER("virtio-transitional", "3.1.0");
  DO_TEST_CAPS_VER("virtio-non-transitional", "3.1.0");

same as xml2argv. You can do that in a separate patch, though.

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
Cole Robinson April 16, 2019, 4:51 p.m. UTC | #2
On 4/16/19 4:58 AM, Andrea Bolognani wrote:
> On Mon, 2019-04-15 at 19:09 -0400, Cole Robinson wrote:

> [...]

>> +    DO_TEST_CAPS_LATEST("virtio-transitional");

>> +    DO_TEST_CAPS_LATEST("virtio-non-transitional");

> 

> We should also add

> 

>   DO_TEST_CAPS_VER("virtio-transitional", "3.1.0");

>   DO_TEST_CAPS_VER("virtio-non-transitional", "3.1.0");

> 

> same as xml2argv. You can do that in a separate patch, though.

> 

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

> 


Hmm I'm not sure if those bits will actually test any different code
paths for xml2xml? I'd check coverage output but lcov is broken with
gcc9 on f30

Anyways thanks for the reviews, I've pushed these now

Thanks,
Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Andrea Bolognani April 17, 2019, 7:11 a.m. UTC | #3
On Tue, 2019-04-16 at 12:51 -0400, Cole Robinson wrote:
> On 4/16/19 4:58 AM, Andrea Bolognani wrote:

> > On Mon, 2019-04-15 at 19:09 -0400, Cole Robinson wrote:

> > [...]

> > > +    DO_TEST_CAPS_LATEST("virtio-transitional");

> > > +    DO_TEST_CAPS_LATEST("virtio-non-transitional");

> > 

> > We should also add

> > 

> >   DO_TEST_CAPS_VER("virtio-transitional", "3.1.0");

> >   DO_TEST_CAPS_VER("virtio-non-transitional", "3.1.0");

> > 

> > same as xml2argv. You can do that in a separate patch, though.

> 

> Hmm I'm not sure if those bits will actually test any different code

> paths for xml2xml? I'd check coverage output but lcov is broken with

> gcc9 on f30


You're right, the only difference between the output files would be
the machine type. Never mind, then :)

-- 
Andrea Bolognani / Red Hat / Virtualization

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

Patch

diff --git a/tests/qemuxml2xmloutdata/virtio-non-transitional.xml b/tests/qemuxml2xmloutdata/virtio-non-transitional.x86_64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/virtio-non-transitional.xml
rename to tests/qemuxml2xmloutdata/virtio-non-transitional.x86_64-latest.xml
diff --git a/tests/qemuxml2xmloutdata/virtio-transitional.xml b/tests/qemuxml2xmloutdata/virtio-transitional.x86_64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/virtio-transitional.xml
rename to tests/qemuxml2xmloutdata/virtio-transitional.x86_64-latest.xml
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index aac050f559..20aaa1b9f5 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1319,24 +1319,8 @@  mymain(void)
     DO_TEST("riscv64-virt-pci",
             QEMU_CAPS_OBJECT_GPEX);
 
-    DO_TEST("virtio-transitional",
-            QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
-            QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
-            QEMU_CAPS_DEVICE_VIRTIO_RNG,
-            QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY,
-            QEMU_CAPS_DEVICE_VHOST_VSOCK,
-            QEMU_CAPS_VIRTIO_INPUT_HOST,
-            QEMU_CAPS_VIRTIO_SCSI);
-    DO_TEST("virtio-non-transitional",
-            QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
-            QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
-            QEMU_CAPS_DEVICE_VIRTIO_RNG,
-            QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY,
-            QEMU_CAPS_DEVICE_VHOST_VSOCK,
-            QEMU_CAPS_VIRTIO_INPUT_HOST,
-            QEMU_CAPS_VIRTIO_SCSI);
+    DO_TEST_CAPS_LATEST("virtio-transitional");
+    DO_TEST_CAPS_LATEST("virtio-non-transitional");
 
     if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
         virFileDeleteTree(fakerootdir);