|
|
c480ed |
From d87b6566d14526883e9439ebd3f922fc7ed22abb Mon Sep 17 00:00:00 2001
|
|
|
c480ed |
Message-Id: <d87b6566d14526883e9439ebd3f922fc7ed22abb@dist-git>
|
|
|
c480ed |
From: Bjoern Walk <bwalk@linux.ibm.com>
|
|
|
c480ed |
Date: Wed, 17 Apr 2019 14:46:00 +0200
|
|
|
c480ed |
Subject: [PATCH] tests: qemuxml2argv: add CAPS_ARCH_LATEST macro
|
|
|
c480ed |
MIME-Version: 1.0
|
|
|
c480ed |
Content-Type: text/plain; charset=UTF-8
|
|
|
c480ed |
Content-Transfer-Encoding: 8bit
|
|
|
c480ed |
|
|
|
c480ed |
Testing with the latest capabilities is possible with the x86_64 centric
|
|
|
c480ed |
implemented macro CAPS_LATEST. The new macro CAPS_ARCH_LATEST provides
|
|
|
c480ed |
the user the ability to specify the desired architecture when testing with
|
|
|
c480ed |
the latest capabilities.
|
|
|
c480ed |
|
|
|
c480ed |
Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
|
|
|
c480ed |
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
|
|
|
c480ed |
(cherry picked from commit bc4c83838d51f42b86d189280c9011494ef435f0)
|
|
|
c480ed |
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
|
|
c480ed |
|
|
|
c480ed |
RHEL 8.1: https://bugzilla.redhat.com/show_bug.cgi?id=1698855
|
|
|
c480ed |
Message-Id: <c75aeb78417e458e1fc0c9a5994e4d462cf1c0a0.1555505143.git.jtomko@redhat.com>
|
|
|
c480ed |
|
|
|
c480ed |
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
|
|
c480ed |
---
|
|
|
c480ed |
tests/qemuxml2argvtest.c | 31 +++++++++++++++++++++++--------
|
|
|
c480ed |
1 file changed, 23 insertions(+), 8 deletions(-)
|
|
|
c480ed |
|
|
|
c480ed |
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
|
|
|
c480ed |
index 690a39054e..abb256c913 100644
|
|
|
c480ed |
--- a/tests/qemuxml2argvtest.c
|
|
|
c480ed |
+++ b/tests/qemuxml2argvtest.c
|
|
|
c480ed |
@@ -623,10 +623,11 @@ testCompareXMLToArgv(const void *data)
|
|
|
c480ed |
static int
|
|
|
c480ed |
mymain(void)
|
|
|
c480ed |
{
|
|
|
c480ed |
- int ret = 0;
|
|
|
c480ed |
+ int ret = 0, i;
|
|
|
c480ed |
char *fakerootdir;
|
|
|
c480ed |
bool skipLegacyCPUs = false;
|
|
|
c480ed |
- char *capslatest_x86_64 = NULL;
|
|
|
c480ed |
+ const char *archs[] = { "x86_64", "s390x" };
|
|
|
c480ed |
+ virHashTablePtr capslatest = NULL;
|
|
|
c480ed |
|
|
|
c480ed |
if (VIR_STRDUP_QUIET(fakerootdir, FAKEROOTDIRTEMPLATE) < 0) {
|
|
|
c480ed |
fprintf(stderr, "Out of memory\n");
|
|
|
c480ed |
@@ -695,12 +696,23 @@ mymain(void)
|
|
|
c480ed |
if (VIR_STRDUP_QUIET(driver.config->memoryBackingDir, "/var/lib/libvirt/qemu/ram") < 0)
|
|
|
c480ed |
return EXIT_FAILURE;
|
|
|
c480ed |
|
|
|
c480ed |
- if (!(capslatest_x86_64 = testQemuGetLatestCapsForArch(abs_srcdir "/qemucapabilitiesdata",
|
|
|
c480ed |
- "x86_64", "xml")))
|
|
|
c480ed |
+ capslatest = virHashCreate(4, virHashValueFree);
|
|
|
c480ed |
+ if (!capslatest)
|
|
|
c480ed |
return EXIT_FAILURE;
|
|
|
c480ed |
|
|
|
c480ed |
- VIR_TEST_VERBOSE("\nlatest caps x86_64: %s\n", capslatest_x86_64);
|
|
|
c480ed |
+ VIR_TEST_VERBOSE("\n");
|
|
|
c480ed |
|
|
|
c480ed |
+ for (i = 0; i < ARRAY_CARDINALITY(archs); ++i) {
|
|
|
c480ed |
+ char *cap = testQemuGetLatestCapsForArch(abs_srcdir "/qemucapabilitiesdata",
|
|
|
c480ed |
+ archs[i], "xml");
|
|
|
c480ed |
+
|
|
|
c480ed |
+ if (!cap || virHashAddEntry(capslatest, archs[i], cap) < 0)
|
|
|
c480ed |
+ return EXIT_FAILURE;
|
|
|
c480ed |
+
|
|
|
c480ed |
+ VIR_TEST_VERBOSE("latest caps for %s: %s\n", archs[i], cap);
|
|
|
c480ed |
+ }
|
|
|
c480ed |
+
|
|
|
c480ed |
+ VIR_TEST_VERBOSE("\n");
|
|
|
c480ed |
|
|
|
c480ed |
/**
|
|
|
c480ed |
* The following set of macros allows testing of XML -> argv conversion with a
|
|
|
c480ed |
@@ -748,9 +760,12 @@ mymain(void)
|
|
|
c480ed |
# define DO_TEST_CAPS_VER(name, ver) \
|
|
|
c480ed |
DO_TEST_CAPS_ARCH_VER(name, "x86_64", ver)
|
|
|
c480ed |
|
|
|
c480ed |
+# define DO_TEST_CAPS_ARCH_LATEST(name, arch) \
|
|
|
c480ed |
+ DO_TEST_CAPS_INTERNAL(name, arch "-latest", NULL, 0, 0, arch, \
|
|
|
c480ed |
+ virHashLookup(capslatest, arch), true)
|
|
|
c480ed |
+
|
|
|
c480ed |
# define DO_TEST_CAPS_LATEST(name) \
|
|
|
c480ed |
- DO_TEST_CAPS_INTERNAL(name, "x86_64-latest", NULL, 0, 0, "x86_64", \
|
|
|
c480ed |
- capslatest_x86_64, true)
|
|
|
c480ed |
+ DO_TEST_CAPS_ARCH_LATEST(name, "x86_64")
|
|
|
c480ed |
|
|
|
c480ed |
/**
|
|
|
c480ed |
* The following test macros should be used only in cases when the tests require
|
|
|
c480ed |
@@ -2966,7 +2981,7 @@ mymain(void)
|
|
|
c480ed |
VIR_FREE(driver.config->nbdTLSx509certdir);
|
|
|
c480ed |
qemuTestDriverFree(&driver);
|
|
|
c480ed |
VIR_FREE(fakerootdir);
|
|
|
c480ed |
- VIR_FREE(capslatest_x86_64);
|
|
|
c480ed |
+ virHashFree(capslatest);
|
|
|
c480ed |
|
|
|
c480ed |
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
|
|
c480ed |
}
|
|
|
c480ed |
--
|
|
|
c480ed |
2.21.0
|
|
|
c480ed |
|