From a6f05c5a81bea7781b67b6f81df8da9096fdd21c Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Sun, 25 Dec 2016 17:02:50 +0100 Subject: [PATCH] networkxml2conftest: s/lo/lo0/ on non-Linux 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 --- src/network/bridge_driver.c | 2 ++ tests/networkxml2conftest.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index f9022d43c2..7d340eff02 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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" diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index a80d3b2d45..7a976f42d8 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -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; -- GitLab