[PATCH 5/9] tests: report errors in QEMU XML->startup XML tests

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

 



Now that the function is only run if requested by
the FLAG_STEAL_VM flag, we know that missing data
is an error, not a request to skip the test.

The existence of the output file is now checked by
virTestCompareToFile, which allows usage of
the VIR_TEST_REGENERATE_OUTPUT=1 env variable
to generate new test cases.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 tests/qemuxml2argvtest.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 54eede5b38..56c4c18850 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -444,18 +444,15 @@ testCompareXMLToStartupXML(const void *data)
     char *actual = NULL;
     int ret = -1;
 
-    if (!info->vm)
-        return EXIT_AM_SKIP;
+    if (!info->vm) {
+        VIR_TEST_DEBUG("VM object missing. Did the args conversion succeed?");
+        return -1;
+    }
 
     if (virAsprintf(&xml, "%s/qemuxml2startupxmloutdata/%s.xml",
                     abs_srcdir, info->name) < 0)
         goto cleanup;
 
-    if (!virFileExists(xml)) {
-        ret = EXIT_AM_SKIP;
-        goto cleanup;
-    }
-
     if (!(actual = virDomainDefFormat(info->vm->def, NULL, format_flags)))
         goto cleanup;
 
-- 
2.16.4

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux