From nobody Mon Feb 2 07:30:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769611987; cv=none; d=zohomail.com; s=zohoarc; b=QbV59t8KOyPHFqq6CMKlyWLklrjmdoxcJpWM1XjTneEA0+S25NTJy0EanbbuhHCFJgW5qV2km7gV+n/Msdo8JX8Bot8ztAJJpP3eUvIafiu/07rsJdswSgDGKtA9/QJuJR4LQOYW/DMlI2Yb3670mxqnBp1NXDZrAXodxjWbJms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769611987; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=w0bGwzy6Z+h0cDMEu7Q/Lj5CenbT7BwDZy9eR+KHk8s=; b=je/ny3tYLobqWdqTb4PJa+aVsxJPZx+UCUUpdIRYT5M74iYmXJaaHIRZv5e/mU2XArG0dnKCD33y+WIF9hVFHCOjJ3Rd33GK9/TK/q6H4Uzo/1SAlSlbSI9fDm7xcuDRs0Vnx/IMl1xEeCmQnKQOMWlqF79dhjQqBvpHyVOWeYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769611987209274.78425062660904; Wed, 28 Jan 2026 06:53:07 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 8D6A94195C; Wed, 28 Jan 2026 09:53:06 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id C29444418D; Wed, 28 Jan 2026 09:38:54 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 633FB43EF2; Wed, 28 Jan 2026 09:38:50 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 34BEC43F22 for ; Wed, 28 Jan 2026 09:31:10 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-bR9XZLQLPg-MVjIEX_O3ig-1; Wed, 28 Jan 2026 09:31:07 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1836C19373DA for ; Wed, 28 Jan 2026 14:31:06 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 74B7619541AA for ; Wed, 28 Jan 2026 14:31:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769610669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w0bGwzy6Z+h0cDMEu7Q/Lj5CenbT7BwDZy9eR+KHk8s=; b=NoDT1BNa7y6qL8Xp/NK25idgoZg91TC8H9avxq2muLoZqLSCvrn1waJhSWVuE6ds8OFRLZ TAsY6mNQqAmzLMkzMYt26yqbTOcnQrvUrtwL6TYtN0ZUX3QHV7Z1OG7XekO5ci2eO0/4lB 6Cnc8shz4DNkXYM34Diobp8ssBGs2iA= X-MC-Unique: bR9XZLQLPg-MVjIEX_O3ig-1 X-Mimecast-MFC-AGG-ID: bR9XZLQLPg-MVjIEX_O3ig_1769610666 To: devel@lists.libvirt.org Subject: [PATCH 19/20] tests: Drop networkxml2conftest Date: Wed, 28 Jan 2026 15:30:40 +0100 Message-ID: <34f013dfcffa04e472426035db0bf6114b8f3faa.1769610369.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -JcatlXyUHEcKFukeGhCp1YmMrl4SbfWKLyiTz8FfEQ_1769610666 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NQJC722FZQVAL2KPZ2UMPFQVZDDHCUCI X-Message-ID-Hash: NQJC722FZQVAL2KPZ2UMPFQVZDDHCUCI X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769611987969154100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Now that networkxml2xmltest does XML->conf tests the networkxml2conftest is redundant. Drop it. Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 2 +- tests/meson.build | 1 - tests/networkxml2conftest.c | 213 ------------------------------------ 3 files changed, 1 insertion(+), 215 deletions(-) delete mode 100644 tests/networkxml2conftest.c diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 104c298683..665eeecedb 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -1178,7 +1178,7 @@ networkDnsmasqConfContents(virNetworkObj *obj, =20 /* create dnsmasq config file appropriate for this network */ =20 - /* Don't forget to update networkxml2conftest and networkxml2xmltest := -) */ + /* Don't forget to update networkxml2xmltest :-) */ virBufferAsprintf(&configbuf, "##WARNING: THIS IS AN AUTO-GENERATED FILE. " "CHANGES TO IT ARE LIKELY TO BE\n" diff --git a/tests/meson.build b/tests/meson.build index 4b93fb405a..00c81877af 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -407,7 +407,6 @@ endif =20 if conf.has('WITH_NETWORK') tests +=3D [ - { 'name': 'networkxml2conftest', 'include': [ network_inc_dir ], 'link= _with': [ network_driver_impl ] }, { 'name': 'networkxml2firewalltest', 'include': [ network_inc_dir ], '= link_with': [ network_driver_impl ] }, { 'name': 'networkxml2xmltest', 'include': [ network_inc_dir ], 'link_= with': [ network_driver_impl ], }, ] diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c deleted file mode 100644 index c7534773a3..0000000000 --- a/tests/networkxml2conftest.c +++ /dev/null @@ -1,213 +0,0 @@ -#include - -#include - -#include -#include - -#include "internal.h" -#include "testutils.h" -#include "network_conf.h" -#include "viralloc.h" -#include "bridge_driver.h" -#define LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW -#include "bridge_driver_priv.h" -#define LIBVIRT_VIRCOMMANDPRIV_H_ALLOW -#include "vircommandpriv.h" - -#define VIR_FROM_THIS VIR_FROM_NONE - -static int -testCompareXMLToConfFiles(const char *inxml, const char *outconf, - char *outhostsfile, dnsmasqCaps *caps) -{ - char *confactual =3D NULL; - g_autofree char *hostsfileactual =3D NULL; - int ret =3D -1; - virNetworkDef *def =3D NULL; - virNetworkObj *obj =3D NULL; - g_autofree char *pidfile =3D NULL; - g_autoptr(dnsmasqContext) dctx =3D NULL; - g_autoptr(virNetworkXMLOption) xmlopt =3D NULL; - bool compareFailed =3D false; - - if (!(xmlopt =3D networkDnsmasqCreateXMLConf())) - goto fail; - - if (!(obj =3D virNetworkObjNew())) - goto fail; - - if (!(def =3D virNetworkDefParse(NULL, inxml, xmlopt, false))) - goto fail; - - virNetworkObjSetDef(obj, def); - - if (networkValidateTests(def) < 0) - goto fail; - - if (!networkNeedsDnsmasq(def)) { - VIR_TEST_VERBOSE("spurious request to generate conf files. Would n= ot start dnsmasq in real life scenario"); - goto fail; - } - - dctx =3D dnsmasqContextNew(def->name, "/var/lib/libvirt/dnsmasq"); - - if (dctx =3D=3D NULL) - goto fail; - - if (networkDnsmasqConfContents(obj, pidfile, &confactual, - &hostsfileactual, dctx, caps) < 0) - goto fail; - - /* Any changes to this function ^^ should be reflected here too. */ -#ifndef __linux__ - { - char * tmp; - - if (!(tmp =3D virStringReplace(confactual, - "except-interface=3Dlo0\n", - "except-interface=3Dlo\n"))) - goto fail; - VIR_FREE(confactual); - confactual =3D g_steal_pointer(&tmp); - } -#endif - - if (virTestCompareToFile(confactual, outconf) < 0) - compareFailed =3D true; - - if (hostsfileactual) { - if (virTestCompareToFile(hostsfileactual, outhostsfile) < 0) { - compareFailed =3D true; - } - } else { - if (virFileExists(outhostsfile)) { - VIR_TEST_DEBUG("%s: hostsfile exists but the configuration did= not specify any host", - outhostsfile); - compareFailed =3D true; - } - } - - if (compareFailed) - goto fail; - - ret =3D 0; - - fail: - VIR_FREE(confactual); - virNetworkObjEndAPI(&obj); - return ret; -} - -typedef struct { - const char *name; - dnsmasqCaps *caps; -} testInfo; - -static int -testCompareXMLToConfHelper(const void *data) -{ - int result =3D -1; - const testInfo *info =3D data; - g_autofree char *inxml =3D NULL; - g_autofree char *outconf =3D NULL; - g_autofree char *outhostsfile =3D NULL; - - inxml =3D g_strdup_printf("%s/networkxml2confdata/%s.xml", abs_srcdir,= info->name); - outconf =3D g_strdup_printf("%s/networkxml2confdata/%s.conf", abs_srcd= ir, info->name); - outhostsfile =3D g_strdup_printf("%s/networkxml2confdata/%s.hostsfile"= , abs_srcdir, info->name); - - result =3D testCompareXMLToConfFiles(inxml, outconf, outhostsfile, inf= o->caps); - - return result; -} - -static void -buildCapsCallback(const char *const*args, - const char *const*env G_GNUC_UNUSED, - const char *input G_GNUC_UNUSED, - char **output, - char **error G_GNUC_UNUSED, - int *status, - void *opaque G_GNUC_UNUSED) -{ - if (STREQ(args[0], "/usr/sbin/dnsmasq") && STREQ(args[1], "--version")= ) { - *output =3D g_strdup("Dnsmasq version 2.67\n"); - *status =3D EXIT_SUCCESS; - } else { - *status =3D EXIT_FAILURE; - } -} - -static dnsmasqCaps * -buildCaps(void) -{ - g_autoptr(dnsmasqCaps) caps =3D NULL; - g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); - - virCommandSetDryRun(dryRunToken, NULL, true, true, buildCapsCallback, = NULL); - - caps =3D dnsmasqCapsNewFromBinary(); - - return g_steal_pointer(&caps); -} - - -static int -mymain(void) -{ - int ret =3D 0; - g_autoptr(dnsmasqCaps) full =3D NULL; - - if (!(full =3D buildCaps())) { - fprintf(stderr, "failed to create the fake capabilities: %s", - virGetLastErrorMessage()); - return EXIT_FAILURE; - } - -#define DO_TEST(xname, xcaps) \ - do { \ - static testInfo info; \ - \ - info.name =3D xname; \ - info.caps =3D xcaps; \ - if (virTestRun("Network XML-2-Conf " xname, \ - testCompareXMLToConfHelper, &info) < 0) { \ - ret =3D -1; \ - } \ - } while (0) - - DO_TEST("isolated-network", full); - DO_TEST("netboot-network", full); - DO_TEST("netboot-proxy-network", full); - DO_TEST("netboot-tftp", full); - DO_TEST("nat-network-dns-srv-record-minimal", full); - DO_TEST("nat-network-name-with-quotes", full); - DO_TEST("routed-network", full); - DO_TEST("open-network", full); - DO_TEST("nat-network", full); - DO_TEST("nat-network-dns-txt-record", full); - DO_TEST("nat-network-dns-srv-record", full); - DO_TEST("nat-network-dns-hosts", full); - DO_TEST("nat-network-dns-forward-plain", full); - DO_TEST("nat-network-dns-forwarders", full); - DO_TEST("nat-network-dns-forwarder-no-resolv", full); - DO_TEST("nat-network-dns-local-domain", full); - DO_TEST("nat-network-mtu", full); - DO_TEST("dhcp6-network", full); - DO_TEST("dhcp6-nat-network", full); - DO_TEST("dhcp6host-routed-network", full); - DO_TEST("ptr-domains-auto", full); - DO_TEST("dnsmasq-options", full); - DO_TEST("leasetime-seconds", full); - DO_TEST("leasetime-minutes", full); - DO_TEST("leasetime-hours", full); - DO_TEST("leasetime-infinite", full); - - return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIR_TEST_MAIN_PRELOAD(mymain, - VIR_TEST_MOCK("virpci"), - VIR_TEST_MOCK("virrandom"), - VIR_TEST_MOCK("virdnsmasq")) --=20 2.52.0