]> xenbits.xensource.com Git - libvirt.git/commitdiff
networkxml2conftest: s/lo/lo0/ on non-Linux
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 25 Dec 2016 16:02:50 +0000 (17:02 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 2 Jan 2017 12:30:35 +0000 (13:30 +0100)
After 478ddedc12 a bug is fixed where we wrongly presumed loopack
device name on non-Linux systems. It's lo0. However, the fix is
not reflected in the tests which are failing now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/network/bridge_driver.c
tests/networkxml2conftest.c

index f9022d43c2601e91bee4d21a5838bf739ccf7367..7d340eff024b18e068a22129772bd56bd001f6bc 100644 (file)
@@ -1065,6 +1065,8 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
      */
 
     /* create dnsmasq config file appropriate for this network */
+
+    /* Don't forget to update networkxml2conftest :-) */
     virBufferAsprintf(&configbuf,
                       "##WARNING:  THIS IS AN AUTO-GENERATED FILE. "
                       "CHANGES TO IT ARE LIKELY TO BE\n"
index a80d3b2d45d31f1542fc6e422168a6743872d5c2..7a976f42d8755d4dcf33ae82af5a2eee01f026ce 100644 (file)
@@ -41,10 +41,22 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, dnsmasqCapsPtr
     if (dctx == NULL)
         goto fail;
 
-    if (networkDnsmasqConfContents(obj, pidfile, &actual,
-                        dctx, caps) < 0)
+    if (networkDnsmasqConfContents(obj, pidfile, &actual, dctx, caps) < 0)
         goto fail;
 
+    /* Any changes to this function ^^ should be reflected here too. */
+#ifndef __linux__
+    char * tmp;
+
+    if (!(tmp = virStringReplace(actual,
+                                 "except-interface=lo0\n",
+                                 "except-interface=lo\n")))
+        goto fail;
+    VIR_FREE(actual);
+    actual = tmp;
+    tmp = NULL;
+#endif
+
     if (virTestCompareToFile(actual, outconf) < 0)
         goto fail;