]> xenbits.xensource.com Git - libvirt.git/commitdiff
m4: Introduce STABLE_ORDERING_JANSSON
authorJán Tomko <jtomko@redhat.com>
Tue, 3 Jul 2018 14:46:04 +0000 (16:46 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 18 Jul 2018 15:54:18 +0000 (17:54 +0200)
Add a second check for Jansson >= 2.8, which includes
fixes to preserve ordering of object keys.

Use this constant to guard tests that depend on stable ordering.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
m4/virt-jansson.m4
tests/qemublocktest.c
tests/qemucapabilitiestest.c
tests/qemucommandutiltest.c
tests/qemuhotplugtest.c
tests/qemumigparamstest.c
tests/qemumonitorjsontest.c
tests/virjsontest.c
tests/virmacmaptest.c
tests/virnetdaemontest.c

index 206d6a5ceda4850604ba79c460111578108628ce..ab4c020f62ec5e57c2e84727c1405eb869381b94 100644 (file)
@@ -22,6 +22,9 @@ AC_DEFUN([LIBVIRT_ARG_JANSSON],[
 AC_DEFUN([LIBVIRT_CHECK_JANSSON],[
   dnl Jansson http://www.digip.org/jansson/
   LIBVIRT_CHECK_PKG([JANSSON], [jansson], [2.5])
+  dnl Older versions of Jansson did not preserve the order of object keys
+  dnl use this check to guard the tests that are sensitive to this
+  LIBVIRT_CHECK_PKG([STABLE_ORDERING_JANSSON], [jansson], [2.8], [true])
 ])
 
 AC_DEFUN([LIBVIRT_RESULT_JANSSON],[
index 9a387cf063404068a1acbb52760c429de64011a8..d22b4b754e54710a02859b8394b5a8f47563c330 100644 (file)
@@ -337,6 +337,11 @@ mymain(void)
     char *capslatest_x86_64 = NULL;
     virQEMUCapsPtr caps_x86_64 = NULL;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
     if (qemuTestDriverInit(&driver) < 0)
         return EXIT_FAILURE;
 
index 641ec4f597cfce9daaec74c37f00da730e213258..28f903a88cfe4a63bbfddd9573f90e6de010b601 100644 (file)
@@ -141,6 +141,11 @@ mymain(void)
     int ret = 0;
     testQemuData data;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
 #if !WITH_JANSSON
     fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
     return EXIT_AM_SKIP;
index 8e57a1b79d6f04d9882c77accef4268b34efd8b8..9b13dde63f9329de8d9a9d98e075d1784e8dbf2a 100644 (file)
@@ -76,6 +76,11 @@ mymain(void)
     int ret = 0;
     testQemuCommandBuildObjectFromJSONData data1;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
 #if !WITH_JANSSON
     fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
     return EXIT_AM_SKIP;
index c7bc69ab32dc9309727ad180baa5147cd1a98165..674ba92b27387a8dba87275072208a0c2bce462a 100644 (file)
@@ -589,6 +589,11 @@ mymain(void)
     struct qemuHotplugTestData data = {0};
     struct testQemuHotplugCpuParams cpudata;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
 #if !WITH_JANSSON
     fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
     return EXIT_AM_SKIP;
index b8af68211b6d80e96593a10798a4650f86e89667..5e12430991e94cdca7da08043a0c9849cb9375e6 100644 (file)
@@ -203,6 +203,11 @@ mymain(void)
     virQEMUDriver driver;
     int ret = 0;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
 #if !WITH_JANSSON
     fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
     return EXIT_AM_SKIP;
index c11615f7ac1d56d0b1c671c6f48327cd5f8cb98d..1826c4f29795a6138db2aa19c8ce1c72d1728dce 100644 (file)
@@ -2863,6 +2863,11 @@ mymain(void)
     virJSONValuePtr metaschema = NULL;
     char *metaschemastr = NULL;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
 #if !WITH_JANSSON
     fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
     return EXIT_AM_SKIP;
index d42413d11d46c8943be8aa8adb97e53f822c96a5..d352d370fd7c017fe2d5c26bd24834b3f88f39bc 100644 (file)
@@ -479,6 +479,11 @@ mymain(void)
 {
     int ret = 0;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
 #define DO_TEST_FULL(name, cmd, doc, expect, pass) \
     do { \
         struct testInfo info = { doc, expect, pass }; \
index 6e3e9984d1c5f2f9548f4328e04f6a5938afb2e4..420531dcdb2e42f2c12ef9dc79af02e393a38f90 100644 (file)
@@ -157,6 +157,11 @@ mymain(void)
     int ret = 0;
     virMacMapPtr mgr = NULL;
 
+#if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+#endif
+
 #define DO_TEST_BASIC(f, d, ...) \
     do { \
         const char * const m[] = {__VA_ARGS__, NULL }; \
index cbc961dbaf05f1bd7df36e71d665639cc1226b3c..277fb0638553ebd1e21e6572914c87adcac202f0 100644 (file)
@@ -375,6 +375,11 @@ mymain(void)
     int ret = 0;
     const char *server_names[] = { "testServer0", "testServer1" };
 
+# if !WITH_STABLE_ORDERING_JANSSON
+    fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
+    return EXIT_AM_SKIP;
+# endif
+
     if (virInitialize() < 0 ||
         virEventRegisterDefaultImpl() < 0) {
         virDispatchError(NULL);