[PATCH 09/24] tests: Add support for multiple variants of data for the same qemu version+architecture

Martin Kletzander mkletzan at redhat.com
Tue Mar 21 14:39:21 UTC 2023


On Thu, Mar 16, 2023 at 05:11:38PM +0100, Peter Krempa wrote:
>'qemucapabilitiestest' and other users of the capability data can
>benefit from adding a discriminator string to have multiple instances
>for the same version+architecture tuple.
>
>This will in the future allow us to have specific capability versions
>for test cases which require a specific host feature or are based on a
>different operating system.
>
>Add the basic skeleton for parsing the variant string and passing it
>around into test cases.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> tests/domaincapstest.c                |  5 +++++
> tests/qemucapabilitiesdata/README.rst | 17 ++++++++++++++++-
> tests/qemucapabilitiesnumbering.c     |  5 ++++-
> tests/qemucapabilitiestest.c          | 15 +++++++++------
> tests/qemucaps2xmltest.c              |  9 ++++++---
> tests/testutilsqemu.c                 | 12 +++++++++++-
> tests/testutilsqemu.h                 |  1 +
> 7 files changed, 52 insertions(+), 12 deletions(-)
>
>diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
>index fbbed40c96..20163e0a72 100644
>--- a/tests/domaincapstest.c
>+++ b/tests/domaincapstest.c
>@@ -312,11 +312,16 @@ doTestQemu(const char *inputDir G_GNUC_UNUSED,
>            const char *prefix G_GNUC_UNUSED,
>            const char *version,
>            const char *arch,
>+           const char *variant,
>            const char *suffix G_GNUC_UNUSED,
>            void *opaque)
> {
>     int ret = 0;
>
>+    /* currently variant tests are not handled here */
>+    if (STRNEQ(variant, ""))
>+        return 0;
>+
>     if (STREQ(arch, "x86_64")) {
>         /* For x86_64 we test three combinations:
>          *
>diff --git a/tests/qemucapabilitiesdata/README.rst b/tests/qemucapabilitiesdata/README.rst
>index 0bf6c97284..749d59becf 100644
>--- a/tests/qemucapabilitiesdata/README.rst
>+++ b/tests/qemucapabilitiesdata/README.rst
>@@ -17,7 +17,7 @@ Naming
>
> Files in this directory have the following naming scheme::
>
>-  caps_$QEMUVERSION_$ARCHITECTURE.$SUFFIX
>+  caps_$QEMUVERSION_$ARCHITECTURE$VARIANT.$SUFFIX
>

I presume you are not describing it as:

caps_$QEMUVERSION_$ARCHITECTURE+$VARIANT.$SUFFIX

because you want the easier parsing/formatting, but it's a bit confusing
when other things are separated clearly.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230321/d7c3efaa/attachment.sig>


More information about the libvir-list mailing list