]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
networkxml2conftest: Fail tests where no dnsmasq would be spawned
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 27 Jan 2026 20:25:41 +0000 (21:25 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 29 Jan 2026 12:38:37 +0000 (13:38 +0100)
If network config does not require dnsmasq then none is spawned.
Having a test case that would still require generating dnsmasq
config is weird and can lead to spurious results. Just fail such
test case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/networkxml2conftest.c

index aa0adbdd52d2516bb41835990ca404b0c85a1fb6..59ab3a402b515107c7c7d2734eff5f2a538f8738 100644 (file)
@@ -41,6 +41,11 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf,
 
     virNetworkObjSetDef(obj, def);
 
+    if (!networkNeedsDnsmasq(def)) {
+        VIR_TEST_VERBOSE("spurious request to generate conf files. Would not start dnsmasq in real life scenario");
+        goto fail;
+    }
+
     dctx = dnsmasqContextNew(def->name, "/var/lib/libvirt/dnsmasq");
 
     if (dctx == NULL)