[PATCH v4 11/13] networkxml2conftest: Check if capabilities were created successfully

Michal Privoznik mprivozn at redhat.com
Mon Jan 17 15:19:25 UTC 2022


Now that looking up dnsmasq is handled/mocked we can start
checking whether dnsmasq capabilities were built successfully and
error out if that wasn't the case.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 tests/networkxml2conftest.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index f96a92b9f0..6bc0c1465e 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -114,7 +114,10 @@ mymain(void)
     int ret = 0;
     g_autoptr(dnsmasqCaps) full = NULL;
 
-    full = dnsmasqCapsNewFromBinary();
+    if (!(full = dnsmasqCapsNewFromBinary())) {
+        fprintf(stderr, "failed to create the fake capabilities");
+        return EXIT_FAILURE;
+    }
 
 #define DO_TEST(xname, xcaps) \
     do { \
-- 
2.34.1




More information about the libvir-list mailing list