From: Michal Privoznik Date: Tue, 27 Jan 2026 15:43:06 +0000 (+0100) Subject: networkxml2xmltest: Sync test cases with networkxml2conftest X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee8381e7290ab244ea588b706c204fe9f145f998;p=thirdparty%2Flibvirt.git networkxml2xmltest: Sync test cases with networkxml2conftest The networkxml2xmltest does basic parse -> format tests. The networkxml2conftest does parse -> conf tests. Now, majority of XMLs are the same. That is, output XMLs of networkxml2xmltest and input XMls of networkxml2conftest. There are only a few differences. This is actually great, because it will allow either tests to do both test cases. There are some (subtle) differences in individual test cases though: 1) some test cases exist only in networkxml2conftest and not networkxml2xmltest, or 2) some test cases in networkxml2conftest have more values, i.e. extra elements, extra attributes. or 3) some test cases in networkxml2conftest have less values. For cases from 1) they were just copied over. For cases from 2) those extra elements/attributes were added, and for cases from 3) those extra attributes were removed (to minimize changes to .conf files in near future). One caveat though: networkxml2xmlupdatetest uses input XMLs of networkxml2xmltest too (hence changes under networkxml2xmlupdateout/ dir). This means that the "delete-srv-record-protocol" test started failing, because the input network XML now has more records than the test case anticipated. But this is easy to fix - hence seemingly unrelated change under networkxml2xmlupdatein/ dir. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf index bd560ba3f4..4757f824da 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf +++ b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf @@ -15,5 +15,5 @@ dhcp-authoritative dhcp-lease-max=253 dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts -dhcp-range=fc00:db8:ac10:fe01::1,ra-only +dhcp-range=2001:db8:ac10:fe01::1,ra-only dhcp-range=fc00:db8:ac10:fd01::1,ra-only diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml index 13b1c247d5..83838d01d3 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml @@ -17,7 +17,7 @@ - + diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.conf b/tests/networkxml2confdata/nat-network-dns-srv-record.conf index 22bf3b1de9..c83148cc0a 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record.conf +++ b/tests/networkxml2confdata/nat-network-dns-srv-record.conf @@ -8,7 +8,7 @@ strict-order except-interface=lo bind-dynamic interface=virbr0 -srv-host=_name._tcp.test-domain-name.com,test.example.com,1111,11,111 +srv-host=_name._tcp.test-domain-name srv-host=_name2._udp,test2.example.com,2222,22,222 srv-host=_name3._tcp.test3.com,test3.example.com,3333,33 srv-host=_name4._tcp.test4.com,test4.example.com,4444 diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.xml b/tests/networkxml2confdata/nat-network-dns-srv-record.xml index d01b331fb1..0369f4caa9 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record.xml +++ b/tests/networkxml2confdata/nat-network-dns-srv-record.xml @@ -6,7 +6,7 @@ - + diff --git a/tests/networkxml2xmlin/dhcp6-nat-network.xml b/tests/networkxml2xmlin/dhcp6-nat-network.xml new file mode 100644 index 0000000000..cab0700f2b --- /dev/null +++ b/tests/networkxml2xmlin/dhcp6-nat-network.xml @@ -0,0 +1,27 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmlin/dhcp6-network.xml b/tests/networkxml2xmlin/dhcp6-network.xml new file mode 100644 index 0000000000..ae9ff1f32c --- /dev/null +++ b/tests/networkxml2xmlin/dhcp6-network.xml @@ -0,0 +1,17 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmlin/nat-network-dns-forwarders.xml b/tests/networkxml2xmlin/nat-network-dns-forwarders.xml index dd22b686ab..70123720b9 100644 --- a/tests/networkxml2xmlin/nat-network-dns-forwarders.xml +++ b/tests/networkxml2xmlin/nat-network-dns-forwarders.xml @@ -6,7 +6,8 @@ - + + diff --git a/tests/networkxml2xmlin/nat-network-dns-hosts.xml b/tests/networkxml2xmlin/nat-network-dns-hosts.xml index c28ebd8c4b..6c027423f4 100644 --- a/tests/networkxml2xmlin/nat-network-dns-hosts.xml +++ b/tests/networkxml2xmlin/nat-network-dns-hosts.xml @@ -3,6 +3,7 @@ 81ff0d90-c91e-6742-64da-4a736edb9a9c + pudding diff --git a/tests/networkxml2xmlin/nat-network-dns-local-domain.xml b/tests/networkxml2xmlin/nat-network-dns-local-domain.xml new file mode 100644 index 0000000000..a92d71f1f2 --- /dev/null +++ b/tests/networkxml2xmlin/nat-network-dns-local-domain.xml @@ -0,0 +1,9 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9c + + + + + + diff --git a/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml index a18afae2fd..83838d01d3 100644 --- a/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml @@ -19,7 +19,7 @@ - + diff --git a/tests/networkxml2xmlin/nat-network-dns-srv-record.xml b/tests/networkxml2xmlin/nat-network-dns-srv-record.xml index 3dd19e6698..0369f4caa9 100644 --- a/tests/networkxml2xmlin/nat-network-dns-srv-record.xml +++ b/tests/networkxml2xmlin/nat-network-dns-srv-record.xml @@ -7,6 +7,12 @@ + + + + + + diff --git a/tests/networkxml2xmlin/nat-network-name-with-quotes.xml b/tests/networkxml2xmlin/nat-network-name-with-quotes.xml new file mode 100644 index 0000000000..eba75d2e2d --- /dev/null +++ b/tests/networkxml2xmlin/nat-network-name-with-quotes.xml @@ -0,0 +1,26 @@ + + default"with"quotes" + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmlin/ptr-domains-auto.xml b/tests/networkxml2xmlin/ptr-domains-auto.xml new file mode 100644 index 0000000000..7fe12dc671 --- /dev/null +++ b/tests/networkxml2xmlin/ptr-domains-auto.xml @@ -0,0 +1,21 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmlout/dhcp6-nat-network.xml b/tests/networkxml2xmlout/dhcp6-nat-network.xml new file mode 100644 index 0000000000..44bb2d1f5d --- /dev/null +++ b/tests/networkxml2xmlout/dhcp6-nat-network.xml @@ -0,0 +1,30 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmlout/dhcp6-network.xml b/tests/networkxml2xmlout/dhcp6-network.xml new file mode 100644 index 0000000000..cabe833e03 --- /dev/null +++ b/tests/networkxml2xmlout/dhcp6-network.xml @@ -0,0 +1,20 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmlout/nat-network-dns-forwarders.xml b/tests/networkxml2xmlout/nat-network-dns-forwarders.xml index 170b043d09..ee8ba7b1dd 100644 --- a/tests/networkxml2xmlout/nat-network-dns-forwarders.xml +++ b/tests/networkxml2xmlout/nat-network-dns-forwarders.xml @@ -9,7 +9,8 @@ - + + diff --git a/tests/networkxml2xmlout/nat-network-dns-hosts.xml b/tests/networkxml2xmlout/nat-network-dns-hosts.xml index 548282e514..f8a609f9cb 100644 --- a/tests/networkxml2xmlout/nat-network-dns-hosts.xml +++ b/tests/networkxml2xmlout/nat-network-dns-hosts.xml @@ -6,6 +6,7 @@ + pudding diff --git a/tests/networkxml2xmlout/nat-network-dns-local-domain.xml b/tests/networkxml2xmlout/nat-network-dns-local-domain.xml new file mode 100644 index 0000000000..33f4bbfc32 --- /dev/null +++ b/tests/networkxml2xmlout/nat-network-dns-local-domain.xml @@ -0,0 +1,12 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9c + + + + + + + + + diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml index 50e968be9d..16032c9af2 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml @@ -20,7 +20,7 @@ - + diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record.xml b/tests/networkxml2xmlout/nat-network-dns-srv-record.xml index 1486fc3224..0f54a72f95 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-record.xml +++ b/tests/networkxml2xmlout/nat-network-dns-srv-record.xml @@ -8,6 +8,12 @@ + + + + + + diff --git a/tests/networkxml2xmlout/nat-network-name-with-quotes.xml b/tests/networkxml2xmlout/nat-network-name-with-quotes.xml new file mode 100644 index 0000000000..c0a9cedc7d --- /dev/null +++ b/tests/networkxml2xmlout/nat-network-name-with-quotes.xml @@ -0,0 +1,27 @@ + + default"with"quotes" + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmlout/ptr-domains-auto.xml b/tests/networkxml2xmlout/ptr-domains-auto.xml new file mode 100644 index 0000000000..fe2047b708 --- /dev/null +++ b/tests/networkxml2xmlout/ptr-domains-auto.xml @@ -0,0 +1,24 @@ + + default + 81ff0d90-c91e-6742-64da-4a736edb9a9b + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 4a4cf329e4..a8dacfe0f3 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -144,6 +144,8 @@ mymain(void) #define DO_TEST_VALIDATE_ERROR(name) \ DO_TEST_FULL(name, 0, TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE) + DO_TEST("dhcp6-network"); + DO_TEST("dhcp6-nat-network"); DO_TEST("dhcp6host-routed-network"); DO_TEST("empty-allow-ipv6"); DO_TEST("isolated-network"); @@ -164,9 +166,11 @@ mymain(void) DO_TEST("nat-network-dns-forward-plain"); DO_TEST("nat-network-dns-forwarders"); DO_TEST("nat-network-dns-forwarder-no-resolv"); + DO_TEST("nat-network-dns-local-domain"); DO_TEST("nat-network-forward-nat-ipv6"); DO_TEST("nat-network-forward-nat-address"); DO_TEST("nat-network-forward-nat-no-address"); + DO_TEST("nat-network-name-with-quotes"); DO_TEST("nat-network-mtu"); DO_TEST("8021Qbh-net"); DO_TEST("direct-net"); @@ -178,7 +182,7 @@ mymain(void) DO_TEST("hostdev"); DO_TEST_FLAGS("hostdev-pf", VIR_NETWORK_XML_INACTIVE); DO_TEST_FLAGS("hostdev-pf-driver-model", VIR_NETWORK_XML_INACTIVE); - + DO_TEST("ptr-domains-auto"); DO_TEST_VALIDATE_ERROR("passthrough-address-crash"); DO_TEST("nat-network-explicit-flood"); DO_TEST("host-bridge-no-flood"); diff --git a/tests/networkxml2xmlupdatein/srv-record-protocol.xml b/tests/networkxml2xmlupdatein/srv-record-protocol.xml index 87478d033b..934a36a9be 100644 --- a/tests/networkxml2xmlupdatein/srv-record-protocol.xml +++ b/tests/networkxml2xmlupdatein/srv-record-protocol.xml @@ -1 +1 @@ - + diff --git a/tests/networkxml2xmlupdateout/nat-network-dns-hosts-modified.xml b/tests/networkxml2xmlupdateout/nat-network-dns-hosts-modified.xml index 8fcaad15d1..3183671376 100644 --- a/tests/networkxml2xmlupdateout/nat-network-dns-hosts-modified.xml +++ b/tests/networkxml2xmlupdateout/nat-network-dns-hosts-modified.xml @@ -5,6 +5,7 @@ + pudding diff --git a/tests/networkxml2xmlupdateout/nat-network-dns-more-hosts.xml b/tests/networkxml2xmlupdateout/nat-network-dns-more-hosts.xml index 7b8a451b67..21e4ebde5f 100644 --- a/tests/networkxml2xmlupdateout/nat-network-dns-more-hosts.xml +++ b/tests/networkxml2xmlupdateout/nat-network-dns-more-hosts.xml @@ -5,6 +5,7 @@ + pudding diff --git a/tests/networkxml2xmlupdateout/nat-network-dns-srv-records.xml b/tests/networkxml2xmlupdateout/nat-network-dns-srv-records.xml index eda9e20333..2bdd9321ff 100644 --- a/tests/networkxml2xmlupdateout/nat-network-dns-srv-records.xml +++ b/tests/networkxml2xmlupdateout/nat-network-dns-srv-records.xml @@ -7,6 +7,12 @@ + + + + + + diff --git a/tests/networkxml2xmlupdateout/nat-network-forward-ifaces.xml b/tests/networkxml2xmlupdateout/nat-network-forward-ifaces.xml index 6b87cd8789..13d1fdfa6d 100644 --- a/tests/networkxml2xmlupdateout/nat-network-forward-ifaces.xml +++ b/tests/networkxml2xmlupdateout/nat-network-forward-ifaces.xml @@ -8,6 +8,12 @@ + + + + + + diff --git a/tests/networkxml2xmlupdateout/nat-network-no-forward-ifaces.xml b/tests/networkxml2xmlupdateout/nat-network-no-forward-ifaces.xml index ae49a3034e..79c97a508f 100644 --- a/tests/networkxml2xmlupdateout/nat-network-no-forward-ifaces.xml +++ b/tests/networkxml2xmlupdateout/nat-network-no-forward-ifaces.xml @@ -5,6 +5,12 @@ + + + + + + diff --git a/tests/networkxml2xmlupdateout/nat-network-no-hosts.xml b/tests/networkxml2xmlupdateout/nat-network-no-hosts.xml index 679575973c..e3c88ff534 100644 --- a/tests/networkxml2xmlupdateout/nat-network-no-hosts.xml +++ b/tests/networkxml2xmlupdateout/nat-network-no-hosts.xml @@ -5,6 +5,7 @@ + pudding diff --git a/tests/networkxml2xmlupdateout/nat-network.xml b/tests/networkxml2xmlupdateout/nat-network.xml index 93bc7db51d..741352ef14 100644 --- a/tests/networkxml2xmlupdateout/nat-network.xml +++ b/tests/networkxml2xmlupdateout/nat-network.xml @@ -5,6 +5,14 @@ + + + + + + + +