[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/3] domaincapstest: Give better names to test data files



Signed-off-by: Jiri Denemark <jdenemar redhat com>
---
 .../{domaincaps-basic.xml => basic.xml}            |  0
 .../{domaincaps-full.xml => full.xml}              |  0
 ...ps-qemu_1.6.50-1.xml => qemu_1.6.50.x86_64.xml} |  0
 ...6.0-3.xml => qemu_2.6.0-gicv2-virt.aarch64.xml} |  0
 ...6.0-4.xml => qemu_2.6.0-gicv3-virt.aarch64.xml} |  0
 ...aps-qemu_2.6.0-2.xml => qemu_2.6.0.aarch64.xml} |  0
 ...aps-qemu_2.6.0-5.xml => qemu_2.6.0.ppc64le.xml} |  0
 ...caps-qemu_2.6.0-1.xml => qemu_2.6.0.x86_64.xml} |  0
 tests/domaincapstest.c                             | 27 ++++++++++++++--------
 9 files changed, 18 insertions(+), 9 deletions(-)
 rename tests/domaincapsschemadata/{domaincaps-basic.xml => basic.xml} (100%)
 rename tests/domaincapsschemadata/{domaincaps-full.xml => full.xml} (100%)
 rename tests/domaincapsschemadata/{domaincaps-qemu_1.6.50-1.xml => qemu_1.6.50.x86_64.xml} (100%)
 rename tests/domaincapsschemadata/{domaincaps-qemu_2.6.0-3.xml => qemu_2.6.0-gicv2-virt.aarch64.xml} (100%)
 rename tests/domaincapsschemadata/{domaincaps-qemu_2.6.0-4.xml => qemu_2.6.0-gicv3-virt.aarch64.xml} (100%)
 rename tests/domaincapsschemadata/{domaincaps-qemu_2.6.0-2.xml => qemu_2.6.0.aarch64.xml} (100%)
 rename tests/domaincapsschemadata/{domaincaps-qemu_2.6.0-5.xml => qemu_2.6.0.ppc64le.xml} (100%)
 rename tests/domaincapsschemadata/{domaincaps-qemu_2.6.0-1.xml => qemu_2.6.0.x86_64.xml} (100%)

diff --git a/tests/domaincapsschemadata/domaincaps-basic.xml b/tests/domaincapsschemadata/basic.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-basic.xml
rename to tests/domaincapsschemadata/basic.xml
diff --git a/tests/domaincapsschemadata/domaincaps-full.xml b/tests/domaincapsschemadata/full.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-full.xml
rename to tests/domaincapsschemadata/full.xml
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml b/tests/domaincapsschemadata/qemu_1.6.50.x86_64.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
rename to tests/domaincapsschemadata/qemu_1.6.50.x86_64.xml
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
rename to tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
rename to tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
rename to tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
rename to tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
similarity index 100%
rename from tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
rename to tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index f506739..ecebc82 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -187,7 +187,7 @@ test_virDomainCapsFormat(const void *opaque)
     char *domCapsXML = NULL;
     int ret = -1;
 
-    if (virAsprintf(&path, "%s/domaincapsschemadata/domaincaps-%s.xml",
+    if (virAsprintf(&path, "%s/domaincapsschemadata/%s.xml",
                     abs_srcdir, data->name) < 0)
         goto cleanup;
 
@@ -256,8 +256,16 @@ mymain(void)
 
 #define DO_TEST_QEMU(Name, CapsName, Emulator, Machine, Arch, Type)     \
     do {                                                                \
+        char *name = NULL;                                              \
+        if (virAsprintf(&name, "qemu_%s%s%s.%s",                        \
+                        Name,                                           \
+                        Machine ? "-" : "", Machine ? Machine : "",     \
+                        Arch) < 0) {                                    \
+            ret = -1;                                                   \
+            break;                                                      \
+        }                                                               \
         struct testData data = {                                        \
-            .name = Name,                                               \
+            .name = name,                                               \
             .emulator = Emulator,                                       \
             .machine = Machine,                                         \
             .arch = Arch,                                               \
@@ -266,8 +274,9 @@ mymain(void)
             .capsName = CapsName,                                       \
             .capsOpaque = cfg,                                          \
         };                                                              \
-        if (virtTestRun(Name, test_virDomainCapsFormat, &data) < 0)     \
+        if (virtTestRun(name, test_virDomainCapsFormat, &data) < 0)     \
             ret = -1;                                                   \
+        VIR_FREE(name);                                                 \
     } while (0)
 
     DO_TEST("basic", "/bin/emulatorbin", "my-machine-type",
@@ -277,27 +286,27 @@ mymain(void)
 
 #if WITH_QEMU
 
-    DO_TEST_QEMU("qemu_1.6.50-1", "caps_1.6.50-1",
+    DO_TEST_QEMU("1.6.50", "caps_1.6.50-1",
                  "/usr/bin/qemu-system-x86_64", NULL,
                  "x86_64", VIR_DOMAIN_VIRT_KVM);
 
-    DO_TEST_QEMU("qemu_2.6.0-1", "caps_2.6.0-1",
+    DO_TEST_QEMU("2.6.0", "caps_2.6.0-1",
                  "/usr/bin/qemu-system-x86_64", NULL,
                  "x86_64", VIR_DOMAIN_VIRT_KVM);
 
-    DO_TEST_QEMU("qemu_2.6.0-2", "caps_2.6.0-1",
+    DO_TEST_QEMU("2.6.0", "caps_2.6.0-1",
                  "/usr/bin/qemu-system-aarch64", NULL,
                  "aarch64", VIR_DOMAIN_VIRT_KVM);
 
-    DO_TEST_QEMU("qemu_2.6.0-3", "caps_2.6.0-1",
+    DO_TEST_QEMU("2.6.0-gicv2", "caps_2.6.0-1",
                  "/usr/bin/qemu-system-aarch64", "virt",
                  "aarch64", VIR_DOMAIN_VIRT_KVM);
 
-    DO_TEST_QEMU("qemu_2.6.0-4", "caps_2.6.0-2",
+    DO_TEST_QEMU("2.6.0-gicv3", "caps_2.6.0-2",
                  "/usr/bin/qemu-system-aarch64", "virt",
                  "aarch64", VIR_DOMAIN_VIRT_KVM);
 
-    DO_TEST_QEMU("qemu_2.6.0-5", "caps_2.6.0-1",
+    DO_TEST_QEMU("2.6.0", "caps_2.6.0-1",
                  "/usr/bin/qemu-system-ppc64", NULL,
                  "ppc64le", VIR_DOMAIN_VIRT_KVM);
 
-- 
2.8.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]