[PATCH 2/5] tests: qemuxml2argv: fail also on unexpected pass

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

 



If a test expects either a parse error or a failure but then there is
neither a parse error nor a failure, then properly mark the test as
failing, instead of failing later on (e.g. trying to open a
non-existing .args file).

Signed-off-by: Pino Toscano <ptoscano@xxxxxxxxxx>
---
 tests/qemuxml2argvtest.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 8aac919c8..3f7d1db3e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -463,6 +463,10 @@ testCompareXMLToArgv(const void *data)
             goto ok;
         goto cleanup;
     }
+    if (flags & FLAG_EXPECT_PARSE_ERROR) {
+        VIR_TEST_DEBUG("passed instead of expected parse error");
+        goto cleanup;
+    }
     priv = vm->privateData;
 
     if (virBitmapParse("0-3", &priv->autoNodeset, 4) < 0)
@@ -502,6 +506,10 @@ testCompareXMLToArgv(const void *data)
             goto ok;
         goto cleanup;
     }
+    if (flags & FLAG_EXPECT_FAILURE) {
+        VIR_TEST_DEBUG("passed instead of expected failure");
+        goto cleanup;
+    }
 
     if (!(actualargv = virCommandToString(cmd)))
         goto cleanup;
-- 
2.13.5

--
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