[PATCH 00/20] tests: Join networkxml2xmltest and networkxml2conftest into one
This was inspired by seemingly unrelated patches I've sent a month ago: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/WVTYK... I was adding one attribute to an element and had to change three different test XMLs. Anyway, this is also available here: https://gitlab.com/MichalPrivoznik/libvirt/-/tree/network_tests?ref_type=hea... Michal Prívozník (20): tests: Avoid crossdir inclusion for networkxml2* tests network: Separate private APIs declaration to bridge_driver_priv.h network: Move decision on dnsmasq need into a separate function networkxml2conftest: Drop routed-network-no-dns test case networkxml2conftest: Fail tests where no dnsmasq would be spawned networkxml2xmltest: Update couple of test cases network: Introduce networkValidateTests() test: wire up networkValidateTests() networkxml2conftest: Avoid potential leak networkxml2conftest: Allow regenerating hosts file networkxml2conftest: Allow regenerating more in one run networkxml2xmltest: Don't recreate xmlopt object networkxml2xmltest: Introduce testRun() networkxml2xmltest: Move path generation into testRun() networkxml2xmltest: Dynamically allocate testInfo struct networkxml2xmltest: Store parsed def for future tests networkxml2xmltest: Sync test cases with networkxml2conftest networkxml2xmltest: Do conf test tests: Drop networkxml2conftest tests: Rename networkxml2xmltest to networkxmlconftest src/network/bridge_driver.c | 62 ++++- src/network/bridge_driver.h | 15 - .../{bridge_driver.h => bridge_driver_priv.h} | 33 +-- tests/meson.build | 5 +- .../networkxml2confdata/isolated-network.xml | 11 - .../nat-network-dns-hosts.xml | 15 - tests/networkxml2confdata/nat-network-mtu.xml | 22 -- tests/networkxml2confdata/nat-network.xml | 21 -- tests/networkxml2confdata/netboot-network.xml | 14 - .../netboot-proxy-network.xml | 13 - tests/networkxml2confdata/open-network.xml | 9 - tests/networkxml2confdata/routed-network.xml | 9 - tests/networkxml2conftest.c | 200 -------------- tests/networkxml2firewalltest.c | 12 +- tests/networkxml2xmlin/dnsmasq-options.xml | 15 - tests/networkxml2xmlin/hostdev.xml | 10 - tests/networkxml2xmlin/leasetime-hours.xml | 1 - tests/networkxml2xmlin/leasetime-infinite.xml | 1 - tests/networkxml2xmlin/leasetime-minutes.xml | 1 - tests/networkxml2xmlin/leasetime-seconds.xml | 1 - .../nat-network-dns-forward-plain.xml | 9 - .../nat-network-dns-forwarders.xml | 14 - .../nat-network-dns-srv-record.xml | 26 -- .../nat-network-dns-txt-record.xml | 24 -- tests/networkxml2xmlin/netboot-tftp.xml | 1 - .../routed-network-no-dns.xml | 10 - tests/networkxml2xmlout/hostdev.xml | 10 - tests/networkxml2xmlout/leasetime-hours.xml | 1 - .../networkxml2xmlout/leasetime-infinite.xml | 1 - tests/networkxml2xmlout/leasetime-minutes.xml | 1 - tests/networkxml2xmlout/leasetime-seconds.xml | 1 - .../nat-network-dns-forwarder-no-resolv.xml | 11 - tests/networkxml2xmlout/netboot-tftp.xml | 1 - .../passthrough-address-crash.xml | 7 - tests/networkxml2xmlout/passthrough-pf.xml | 9 - .../srv-record-protocol.xml | 2 +- .../nat-network-dns-hosts-modified.xml | 1 + .../nat-network-dns-more-hosts.xml | 1 + .../nat-network-dns-srv-records.xml | 6 + .../nat-network-forward-ifaces.xml | 6 + .../nat-network-no-forward-ifaces.xml | 6 + .../nat-network-no-hosts.xml | 1 + tests/networkxml2xmlupdateout/nat-network.xml | 8 + .../openvswitch-net-modified.xml | 4 +- .../openvswitch-net-more-portgroups.xml | 6 +- .../openvswitch-net-without-alice.xml | 4 +- tests/networkxml2xmlupdatetest.c | 2 +- .../8021Qbh-net.expect.xml} | 3 - .../8021Qbh-net.xml | 3 - .../bandwidth-network.conf} | 10 +- .../bandwidth-network.expect.xml} | 0 .../bandwidth-network.xml | 0 .../dhcp6-nat-network.conf | 0 .../dhcp6-nat-network.expect.xml} | 16 +- .../dhcp6-nat-network.hostsfile | 0 .../dhcp6-nat-network.xml | 0 .../dhcp6-network.conf | 0 .../dhcp6-network.expect.xml} | 5 +- .../dhcp6-network.hostsfile | 0 .../dhcp6-network.xml | 0 .../dhcp6host-routed-network.conf | 0 .../dhcp6host-routed-network.expect.xml} | 0 .../dhcp6host-routed-network.hostsfile | 0 .../dhcp6host-routed-network.xml | 0 .../direct-net.expect.xml} | 0 .../direct-net.xml | 0 .../dnsmasq-options.conf | 0 .../dnsmasq-options.expect.xml} | 1 + .../dnsmasq-options.xml | 0 .../empty-allow-ipv6.expect.xml} | 0 .../empty-allow-ipv6.xml | 0 .../host-bridge-net.expect.xml} | 0 .../host-bridge-net.xml | 0 .../host-bridge-no-flood.expect.xml} | 0 .../host-bridge-no-flood.xml | 0 .../hostdev-duplicate.xml | 0 .../hostdev-pf-driver-model.expect.xml} | 0 .../hostdev-pf-driver-model.xml | 0 .../hostdev-pf.expect.xml} | 0 .../hostdev-pf.xml | 0 .../hostdev.expect.xml} | 4 +- .../hostdev.xml} | 4 +- .../isolated-network.conf | 0 .../isolated-network.expect.xml} | 0 .../isolated-network.xml | 0 .../isolated-ports.expect.xml} | 0 .../isolated-ports.xml | 0 .../leasetime-hours.conf | 0 .../leasetime-hours.expect.xml | 1 + .../leasetime-hours.hostsfile | 0 .../leasetime-hours.xml | 1 + .../leasetime-infinite.conf | 0 .../leasetime-infinite.expect.xml | 1 + .../leasetime-infinite.hostsfile | 0 .../leasetime-infinite.xml | 1 + .../leasetime-minutes.conf | 0 .../leasetime-minutes.expect.xml | 1 + .../leasetime-minutes.hostsfile | 0 .../leasetime-minutes.xml | 1 + .../leasetime-seconds.conf | 0 .../leasetime-seconds.expect.xml | 1 + .../leasetime-seconds.hostsfile | 0 .../leasetime-seconds.xml | 1 + .../metadata.expect.xml} | 0 .../metadata.xml | 0 .../nat-network-dns-forward-plain.conf | 0 .../nat-network-dns-forward-plain.expect.xml} | 1 + .../nat-network-dns-forward-plain.xml | 0 .../nat-network-dns-forwarder-no-resolv.conf | 0 ...etwork-dns-forwarder-no-resolv.expect.xml} | 1 + .../nat-network-dns-forwarder-no-resolv.xml | 0 .../nat-network-dns-forwarders.conf | 0 .../nat-network-dns-forwarders.expect.xml} | 4 +- .../nat-network-dns-forwarders.xml | 2 +- .../nat-network-dns-hosts.conf | 0 .../nat-network-dns-hosts.expect.xml} | 2 + .../nat-network-dns-hosts.xml | 1 + .../nat-network-dns-local-domain.conf | 0 .../nat-network-dns-local-domain.expect.xml} | 3 +- .../nat-network-dns-local-domain.xml | 0 .../nat-network-dns-srv-record-minimal.conf | 2 +- ...network-dns-srv-record-minimal.expect.xml} | 3 +- ...t-network-dns-srv-record-minimal.hostsfile | 0 .../nat-network-dns-srv-record-minimal.xml | 2 +- .../nat-network-dns-srv-record.conf | 2 +- .../nat-network-dns-srv-record.expect.xml} | 7 + .../nat-network-dns-srv-record.hostsfile | 0 .../nat-network-dns-srv-record.xml | 2 +- .../nat-network-dns-srv-records.conf} | 2 + .../nat-network-dns-srv-records.expect.xml} | 1 + .../nat-network-dns-srv-records.hostsfile} | 0 .../nat-network-dns-srv-records.xml | 0 .../nat-network-dns-txt-record.conf | 0 .../nat-network-dns-txt-record.expect.xml} | 1 + .../nat-network-dns-txt-record.hostsfile | 0 .../nat-network-dns-txt-record.xml | 0 .../nat-network-explicit-flood.conf} | 0 .../nat-network-explicit-flood.expect.xml} | 1 + .../nat-network-explicit-flood.hostsfile} | 0 .../nat-network-explicit-flood.xml | 0 .../nat-network-forward-nat-address.conf} | 0 ...at-network-forward-nat-address.expect.xml} | 1 + ...nat-network-forward-nat-address.hostsfile} | 0 .../nat-network-forward-nat-address.xml | 0 .../nat-network-forward-nat-ipv6.conf} | 2 +- .../nat-network-forward-nat-ipv6.expect.xml} | 1 + .../nat-network-forward-nat-ipv6.xml | 0 .../nat-network-forward-nat-no-address.conf} | 0 ...network-forward-nat-no-address.expect.xml} | 1 + ...-network-forward-nat-no-address.hostsfile} | 0 .../nat-network-forward-nat-no-address.xml | 0 .../nat-network-mtu.conf | 0 .../nat-network-mtu.expect.xml} | 1 + .../nat-network-mtu.hostsfile | 0 .../nat-network-mtu.xml | 0 .../nat-network-name-with-quotes.conf | 0 .../nat-network-name-with-quotes.expect.xml} | 3 +- .../nat-network-name-with-quotes.hostsfile | 0 .../nat-network-name-with-quotes.xml | 0 .../nat-network.conf | 0 .../nat-network.expect.xml} | 1 + .../nat-network.hostsfile | 0 .../nat-network.xml | 0 .../netboot-network.conf | 0 .../netboot-network.expect.xml} | 1 + .../netboot-network.xml | 0 .../netboot-proxy-network.conf | 0 .../netboot-proxy-network.expect.xml} | 1 + .../netboot-proxy-network.xml | 0 .../netboot-tftp.conf | 0 .../netboot-tftp.expect.xml | 1 + .../netboot-tftp.xml | 1 + .../open-network-with-forward-dev.xml | 0 .../open-network.conf | 0 .../open-network.expect.xml} | 0 .../open-network.xml | 0 .../openvswitch-net.expect.xml} | 6 +- .../openvswitch-net.xml | 6 +- .../passthrough-address-crash.xml | 0 .../passthrough-duplicate.xml | 0 .../passthrough-pf.conf} | 4 +- .../passthrough-pf.xml | 0 .../ptr-domains-auto.conf | 0 .../ptr-domains-auto.expect.xml} | 10 +- .../ptr-domains-auto.hostsfile | 0 .../ptr-domains-auto.xml | 0 .../routed-network-no-dns-extra-elements.xml | 0 .../routed-network-no-dns.expect.xml} | 0 .../routed-network-no-dns.xml | 0 .../routed-network.conf | 0 .../routed-network.expect.xml} | 0 .../routed-network.xml | 0 .../set-mtu.conf} | 1 + .../set-mtu.expect.xml} | 0 .../set-mtu.xml | 0 .../vepa-net.expect.xml} | 0 .../vepa-net.xml | 0 ...workxml2xmltest.c => networkxmlconftest.c} | 256 +++++++++++++++--- tests/qemuxmlconftest.c | 6 +- tests/virschematest.c | 4 +- 200 files changed, 414 insertions(+), 627 deletions(-) copy src/network/{bridge_driver.h => bridge_driver_priv.h} (33%) delete mode 100644 tests/networkxml2confdata/isolated-network.xml delete mode 100644 tests/networkxml2confdata/nat-network-dns-hosts.xml delete mode 100644 tests/networkxml2confdata/nat-network-mtu.xml delete mode 100644 tests/networkxml2confdata/nat-network.xml delete mode 100644 tests/networkxml2confdata/netboot-network.xml delete mode 100644 tests/networkxml2confdata/netboot-proxy-network.xml delete mode 100644 tests/networkxml2confdata/open-network.xml delete mode 100644 tests/networkxml2confdata/routed-network.xml delete mode 100644 tests/networkxml2conftest.c delete mode 100644 tests/networkxml2xmlin/dnsmasq-options.xml delete mode 100644 tests/networkxml2xmlin/hostdev.xml delete mode 120000 tests/networkxml2xmlin/leasetime-hours.xml delete mode 120000 tests/networkxml2xmlin/leasetime-infinite.xml delete mode 120000 tests/networkxml2xmlin/leasetime-minutes.xml delete mode 120000 tests/networkxml2xmlin/leasetime-seconds.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-forward-plain.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-forwarders.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-srv-record.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-txt-record.xml delete mode 120000 tests/networkxml2xmlin/netboot-tftp.xml delete mode 100644 tests/networkxml2xmlin/routed-network-no-dns.xml delete mode 100644 tests/networkxml2xmlout/hostdev.xml delete mode 120000 tests/networkxml2xmlout/leasetime-hours.xml delete mode 120000 tests/networkxml2xmlout/leasetime-infinite.xml delete mode 120000 tests/networkxml2xmlout/leasetime-minutes.xml delete mode 120000 tests/networkxml2xmlout/leasetime-seconds.xml delete mode 100644 tests/networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml delete mode 120000 tests/networkxml2xmlout/netboot-tftp.xml delete mode 100644 tests/networkxml2xmlout/passthrough-address-crash.xml delete mode 100644 tests/networkxml2xmlout/passthrough-pf.xml rename tests/{networkxml2xmlout/8021Qbh-net.xml => networkxmlconfdata/8021Qbh-net.expect.xml} (90%) rename tests/{networkxml2xmlin => networkxmlconfdata}/8021Qbh-net.xml (90%) copy tests/{networkxml2confdata/leasetime-hours.conf => networkxmlconfdata/bandwidth-network.conf} (61%) rename tests/{networkxml2xmlout/bandwidth-network.xml => networkxmlconfdata/bandwidth-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/bandwidth-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-nat-network.conf (100%) rename tests/{networkxml2confdata/dhcp6host-routed-network.xml => networkxmlconfdata/dhcp6-nat-network.expect.xml} (65%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-nat-network.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-nat-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-network.conf (100%) copy tests/{networkxml2confdata/dhcp6-network.xml => networkxmlconfdata/dhcp6-network.expect.xml} (87%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-network.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6host-routed-network.conf (100%) rename tests/{networkxml2xmlout/dhcp6host-routed-network.xml => networkxmlconfdata/dhcp6host-routed-network.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6host-routed-network.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/dhcp6host-routed-network.xml (100%) rename tests/{networkxml2xmlout/direct-net.xml => networkxmlconfdata/direct-net.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/direct-net.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dnsmasq-options.conf (100%) rename tests/{networkxml2xmlout/dnsmasq-options.xml => networkxmlconfdata/dnsmasq-options.expect.xml} (94%) rename tests/{networkxml2confdata => networkxmlconfdata}/dnsmasq-options.xml (100%) rename tests/{networkxml2xmlout/empty-allow-ipv6.xml => networkxmlconfdata/empty-allow-ipv6.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/empty-allow-ipv6.xml (100%) rename tests/{networkxml2xmlout/host-bridge-net.xml => networkxmlconfdata/host-bridge-net.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/host-bridge-net.xml (100%) rename tests/{networkxml2xmlout/host-bridge-no-flood.xml => networkxmlconfdata/host-bridge-no-flood.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/host-bridge-no-flood.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/hostdev-duplicate.xml (100%) rename tests/{networkxml2xmlin/hostdev-pf-driver-model.xml => networkxmlconfdata/hostdev-pf-driver-model.expect.xml} (100%) copy tests/{networkxml2xmlout => networkxmlconfdata}/hostdev-pf-driver-model.xml (100%) rename tests/{networkxml2xmlin/hostdev-pf.xml => networkxmlconfdata/hostdev-pf.expect.xml} (100%) rename tests/{networkxml2xmlout => networkxmlconfdata}/hostdev-pf.xml (100%) copy tests/{networkxml2xmlout/hostdev-pf-driver-model.xml => networkxmlconfdata/hostdev.expect.xml} (48%) rename tests/{networkxml2xmlout/hostdev-pf-driver-model.xml => networkxmlconfdata/hostdev.xml} (48%) copy tests/{networkxml2confdata => networkxmlconfdata}/isolated-network.conf (100%) rename tests/{networkxml2xmlout/isolated-network.xml => networkxmlconfdata/isolated-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/isolated-network.xml (100%) rename tests/{networkxml2xmlout/isolated-ports.xml => networkxmlconfdata/isolated-ports.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/isolated-ports.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-hours.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-hours.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-hours.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-hours.xml (94%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-infinite.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-infinite.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-infinite.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-infinite.xml (94%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-minutes.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-minutes.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-minutes.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-minutes.xml (94%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-seconds.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-seconds.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-seconds.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-seconds.xml (94%) rename tests/{networkxml2xmlout/metadata.xml => networkxmlconfdata/metadata.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/metadata.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forward-plain.conf (100%) copy tests/{networkxml2xmlout/nat-network-dns-forward-plain.xml => networkxmlconfdata/nat-network-dns-forward-plain.expect.xml} (89%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forward-plain.xml (100%) copy tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forwarder-no-resolv.conf (100%) rename tests/{networkxml2xmlin/nat-network-dns-forwarder-no-resolv.xml => networkxmlconfdata/nat-network-dns-forwarder-no-resolv.expect.xml} (89%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forwarder-no-resolv.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forwarders.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-forwarders.xml => networkxmlconfdata/nat-network-dns-forwarders.expect.xml} (71%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forwarders.xml (90%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-hosts.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-hosts.xml => networkxmlconfdata/nat-network-dns-hosts.expect.xml} (91%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-dns-hosts.xml (95%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-local-domain.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-forward-plain.xml => networkxmlconfdata/nat-network-dns-local-domain.expect.xml} (76%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-local-domain.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record-minimal.conf (93%) rename tests/{networkxml2xmlout/nat-network-dns-srv-record-minimal.xml => networkxmlconfdata/nat-network-dns-srv-record-minimal.expect.xml} (88%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record-minimal.hostsfile (100%) copy tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record-minimal.xml (92%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record.conf (93%) rename tests/{networkxml2xmlout/nat-network-dns-srv-record.xml => networkxmlconfdata/nat-network-dns-srv-record.expect.xml} (58%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record.xml (91%) copy tests/{networkxml2confdata/nat-network.conf => networkxmlconfdata/nat-network-dns-srv-records.conf} (90%) rename tests/{networkxml2xmlout/nat-network-dns-srv-records.xml => networkxmlconfdata/nat-network-dns-srv-records.expect.xml} (96%) copy tests/{networkxml2confdata/nat-network-dns-txt-record.hostsfile => networkxmlconfdata/nat-network-dns-srv-records.hostsfile} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-dns-srv-records.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-txt-record.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-txt-record.xml => networkxmlconfdata/nat-network-dns-txt-record.expect.xml} (95%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-txt-record.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-txt-record.xml (100%) copy tests/{networkxml2confdata/nat-network.conf => networkxmlconfdata/nat-network-explicit-flood.conf} (100%) rename tests/{networkxml2xmlout/nat-network-explicit-flood.xml => networkxmlconfdata/nat-network-explicit-flood.expect.xml} (95%) copy tests/{networkxml2confdata/nat-network-mtu.hostsfile => networkxmlconfdata/nat-network-explicit-flood.hostsfile} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-explicit-flood.xml (100%) copy tests/{networkxml2confdata/nat-network.conf => networkxmlconfdata/nat-network-forward-nat-address.conf} (100%) rename tests/{networkxml2xmlout/nat-network-forward-nat-address.xml => networkxmlconfdata/nat-network-forward-nat-address.expect.xml} (96%) copy tests/{networkxml2confdata/nat-network-name-with-quotes.hostsfile => networkxmlconfdata/nat-network-forward-nat-address.hostsfile} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-forward-nat-address.xml (100%) rename tests/{networkxml2confdata/nat-network-dns-forwarder-no-resolv.conf => networkxmlconfdata/nat-network-forward-nat-ipv6.conf} (90%) rename tests/{networkxml2xmlout/nat-network-forward-nat-ipv6.xml => networkxmlconfdata/nat-network-forward-nat-ipv6.expect.xml} (88%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-forward-nat-ipv6.xml (100%) copy tests/{networkxml2confdata/nat-network.conf => networkxmlconfdata/nat-network-forward-nat-no-address.conf} (100%) rename tests/{networkxml2xmlout/nat-network-forward-nat-no-address.xml => networkxmlconfdata/nat-network-forward-nat-no-address.expect.xml} (95%) copy tests/{networkxml2confdata/nat-network.hostsfile => networkxmlconfdata/nat-network-forward-nat-no-address.hostsfile} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-forward-nat-no-address.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-mtu.conf (100%) rename tests/{networkxml2xmlout/nat-network-mtu.xml => networkxmlconfdata/nat-network-mtu.expect.xml} (95%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-mtu.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-mtu.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-name-with-quotes.conf (100%) rename tests/{networkxml2confdata/nat-network-dns-srv-record-minimal.xml => networkxmlconfdata/nat-network-name-with-quotes.expect.xml} (90%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-name-with-quotes.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-name-with-quotes.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network.conf (100%) rename tests/{networkxml2xmlout/nat-network.xml => networkxmlconfdata/nat-network.expect.xml} (95%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-network.conf (100%) rename tests/{networkxml2xmlout/netboot-network.xml => networkxmlconfdata/netboot-network.expect.xml} (91%) rename tests/{networkxml2xmlin => networkxmlconfdata}/netboot-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-proxy-network.conf (100%) rename tests/{networkxml2xmlout/netboot-proxy-network.xml => networkxmlconfdata/netboot-proxy-network.expect.xml} (91%) rename tests/{networkxml2xmlin => networkxmlconfdata}/netboot-proxy-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-tftp.conf (100%) create mode 120000 tests/networkxmlconfdata/netboot-tftp.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-tftp.xml (87%) rename tests/{networkxml2xmlin => networkxmlconfdata}/open-network-with-forward-dev.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/open-network.conf (100%) rename tests/{networkxml2xmlout/open-network.xml => networkxmlconfdata/open-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/open-network.xml (100%) rename tests/{networkxml2xmlin/openvswitch-net.xml => networkxmlconfdata/openvswitch-net.expect.xml} (87%) rename tests/{networkxml2xmlout => networkxmlconfdata}/openvswitch-net.xml (87%) rename tests/{networkxml2xmlin => networkxmlconfdata}/passthrough-address-crash.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/passthrough-duplicate.xml (100%) rename tests/{networkxml2confdata/routed-network-no-dns.conf => networkxmlconfdata/passthrough-pf.conf} (82%) rename tests/{networkxml2xmlin => networkxmlconfdata}/passthrough-pf.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/ptr-domains-auto.conf (100%) rename tests/{networkxml2xmlin/nat-network-dns-srv-record-minimal.xml => networkxmlconfdata/ptr-domains-auto.expect.xml} (76%) rename tests/{networkxml2confdata => networkxmlconfdata}/ptr-domains-auto.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/ptr-domains-auto.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/routed-network-no-dns-extra-elements.xml (100%) rename tests/{networkxml2xmlout/routed-network-no-dns.xml => networkxmlconfdata/routed-network-no-dns.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/routed-network-no-dns.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/routed-network.conf (100%) rename tests/{networkxml2xmlout/routed-network.xml => networkxmlconfdata/routed-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/routed-network.xml (100%) rename tests/{networkxml2confdata/isolated-network.conf => networkxmlconfdata/set-mtu.conf} (95%) rename tests/{networkxml2xmlout/set-mtu.xml => networkxmlconfdata/set-mtu.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/set-mtu.xml (100%) rename tests/{networkxml2xmlout/vepa-net.xml => networkxmlconfdata/vepa-net.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/vepa-net.xml (100%) rename tests/{networkxml2xmltest.c => networkxmlconftest.c} (35%) -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Instead of including network driver header files as: #include "network/header.h" pass network_inc_dir to the compiler and include files directly. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/meson.build | 6 +++--- tests/networkxml2conftest.c | 2 +- tests/networkxml2firewalltest.c | 2 +- tests/networkxml2xmltest.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index b963047732..4b93fb405a 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -407,9 +407,9 @@ endif if conf.has('WITH_NETWORK') tests += [ - { 'name': 'networkxml2conftest', 'link_with': [ network_driver_impl ] }, - { 'name': 'networkxml2firewalltest', 'link_with': [ network_driver_impl ] }, - { 'name': 'networkxml2xmltest', 'link_with': [ network_driver_impl ] }, + { '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 ], }, ] endif diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index d18985e060..40b9d07d31 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -9,7 +9,7 @@ #include "testutils.h" #include "network_conf.h" #include "viralloc.h" -#include "network/bridge_driver.h" +#include "bridge_driver.h" #define LIBVIRT_VIRCOMMANDPRIV_H_ALLOW #include "vircommandpriv.h" diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltest.c index f7b87ff798..e32f1b281e 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -27,7 +27,7 @@ # include <gio/gio.h> -# include "network/bridge_driver_platform.h" +# include "bridge_driver_platform.h" # include "virbuffer.h" # include "virmock.h" diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 0783d84915..59266defb6 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -8,7 +8,7 @@ #include "internal.h" #include "testutils.h" #include "network_conf.h" -#include "network/bridge_driver.h" +#include "bridge_driver.h" #define VIR_FROM_THIS VIR_FROM_NONE -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> There are two functions implemented in bridge_driver.c that are used in tests (networkDnsmasqCreateXMLConf() and networkDnsmasqConfContents()) but are declared in bridge_driver.h. This goes against our current practice where such APIs are declared in $name_priv.h. Therefore, move those APIs to bridge_driver_priv.h Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/network/bridge_driver.c | 2 ++ src/network/bridge_driver.h | 15 ----------- .../{bridge_driver.h => bridge_driver_priv.h} | 27 +++++-------------- tests/networkxml2conftest.c | 2 ++ tests/networkxml2xmltest.c | 2 ++ 5 files changed, 12 insertions(+), 36 deletions(-) copy src/network/{bridge_driver.h => bridge_driver_priv.h} (32%) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 8b5dbb3ab7..d7004771b7 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -39,6 +39,8 @@ #include "virerror.h" #include "datatypes.h" #include "bridge_driver.h" +#define LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +#include "bridge_driver_priv.h" #include "bridge_driver_platform.h" #include "driver.h" #include "virbuffer.h" diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h index fddc3dc8cf..64af68c1e0 100644 --- a/src/network/bridge_driver.h +++ b/src/network/bridge_driver.h @@ -21,20 +21,5 @@ #pragma once -#include "internal.h" -#include "virdnsmasq.h" -#include "virnetworkobj.h" - -virNetworkXMLOption * -networkDnsmasqCreateXMLConf(void); - int networkRegister(void); - -int -networkDnsmasqConfContents(virNetworkObj *obj, - const char *pidfile, - char **configstr, - char **hostsfilestr, - dnsmasqContext *dctx, - dnsmasqCaps *caps); diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver_priv.h similarity index 32% copy from src/network/bridge_driver.h copy to src/network/bridge_driver_priv.h index fddc3dc8cf..7f21ed7ad6 100644 --- a/src/network/bridge_driver.h +++ b/src/network/bridge_driver_priv.h @@ -1,36 +1,21 @@ /* - * bridge_driver.h: core driver methods for managing networks + * bridge_driver_priv.h: private declarations for network driver * - * Copyright (C) 2006-2016 Red Hat, Inc. - * Copyright (C) 2006 Daniel P. Berrange - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. + * SPDX-License-Identifier: LGPL-2.1-or-later */ +#ifndef LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +# error "bridge_driver_priv.h may only be included by bridge_driver.c or test suites" +#endif /* LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW */ + #pragma once -#include "internal.h" #include "virdnsmasq.h" #include "virnetworkobj.h" virNetworkXMLOption * networkDnsmasqCreateXMLConf(void); -int -networkRegister(void); - int networkDnsmasqConfContents(virNetworkObj *obj, const char *pidfile, diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 40b9d07d31..70fb3a37b9 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -10,6 +10,8 @@ #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" diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 59266defb6..840bcaa83f 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -9,6 +9,8 @@ #include "testutils.h" #include "network_conf.h" #include "bridge_driver.h" +#define LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +#include "bridge_driver_priv.h" #define VIR_FROM_THIS VIR_FROM_NONE -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Whether a network needs dnsmasq or not is decided at the beginning of networkStartDhcpDaemon(). Move that code into a separate function so it can be reused later. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/network/bridge_driver.c | 36 ++++++++++++++++++++------------ src/network/bridge_driver_priv.h | 3 +++ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index d7004771b7..e7a4e5e1b7 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -1516,34 +1516,44 @@ networkBuildDhcpDaemonCommandLine(virNetworkDriverState *driver, } -static int -networkStartDhcpDaemon(virNetworkDriverState *driver, - virNetworkObj *obj) +bool +networkNeedsDnsmasq(const virNetworkDef* def) { - g_autoptr(virNetworkDriverConfig) cfg = virNetworkDriverGetConfig(driver); - virNetworkDef *def = virNetworkObjGetDef(obj); virNetworkIPDef *ipdef; size_t i; - bool needDnsmasq = false; - g_autoptr(virCommand) cmd = NULL; - g_autofree char *pidfile = NULL; - pid_t dnsmasqPid; - g_autoptr(dnsmasqContext) dctx = NULL; /* see if there are any IP addresses that need a dhcp server */ i = 0; while ((ipdef = virNetworkDefGetIPByIndex(def, AF_UNSPEC, i))) { i++; if (ipdef->nranges || ipdef->nhosts || ipdef->tftproot) - needDnsmasq = true; + return true; } /* no IP addresses at all, so we don't need to run */ if (i == 0) - return 0; + return false; /* no DHCP services needed, and user disabled DNS service */ - if (!needDnsmasq && def->dns.enable == VIR_TRISTATE_BOOL_NO) + if (def->dns.enable == VIR_TRISTATE_BOOL_NO) + return false; + + return true; +} + + +static int +networkStartDhcpDaemon(virNetworkDriverState *driver, + virNetworkObj *obj) +{ + g_autoptr(virNetworkDriverConfig) cfg = virNetworkDriverGetConfig(driver); + virNetworkDef *def = virNetworkObjGetDef(obj); + g_autoptr(virCommand) cmd = NULL; + g_autofree char *pidfile = NULL; + pid_t dnsmasqPid; + g_autoptr(dnsmasqContext) dctx = NULL; + + if (!networkNeedsDnsmasq(def)) return 0; if (g_mkdir_with_parents(cfg->pidDir, 0777) < 0) { diff --git a/src/network/bridge_driver_priv.h b/src/network/bridge_driver_priv.h index 7f21ed7ad6..c7d1d8268d 100644 --- a/src/network/bridge_driver_priv.h +++ b/src/network/bridge_driver_priv.h @@ -23,3 +23,6 @@ networkDnsmasqConfContents(virNetworkObj *obj, char **hostsfilestr, dnsmasqContext *dctx, dnsmasqCaps *caps); + +bool +networkNeedsDnsmasq(const virNetworkDef* def); -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> This test case is spurious. If this was real life scenario then no dnsmasq would be spawned and yet, the test tries to generate dnsmasq config for it. Just drop the test case and move on. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2confdata/routed-network-no-dns.conf | 11 ----------- tests/networkxml2confdata/routed-network-no-dns.xml | 10 ---------- tests/networkxml2conftest.c | 1 - 3 files changed, 22 deletions(-) delete mode 100644 tests/networkxml2confdata/routed-network-no-dns.conf delete mode 100644 tests/networkxml2confdata/routed-network-no-dns.xml diff --git a/tests/networkxml2confdata/routed-network-no-dns.conf b/tests/networkxml2confdata/routed-network-no-dns.conf deleted file mode 100644 index 83cc85ea6b..0000000000 --- a/tests/networkxml2confdata/routed-network-no-dns.conf +++ /dev/null @@ -1,11 +0,0 @@ -##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE -##OVERWRITTEN AND LOST. Changes to this configuration should be made using: -## virsh net-edit local -## or other application using the libvirt API. -## -## dnsmasq conf file created by libvirt -strict-order -port=0 -except-interface=lo -bind-dynamic -interface=virbr1 diff --git a/tests/networkxml2confdata/routed-network-no-dns.xml b/tests/networkxml2confdata/routed-network-no-dns.xml deleted file mode 100644 index 70d041745d..0000000000 --- a/tests/networkxml2confdata/routed-network-no-dns.xml +++ /dev/null @@ -1,10 +0,0 @@ -<network> - <name>local</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <bridge name="virbr1"/> - <mac address='12:34:56:78:9A:BC'/> - <forward mode="route" dev="eth1"/> - <dns enable='no'/> - <ip address="192.168.122.1" netmask="255.255.255.0"> - </ip> -</network> diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 70fb3a37b9..aa0adbdd52 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -174,7 +174,6 @@ mymain(void) DO_TEST("nat-network-dns-srv-record-minimal", full); DO_TEST("nat-network-name-with-quotes", full); DO_TEST("routed-network", full); - DO_TEST("routed-network-no-dns", full); DO_TEST("open-network", full); DO_TEST("nat-network", full); DO_TEST("nat-network-dns-txt-record", full); -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> 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> --- tests/networkxml2conftest.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index aa0adbdd52..59ab3a402b 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -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) -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Soon, individual test cases of networkxml2xmltest will be subject to networkValidate() call. This means, that input XMLs must be valid (or marked as expected fail). Anyway, there are couple of offenders: 1) 8021Qbh-net.xml setting vlan for <forward mode='private'/> is unsupported, 2) hostdev.xml networkValidate() will check if hostdevs specified for <forward mode='hostdev'/> are VFs. Use PCI addresses from virpcimock. 3) openvswitch-net.xml for <forward mode='bridge'/> only openvswitch type of virtualports is allowed. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2xmlin/8021Qbh-net.xml | 3 --- tests/networkxml2xmlin/hostdev.xml | 6 ++---- tests/networkxml2xmlin/openvswitch-net.xml | 6 +++--- tests/networkxml2xmlout/8021Qbh-net.xml | 3 --- tests/networkxml2xmlout/hostdev.xml | 6 ++---- tests/networkxml2xmlout/openvswitch-net.xml | 6 +++--- tests/networkxml2xmlupdateout/openvswitch-net-modified.xml | 4 ++-- .../openvswitch-net-more-portgroups.xml | 6 +++--- .../openvswitch-net-without-alice.xml | 4 ++-- 9 files changed, 17 insertions(+), 27 deletions(-) diff --git a/tests/networkxml2xmlin/8021Qbh-net.xml b/tests/networkxml2xmlin/8021Qbh-net.xml index 3aaab61db6..2d779dcac0 100644 --- a/tests/networkxml2xmlin/8021Qbh-net.xml +++ b/tests/networkxml2xmlin/8021Qbh-net.xml @@ -8,9 +8,6 @@ <interface dev="eth4"/> <interface dev="eth5"/> </forward> - <vlan> - <tag id='549'/> - </vlan> <virtualport type="802.1Qbh"> <parameters profileid="spongebob24"/> </virtualport> diff --git a/tests/networkxml2xmlin/hostdev.xml b/tests/networkxml2xmlin/hostdev.xml index 03f141106f..94974804a7 100644 --- a/tests/networkxml2xmlin/hostdev.xml +++ b/tests/networkxml2xmlin/hostdev.xml @@ -2,9 +2,7 @@ <name>hostdev</name> <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> <forward mode='hostdev' managed='yes'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x1'/> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x2'/> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x3'/> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x4'/> + <address type='pci' domain='0x0000' bus='0x06' slot='0x12' function='0x1'/> + <address type='pci' domain='0x0000' bus='0x06' slot='0x12' function='0x2'/> </forward> </network> diff --git a/tests/networkxml2xmlin/openvswitch-net.xml b/tests/networkxml2xmlin/openvswitch-net.xml index 2f6084d690..30c1e2af10 100644 --- a/tests/networkxml2xmlin/openvswitch-net.xml +++ b/tests/networkxml2xmlin/openvswitch-net.xml @@ -7,7 +7,7 @@ <vlan trunk='yes'> <tag id='666'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='bob-profile'/> </virtualport> </portgroup> @@ -17,7 +17,7 @@ <tag id='888'/> <tag id='999'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='alice-profile'/> </virtualport> </portgroup> @@ -26,7 +26,7 @@ <tag id='123' nativeMode='tagged'/> <tag id='444'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='native-profile'/> </virtualport> </portgroup> diff --git a/tests/networkxml2xmlout/8021Qbh-net.xml b/tests/networkxml2xmlout/8021Qbh-net.xml index 281466a9f7..d4d5b4b443 100644 --- a/tests/networkxml2xmlout/8021Qbh-net.xml +++ b/tests/networkxml2xmlout/8021Qbh-net.xml @@ -8,9 +8,6 @@ <interface dev='eth4'/> <interface dev='eth5'/> </forward> - <vlan> - <tag id='549'/> - </vlan> <virtualport type='802.1Qbh'> <parameters profileid='spongebob24'/> </virtualport> diff --git a/tests/networkxml2xmlout/hostdev.xml b/tests/networkxml2xmlout/hostdev.xml index 03f141106f..94974804a7 100644 --- a/tests/networkxml2xmlout/hostdev.xml +++ b/tests/networkxml2xmlout/hostdev.xml @@ -2,9 +2,7 @@ <name>hostdev</name> <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> <forward mode='hostdev' managed='yes'> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x1'/> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x2'/> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x3'/> - <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x4'/> + <address type='pci' domain='0x0000' bus='0x06' slot='0x12' function='0x1'/> + <address type='pci' domain='0x0000' bus='0x06' slot='0x12' function='0x2'/> </forward> </network> diff --git a/tests/networkxml2xmlout/openvswitch-net.xml b/tests/networkxml2xmlout/openvswitch-net.xml index 2f6084d690..30c1e2af10 100644 --- a/tests/networkxml2xmlout/openvswitch-net.xml +++ b/tests/networkxml2xmlout/openvswitch-net.xml @@ -7,7 +7,7 @@ <vlan trunk='yes'> <tag id='666'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='bob-profile'/> </virtualport> </portgroup> @@ -17,7 +17,7 @@ <tag id='888'/> <tag id='999'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='alice-profile'/> </virtualport> </portgroup> @@ -26,7 +26,7 @@ <tag id='123' nativeMode='tagged'/> <tag id='444'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='native-profile'/> </virtualport> </portgroup> diff --git a/tests/networkxml2xmlupdateout/openvswitch-net-modified.xml b/tests/networkxml2xmlupdateout/openvswitch-net-modified.xml index cc0c344c1b..d52e91e564 100644 --- a/tests/networkxml2xmlupdateout/openvswitch-net-modified.xml +++ b/tests/networkxml2xmlupdateout/openvswitch-net-modified.xml @@ -7,7 +7,7 @@ <vlan trunk='yes'> <tag id='666'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='bob-profile'/> </virtualport> </portgroup> @@ -26,7 +26,7 @@ <tag id='123' nativeMode='tagged'/> <tag id='444'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='native-profile'/> </virtualport> </portgroup> diff --git a/tests/networkxml2xmlupdateout/openvswitch-net-more-portgroups.xml b/tests/networkxml2xmlupdateout/openvswitch-net-more-portgroups.xml index 7c19ad9f48..069b2a01d8 100644 --- a/tests/networkxml2xmlupdateout/openvswitch-net-more-portgroups.xml +++ b/tests/networkxml2xmlupdateout/openvswitch-net-more-portgroups.xml @@ -18,7 +18,7 @@ <vlan trunk='yes'> <tag id='666'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='bob-profile'/> </virtualport> </portgroup> @@ -28,7 +28,7 @@ <tag id='888'/> <tag id='999'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='alice-profile'/> </virtualport> </portgroup> @@ -37,7 +37,7 @@ <tag id='123' nativeMode='tagged'/> <tag id='444'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='native-profile'/> </virtualport> </portgroup> diff --git a/tests/networkxml2xmlupdateout/openvswitch-net-without-alice.xml b/tests/networkxml2xmlupdateout/openvswitch-net-without-alice.xml index 41044240df..2fb0cf9f6d 100644 --- a/tests/networkxml2xmlupdateout/openvswitch-net-without-alice.xml +++ b/tests/networkxml2xmlupdateout/openvswitch-net-without-alice.xml @@ -7,7 +7,7 @@ <vlan trunk='yes'> <tag id='666'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='bob-profile'/> </virtualport> </portgroup> @@ -16,7 +16,7 @@ <tag id='123' nativeMode='tagged'/> <tag id='444'/> </vlan> - <virtualport> + <virtualport type='openvswitch'> <parameters profileid='native-profile'/> </virtualport> </portgroup> -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> The aim of this internal API is to wrap networkValidate() and it is meant to be called from our tests. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/network/bridge_driver.c | 22 +++++++++++++++++++++- src/network/bridge_driver_priv.h | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index e7a4e5e1b7..9636984390 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2827,6 +2827,17 @@ networkBridgeNameValidate(virNetworkObjList *nets, } +/** + * networkValidate: + * @driver: network driver + * @def: network definition + * + * Validates network definition and fills up blanks. + * Callers, but tests, must provide valid @driver to ensure + * unique bridge name. + * + * Returns: 0 on success, -1 otherwise (with error reported). + */ static int networkValidate(virNetworkDriverState *driver, virNetworkDef *def) @@ -2852,8 +2863,10 @@ networkValidate(virNetworkDriverState *driver, case VIR_NETWORK_FORWARD_OPEN: /* if no bridge name was given in the config, find a name * unused by any other libvirt networks and assign it. + * All callers MUST provide valid @driver, except for tests. */ - if (networkBridgeNameValidate(driver->networks, def) < 0) + if (driver && + networkBridgeNameValidate(driver->networks, def) < 0) return -1; virNetworkSetBridgeMacAddr(def); @@ -3104,6 +3117,13 @@ networkValidate(virNetworkDriverState *driver, } +int +networkValidateTests(virNetworkDef *def) +{ + return networkValidate(NULL, def); +} + + static virNetworkPtr networkCreateXMLFlags(virConnectPtr conn, const char *xml, diff --git a/src/network/bridge_driver_priv.h b/src/network/bridge_driver_priv.h index c7d1d8268d..0fdb1d715e 100644 --- a/src/network/bridge_driver_priv.h +++ b/src/network/bridge_driver_priv.h @@ -26,3 +26,6 @@ networkDnsmasqConfContents(virNetworkObj *obj, bool networkNeedsDnsmasq(const virNetworkDef* def); + +int +networkValidateTests(virNetworkDef *def); -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Our network driver calls networkValidate() right after a network XML is parsed. This is similar to domain validation step when parsing domain XML. But it's not that convoluted in network driver. Regardless, any network related test should mimic real life scenario as close as possible and thus networkValidateTests() should be called right after domain XML is parsed. Now, networkValidate() might query sysfs wrt to PCI devices and thus tests must start using virpcimock. The function will also generate random MAC addresses, if needed, hence virrandommock. With this change, passthrough-pf and passthrough-address-crash test cases of networkxml2xmltest started failing but looking at corresponding XMLs those test cases were designed to test just XML parsing. They were never designed to showcase a "real" network XML. So mark them as expected fail. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2confdata/leasetime-hours.xml | 1 + .../networkxml2confdata/leasetime-infinite.xml | 1 + .../networkxml2confdata/leasetime-minutes.xml | 1 + .../networkxml2confdata/leasetime-seconds.xml | 1 + tests/networkxml2confdata/netboot-tftp.xml | 1 + tests/networkxml2conftest.c | 5 +++++ tests/networkxml2firewalltest.c | 10 +++++++++- tests/networkxml2xmlout/dnsmasq-options.xml | 1 + .../nat-network-dns-forward-plain.xml | 1 + .../nat-network-dns-forwarder-no-resolv.xml | 1 + .../nat-network-dns-forwarders.xml | 1 + .../nat-network-dns-hosts.xml | 1 + .../nat-network-dns-srv-record-minimal.xml | 1 + .../nat-network-dns-srv-record.xml | 1 + .../nat-network-dns-srv-records.xml | 1 + .../nat-network-dns-txt-record.xml | 1 + .../nat-network-explicit-flood.xml | 1 + .../nat-network-forward-nat-address.xml | 1 + .../nat-network-forward-nat-ipv6.xml | 1 + .../nat-network-forward-nat-no-address.xml | 1 + tests/networkxml2xmlout/nat-network-mtu.xml | 1 + tests/networkxml2xmlout/nat-network.xml | 1 + tests/networkxml2xmlout/netboot-network.xml | 1 + .../netboot-proxy-network.xml | 1 + .../passthrough-address-crash.xml | 7 ------- tests/networkxml2xmlout/passthrough-pf.xml | 9 --------- tests/networkxml2xmltest.c | 18 +++++++++++++++--- 27 files changed, 51 insertions(+), 20 deletions(-) delete mode 100644 tests/networkxml2xmlout/passthrough-address-crash.xml delete mode 100644 tests/networkxml2xmlout/passthrough-pf.xml diff --git a/tests/networkxml2confdata/leasetime-hours.xml b/tests/networkxml2confdata/leasetime-hours.xml index 5c8bec8328..3824d42368 100644 --- a/tests/networkxml2confdata/leasetime-hours.xml +++ b/tests/networkxml2confdata/leasetime-hours.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'> diff --git a/tests/networkxml2confdata/leasetime-infinite.xml b/tests/networkxml2confdata/leasetime-infinite.xml index a5a9e6c5ed..24df80d5e3 100644 --- a/tests/networkxml2confdata/leasetime-infinite.xml +++ b/tests/networkxml2confdata/leasetime-infinite.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'> diff --git a/tests/networkxml2confdata/leasetime-minutes.xml b/tests/networkxml2confdata/leasetime-minutes.xml index 1cbc285685..99956edc51 100644 --- a/tests/networkxml2confdata/leasetime-minutes.xml +++ b/tests/networkxml2confdata/leasetime-minutes.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'> diff --git a/tests/networkxml2confdata/leasetime-seconds.xml b/tests/networkxml2confdata/leasetime-seconds.xml index 9d8efc2608..76bd7909b8 100644 --- a/tests/networkxml2confdata/leasetime-seconds.xml +++ b/tests/networkxml2confdata/leasetime-seconds.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'> diff --git a/tests/networkxml2confdata/netboot-tftp.xml b/tests/networkxml2confdata/netboot-tftp.xml index 297f5a7ba1..9d5d57bae4 100644 --- a/tests/networkxml2confdata/netboot-tftp.xml +++ b/tests/networkxml2confdata/netboot-tftp.xml @@ -3,6 +3,7 @@ <uuid>eb486e5c-4df5-42ee-ae4a-ad8557998d00</uuid> <forward mode='nat'/> <bridge name='virbr0' stp='off' delay='1'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <tftp root='/var/lib/tftproot'/> </ip> diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 59ab3a402b..67856f2e8c 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -36,6 +36,9 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, if (!(def = virNetworkDefParse(NULL, inxml, xmlopt, false))) goto fail; + if (networkValidateTests(def) < 0) + goto fail; + if (!(obj = virNetworkObjNew())) goto fail; @@ -203,4 +206,6 @@ mymain(void) } VIR_TEST_MAIN_PRELOAD(mymain, + VIR_TEST_MOCK("virpci"), + VIR_TEST_MOCK("virrandom"), VIR_TEST_MOCK("virdnsmasq")) diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltest.c index e32f1b281e..0febae9ebc 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -27,6 +27,8 @@ # include <gio/gio.h> +# define LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +# include "bridge_driver_priv.h" # include "bridge_driver_platform.h" # include "virbuffer.h" # include "virmock.h" @@ -106,6 +108,9 @@ static int testCompareXMLToArgvFiles(const char *xml, if (!(def = virNetworkDefParse(NULL, xml, NULL, false))) return -1; + if (networkValidateTests(def) < 0) + return -1; + if (networkAddFirewallRules(def, backend, NULL) < 0) return -1; @@ -213,7 +218,10 @@ mymain(void) * virGDBusIsServiceRegistered(). */ -VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virgdbus"), +VIR_TEST_MAIN_PRELOAD(mymain, + VIR_TEST_MOCK("virpci"), + VIR_TEST_MOCK("virrandom"), + VIR_TEST_MOCK("virgdbus"), VIR_TEST_MOCK("virfirewall")) #else /* ! defined (__linux__) */ diff --git a/tests/networkxml2xmlout/dnsmasq-options.xml b/tests/networkxml2xmlout/dnsmasq-options.xml index 856a018f25..97911eb65e 100644 --- a/tests/networkxml2xmlout/dnsmasq-options.xml +++ b/tests/networkxml2xmlout/dnsmasq-options.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> diff --git a/tests/networkxml2xmlout/nat-network-dns-forward-plain.xml b/tests/networkxml2xmlout/nat-network-dns-forward-plain.xml index 7522f6ae1c..76e0f926a9 100644 --- a/tests/networkxml2xmlout/nat-network-dns-forward-plain.xml +++ b/tests/networkxml2xmlout/nat-network-dns-forward-plain.xml @@ -5,6 +5,7 @@ <interface dev='eth0'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns forwardPlainNames='yes'/> <ip address='192.168.122.1' netmask='255.255.255.0'> </ip> diff --git a/tests/networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml b/tests/networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml index 9661ce561e..ab2800331c 100644 --- a/tests/networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml +++ b/tests/networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml @@ -3,6 +3,7 @@ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> <forward mode='nat'/> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns> <forwarder domain='example.com' addr='192.168.1.1'/> </dns> diff --git a/tests/networkxml2xmlout/nat-network-dns-forwarders.xml b/tests/networkxml2xmlout/nat-network-dns-forwarders.xml index e03912750c..170b043d09 100644 --- a/tests/networkxml2xmlout/nat-network-dns-forwarders.xml +++ b/tests/networkxml2xmlout/nat-network-dns-forwarders.xml @@ -5,6 +5,7 @@ <interface dev='eth0'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns> <forwarder addr='8.8.8.8'/> <forwarder addr='8.8.4.4'/> diff --git a/tests/networkxml2xmlout/nat-network-dns-hosts.xml b/tests/networkxml2xmlout/nat-network-dns-hosts.xml index 86832af518..548282e514 100644 --- a/tests/networkxml2xmlout/nat-network-dns-hosts.xml +++ b/tests/networkxml2xmlout/nat-network-dns-hosts.xml @@ -5,6 +5,7 @@ <interface dev='eth0'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns forwardPlainNames='no'> <host ip='192.168.122.122'> <hostname>pudding</hostname> diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml index a18afae2fd..50e968be9d 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns> <srv service='name' protocol='tcp'/> </dns> diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record.xml b/tests/networkxml2xmlout/nat-network-dns-srv-record.xml index 3dd19e6698..1486fc3224 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-record.xml +++ b/tests/networkxml2xmlout/nat-network-dns-srv-record.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns> <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> </dns> diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-records.xml b/tests/networkxml2xmlout/nat-network-dns-srv-records.xml index eda9e20333..26b802e1eb 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-records.xml +++ b/tests/networkxml2xmlout/nat-network-dns-srv-records.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns> <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> <srv service='name' protocol='tcp' domain='donkey' target='.' port='404' priority='10' weight='10'/> diff --git a/tests/networkxml2xmlout/nat-network-dns-txt-record.xml b/tests/networkxml2xmlout/nat-network-dns-txt-record.xml index a4590119ef..cba7e9d1f8 100644 --- a/tests/networkxml2xmlout/nat-network-dns-txt-record.xml +++ b/tests/networkxml2xmlout/nat-network-dns-txt-record.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns> <txt name='example' value='example value'/> </dns> diff --git a/tests/networkxml2xmlout/nat-network-explicit-flood.xml b/tests/networkxml2xmlout/nat-network-explicit-flood.xml index 305c3b7d98..c039955543 100644 --- a/tests/networkxml2xmlout/nat-network-explicit-flood.xml +++ b/tests/networkxml2xmlout/nat-network-explicit-flood.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0' macTableManager='kernel'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> diff --git a/tests/networkxml2xmlout/nat-network-forward-nat-address.xml b/tests/networkxml2xmlout/nat-network-forward-nat-address.xml index faeba24706..e3276ac338 100644 --- a/tests/networkxml2xmlout/nat-network-forward-nat-address.xml +++ b/tests/networkxml2xmlout/nat-network-forward-nat-address.xml @@ -9,6 +9,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> diff --git a/tests/networkxml2xmlout/nat-network-forward-nat-ipv6.xml b/tests/networkxml2xmlout/nat-network-forward-nat-ipv6.xml index cfec391ee2..642929cc8d 100644 --- a/tests/networkxml2xmlout/nat-network-forward-nat-ipv6.xml +++ b/tests/networkxml2xmlout/nat-network-forward-nat-ipv6.xml @@ -5,6 +5,7 @@ <nat ipv6='yes'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> </ip> </network> diff --git a/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml b/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml index f19e34deec..77fc0b5324 100644 --- a/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml +++ b/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml @@ -8,6 +8,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> diff --git a/tests/networkxml2xmlout/nat-network-mtu.xml b/tests/networkxml2xmlout/nat-network-mtu.xml index 715bc1b505..97044c70ec 100644 --- a/tests/networkxml2xmlout/nat-network-mtu.xml +++ b/tests/networkxml2xmlout/nat-network-mtu.xml @@ -6,6 +6,7 @@ </forward> <bridge name='virbr0' stp='on' delay='0'/> <mtu size='7000'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> diff --git a/tests/networkxml2xmlout/nat-network.xml b/tests/networkxml2xmlout/nat-network.xml index 93bc7db51d..9d3757f0e0 100644 --- a/tests/networkxml2xmlout/nat-network.xml +++ b/tests/networkxml2xmlout/nat-network.xml @@ -5,6 +5,7 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> diff --git a/tests/networkxml2xmlout/netboot-network.xml b/tests/networkxml2xmlout/netboot-network.xml index 8d5ad31a00..723c6c7a72 100644 --- a/tests/networkxml2xmlout/netboot-network.xml +++ b/tests/networkxml2xmlout/netboot-network.xml @@ -3,6 +3,7 @@ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> <forward mode='nat'/> <bridge name='virbr1' stp='off' delay='1'/> + <mac address='52:54:00:00:00:00'/> <domain name='example.com'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <tftp root='/var/lib/tftproot'/> diff --git a/tests/networkxml2xmlout/netboot-proxy-network.xml b/tests/networkxml2xmlout/netboot-proxy-network.xml index a5b7c1e4e6..8c9fae874c 100644 --- a/tests/networkxml2xmlout/netboot-proxy-network.xml +++ b/tests/networkxml2xmlout/netboot-proxy-network.xml @@ -3,6 +3,7 @@ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> <forward mode='nat'/> <bridge name='virbr1' stp='off' delay='1'/> + <mac address='52:54:00:00:00:00'/> <domain name='example.com'/> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> diff --git a/tests/networkxml2xmlout/passthrough-address-crash.xml b/tests/networkxml2xmlout/passthrough-address-crash.xml deleted file mode 100644 index a05dbbf837..0000000000 --- a/tests/networkxml2xmlout/passthrough-address-crash.xml +++ /dev/null @@ -1,7 +0,0 @@ -<network> - <name>passthrough_001</name> - <uuid>50e92386-8dd1-4a95-8a4b-9a888274eb66</uuid> - <forward mode='passthrough'> - <address type='pci' domain='0x0000' bus='0x11' slot='0x10' function='0x1'/> - </forward> -</network> diff --git a/tests/networkxml2xmlout/passthrough-pf.xml b/tests/networkxml2xmlout/passthrough-pf.xml deleted file mode 100644 index 1a7e71ea88..0000000000 --- a/tests/networkxml2xmlout/passthrough-pf.xml +++ /dev/null @@ -1,9 +0,0 @@ -<network> - <name>local</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward mode='passthrough'> - <pf dev='eth0'/> - </forward> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 840bcaa83f..10eed8173e 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -17,6 +17,7 @@ typedef enum { TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS, TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE, + TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE, TEST_COMPARE_NET_XML2XML_RESULT_FAIL_FORMAT, TEST_COMPARE_NET_XML2XML_RESULT_FAIL_COMPARE, } testCompareNetXML2XMLResult; @@ -42,6 +43,13 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml, if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE) goto cleanup; + if (networkValidateTests(dev) < 0) { + result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE; + goto cleanup; + } + if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE) + goto cleanup; + if (!(actual = virNetworkDefFormat(dev, xmlopt, flags))) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_FORMAT; goto cleanup; @@ -114,6 +122,8 @@ mymain(void) DO_TEST_FULL(name, flags, TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) #define DO_TEST_PARSE_ERROR(name) \ DO_TEST_FULL(name, 0, TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE) +#define DO_TEST_VALIDATE_ERROR(name) \ + DO_TEST_FULL(name, 0, TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE) DO_TEST("dhcp6host-routed-network"); DO_TEST("empty-allow-ipv6"); @@ -145,12 +155,12 @@ mymain(void) DO_TEST("vepa-net"); DO_TEST("bandwidth-network"); DO_TEST("openvswitch-net"); - DO_TEST_FLAGS("passthrough-pf", VIR_NETWORK_XML_INACTIVE); + DO_TEST_VALIDATE_ERROR("passthrough-pf"); 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("passthrough-address-crash"); + DO_TEST_VALIDATE_ERROR("passthrough-address-crash"); DO_TEST("nat-network-explicit-flood"); DO_TEST("host-bridge-no-flood"); DO_TEST_PARSE_ERROR("hostdev-duplicate"); @@ -167,4 +177,6 @@ mymain(void) return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN(mymain) +VIR_TEST_MAIN_PRELOAD(mymain, + VIR_TEST_MOCK("virpci"), + VIR_TEST_MOCK("virrandom")) -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Inside of testCompareXMLToConfFiles() the network definition is parsed and if that succeeds a virNetworkObj is created by calling virNetworkObjNew(). But if the latter fails, the control jumps onto the fail label where only the object is freed but not already parsed definition leading to a leak. Swapping these two steps ensures that if either of them fails no memleak occurs. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2conftest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 67856f2e8c..d089ff38b1 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -33,17 +33,17 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, if (!(xmlopt = networkDnsmasqCreateXMLConf())) goto fail; - if (!(def = virNetworkDefParse(NULL, inxml, xmlopt, false))) - goto fail; - - if (networkValidateTests(def) < 0) - goto fail; - if (!(obj = virNetworkObjNew())) goto fail; + if (!(def = 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 not start dnsmasq in real life scenario"); goto fail; -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Inside of testCompareXMLToConfFiles() the networkDnsmasqConfContents() is called. This may also produce contents of corresponding hosts file. This is then compared to expected contents stored on disk as ${testname}.hostsfile. But due to additional checks virTestCompareToFile() might not even be called. Problem with that is when there's actual content but the file doesn't exist the compare helper is not called and thus VIR_TEST_REGENERATE_OUTPUT trick doesn't work. Let's call the helper more often as it is perfectly capable of handling this edge case. What it is not capable of handling is when the file shouldn't exist at all. So handling of that case is kept. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2conftest.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index d089ff38b1..cb2cafa918 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -75,18 +75,16 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, if (virTestCompareToFile(confactual, outconf) < 0) goto fail; - if (virFileExists(outhostsfile)) { - if (!hostsfileactual) { - VIR_TEST_DEBUG("%s: hostsfile exists but the configuration did " - "not specify any host", outhostsfile); + if (hostsfileactual) { + if (virTestCompareToFile(hostsfileactual, outhostsfile) < 0) { goto fail; - } else if (virTestCompareToFile(hostsfileactual, outhostsfile) < 0) { + } + } else { + if (virFileExists(outhostsfile)) { + VIR_TEST_DEBUG("%s: hostsfile exists but the configuration did not specify any host", + outhostsfile); goto fail; } - } else if (hostsfileactual) { - VIR_TEST_DEBUG("%s: file does not exist but actual data was expected", - outhostsfile); - goto fail; } ret = 0; -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Currently, there are two calls to virTestCompareToFile() inside of testCompareXMLToConfFiles(). If the first one fails the control jumps directly onto the fail label and skips the second one. This means that When regenerating test case output (VIR_TEST_REGENERATE_OUTPUT) the test binary has to be called twice to regenerate all the files. Suboptimal. Try harder to call both compare helpers. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2conftest.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index cb2cafa918..c7534773a3 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -29,6 +29,7 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, g_autofree char *pidfile = NULL; g_autoptr(dnsmasqContext) dctx = NULL; g_autoptr(virNetworkXMLOption) xmlopt = NULL; + bool compareFailed = false; if (!(xmlopt = networkDnsmasqCreateXMLConf())) goto fail; @@ -73,20 +74,23 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, #endif if (virTestCompareToFile(confactual, outconf) < 0) - goto fail; + compareFailed = true; if (hostsfileactual) { if (virTestCompareToFile(hostsfileactual, outhostsfile) < 0) { - goto fail; + compareFailed = true; } } else { if (virFileExists(outhostsfile)) { VIR_TEST_DEBUG("%s: hostsfile exists but the configuration did not specify any host", outhostsfile); - goto fail; + compareFailed = true; } } + if (compareFailed) + goto fail; + ret = 0; fail: -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> The aim of virNetworkXMLOption object is to provide some immutable data to XML parser (e.g. various callbacks). Since the object is immutable, it can be created once and then reused by all test cases. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2xmltest.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 10eed8173e..325a43c385 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -23,18 +23,16 @@ typedef enum { } testCompareNetXML2XMLResult; static int -testCompareXMLToXMLFiles(const char *inxml, const char *outxml, +testCompareXMLToXMLFiles(const char *inxml, + const char *outxml, unsigned int flags, - testCompareNetXML2XMLResult expectResult) + testCompareNetXML2XMLResult expectResult, + virNetworkXMLOption *xmlopt) { g_autofree char *actual = NULL; int ret; testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS; g_autoptr(virNetworkDef) dev = NULL; - g_autoptr(virNetworkXMLOption) xmlopt = NULL; - - if (!(xmlopt = networkDnsmasqCreateXMLConf())) - goto cleanup; if (!(dev = virNetworkDefParse(NULL, inxml, xmlopt, false))) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE; @@ -85,6 +83,7 @@ struct testInfo { const char *name; unsigned int flags; testCompareNetXML2XMLResult expectResult; + virNetworkXMLOption *xmlopt; }; static int @@ -99,7 +98,7 @@ testCompareXMLToXMLHelper(const void *data) outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, info->name); result = testCompareXMLToXMLFiles(inxml, outxml, info->flags, - info->expectResult); + info->expectResult, info->xmlopt); return result; } @@ -107,11 +106,15 @@ testCompareXMLToXMLHelper(const void *data) static int mymain(void) { + g_autoptr(virNetworkXMLOption) xmlopt = NULL; int ret = 0; + if (!(xmlopt = networkDnsmasqCreateXMLConf())) + return -1; + #define DO_TEST_FULL(name, flags, expectResult) \ do { \ - const struct testInfo info = {name, flags, expectResult}; \ + const struct testInfo info = {name, flags, expectResult, xmlopt}; \ if (virTestRun("Network XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> This is a beginning of something bigger. The idea is that one DO_TEST_FULL() macro (and its friends) will run multiple test cases (just like qemuxmlconftest does). But in order to do that in a readable fashion, the macro should merely just expand to a function call. The function will then call virTestRunLog(), multiple times possibly. This is the first step in that direction. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2xmltest.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 325a43c385..552364818d 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -103,6 +103,19 @@ testCompareXMLToXMLHelper(const void *data) return result; } +static void +testRun(const char *name, + int *ret, + virNetworkXMLOption *xmlopt, + testCompareNetXML2XMLResult expectResult, + unsigned int flags) +{ + g_autofree char *name_xml2xml = g_strdup_printf("Network XML-2-XML %s", name); + struct testInfo info = { .name = name, .flags = flags, .expectResult = expectResult, .xmlopt = xmlopt }; + + virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLHelper, &info); +} + static int mymain(void) { @@ -113,12 +126,7 @@ mymain(void) return -1; #define DO_TEST_FULL(name, flags, expectResult) \ - do { \ - const struct testInfo info = {name, flags, expectResult, xmlopt}; \ - if (virTestRun("Network XML-2-XML " name, \ - testCompareXMLToXMLHelper, &info) < 0) \ - ret = -1; \ - } while (0) + testRun(name, &ret, xmlopt, expectResult, flags) #define DO_TEST(name) \ DO_TEST_FULL(name, 0, TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) #define DO_TEST_FLAGS(name, flags) \ -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> This effectively dissolves testCompareXMLToXMLHelper() into testRun(). Motivation is that parts of data generated inside of testCompareXMLToXMLHelper() is going to be reused from the caller (testRun()). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2xmltest.c | 69 +++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 552364818d..2a537d77c0 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -22,86 +22,69 @@ typedef enum { TEST_COMPARE_NET_XML2XML_RESULT_FAIL_COMPARE, } testCompareNetXML2XMLResult; +struct testInfo { + const char *name; + unsigned int flags; + testCompareNetXML2XMLResult expectResult; + virNetworkXMLOption *xmlopt; + const char *inxml; + const char *outxml; +}; + static int -testCompareXMLToXMLFiles(const char *inxml, - const char *outxml, - unsigned int flags, - testCompareNetXML2XMLResult expectResult, - virNetworkXMLOption *xmlopt) +testCompareXMLToXMLFiles(const void *data) { + struct testInfo *info = (void *) data; g_autofree char *actual = NULL; int ret; testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS; g_autoptr(virNetworkDef) dev = NULL; - if (!(dev = virNetworkDefParse(NULL, inxml, xmlopt, false))) { + if (!(dev = virNetworkDefParse(NULL, info->inxml, info->xmlopt, false))) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE; goto cleanup; } - if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE) + if (info->expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE) goto cleanup; if (networkValidateTests(dev) < 0) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE; goto cleanup; } - if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE) + if (info->expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE) goto cleanup; - if (!(actual = virNetworkDefFormat(dev, xmlopt, flags))) { + if (!(actual = virNetworkDefFormat(dev, info->xmlopt, info->flags))) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_FORMAT; goto cleanup; } - if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_FORMAT) + if (info->expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_FORMAT) goto cleanup; - if (virTestCompareToFile(actual, outxml) < 0) { + if (virTestCompareToFile(actual, info->outxml) < 0) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_COMPARE; goto cleanup; } - if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_COMPARE) + if (info->expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_COMPARE) goto cleanup; cleanup: - if (result == expectResult) { + if (result == info->expectResult) { ret = 0; - if (expectResult != TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) { + if (info->expectResult != TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) { VIR_TEST_DEBUG("Got expected failure code=%d msg=%s", result, virGetLastErrorMessage()); } } else { ret = -1; VIR_TEST_DEBUG("Expected result code=%d but received code=%d", - expectResult, result); + info->expectResult, result); } virResetLastError(); return ret; } -struct testInfo { - const char *name; - unsigned int flags; - testCompareNetXML2XMLResult expectResult; - virNetworkXMLOption *xmlopt; -}; - -static int -testCompareXMLToXMLHelper(const void *data) -{ - const struct testInfo *info = data; - int result = -1; - g_autofree char *inxml = NULL; - g_autofree char *outxml = NULL; - - inxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", abs_srcdir, info->name); - outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, info->name); - - result = testCompareXMLToXMLFiles(inxml, outxml, info->flags, - info->expectResult, info->xmlopt); - - return result; -} static void testRun(const char *name, @@ -112,8 +95,16 @@ testRun(const char *name, { g_autofree char *name_xml2xml = g_strdup_printf("Network XML-2-XML %s", name); struct testInfo info = { .name = name, .flags = flags, .expectResult = expectResult, .xmlopt = xmlopt }; + g_autofree char *inxml = NULL; + g_autofree char *outxml = NULL; - virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLHelper, &info); + inxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", abs_srcdir, name); + outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, name); + + info.inxml = inxml; + info.outxml = outxml; + + virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLFiles, &info); } static int -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> So far, the testInfo struct contained immutable data (from its lifetime point of view). But that is about to change. For instance, it will hold parsed network definition (virNetworkDef) and in order to avoid leaking dynamically allocated data corresponding free function must be introduced (or clear function, doesn't really matter). At this point, the structure might as well be dynamically allocated entirely. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2xmltest.c | 41 +++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 2a537d77c0..e90b38088a 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -22,19 +22,33 @@ typedef enum { TEST_COMPARE_NET_XML2XML_RESULT_FAIL_COMPARE, } testCompareNetXML2XMLResult; -struct testInfo { +struct _testInfo { const char *name; unsigned int flags; testCompareNetXML2XMLResult expectResult; - virNetworkXMLOption *xmlopt; - const char *inxml; - const char *outxml; + virNetworkXMLOption *xmlopt; /* borrowed, immutable */ + char *inxml; + char *outxml; }; +typedef struct _testInfo testInfo; +void testInfoFree(testInfo *info); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(testInfo, testInfoFree); + +void testInfoFree(testInfo *info) +{ + if (!info) + return; + + VIR_FREE(info->inxml); + VIR_FREE(info->outxml); + VIR_FREE(info); +} + static int testCompareXMLToXMLFiles(const void *data) { - struct testInfo *info = (void *) data; + testInfo *info = (void *) data; g_autofree char *actual = NULL; int ret; testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS; @@ -94,17 +108,16 @@ testRun(const char *name, unsigned int flags) { g_autofree char *name_xml2xml = g_strdup_printf("Network XML-2-XML %s", name); - struct testInfo info = { .name = name, .flags = flags, .expectResult = expectResult, .xmlopt = xmlopt }; - g_autofree char *inxml = NULL; - g_autofree char *outxml = NULL; + g_autoptr(testInfo) info = g_new0(testInfo, 1); - inxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", abs_srcdir, name); - outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, name); + info->name = name; + info->flags = flags; + info->expectResult = expectResult; + info->xmlopt = xmlopt; + info->inxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", abs_srcdir, name); + info->outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, name); - info.inxml = inxml; - info.outxml = outxml; - - virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLFiles, &info); + virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLFiles, info); } static int -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Soon, the testRun() will run more than one test case. The input network XML, however, stays the same. Instead of parsing it and throwing away immediately, store it temporarily. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- tests/networkxml2xmltest.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index e90b38088a..4a4cf329e4 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -27,6 +27,7 @@ struct _testInfo { unsigned int flags; testCompareNetXML2XMLResult expectResult; virNetworkXMLOption *xmlopt; /* borrowed, immutable */ + virNetworkDef *def; char *inxml; char *outxml; }; @@ -40,6 +41,7 @@ void testInfoFree(testInfo *info) if (!info) return; + virNetworkDefFree(info->def); VIR_FREE(info->inxml); VIR_FREE(info->outxml); VIR_FREE(info); @@ -52,23 +54,23 @@ testCompareXMLToXMLFiles(const void *data) g_autofree char *actual = NULL; int ret; testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS; - g_autoptr(virNetworkDef) dev = NULL; + g_autoptr(virNetworkDef) def = NULL; - if (!(dev = virNetworkDefParse(NULL, info->inxml, info->xmlopt, false))) { + if (!(def = virNetworkDefParse(NULL, info->inxml, info->xmlopt, false))) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE; goto cleanup; } if (info->expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_PARSE) goto cleanup; - if (networkValidateTests(dev) < 0) { + if (networkValidateTests(def) < 0) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE; goto cleanup; } if (info->expectResult == TEST_COMPARE_NET_XML2XML_RESULT_FAIL_VALIDATE) goto cleanup; - if (!(actual = virNetworkDefFormat(dev, info->xmlopt, info->flags))) { + if (!(actual = virNetworkDefFormat(def, info->xmlopt, info->flags))) { result = TEST_COMPARE_NET_XML2XML_RESULT_FAIL_FORMAT; goto cleanup; } @@ -88,6 +90,8 @@ testCompareXMLToXMLFiles(const void *data) if (info->expectResult != TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) { VIR_TEST_DEBUG("Got expected failure code=%d msg=%s", result, virGetLastErrorMessage()); + } else { + info->def = g_steal_pointer(&def); } } else { ret = -1; -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> 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 <srv/> records than the test case anticipated. But this is easy to fix - hence seemingly unrelated change under networkxml2xmlupdatein/ dir. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- .../nat-network-dns-srv-record-minimal.conf | 2 +- .../nat-network-dns-srv-record-minimal.xml | 2 +- .../nat-network-dns-srv-record.conf | 2 +- .../nat-network-dns-srv-record.xml | 2 +- ...cord-minimal.xml => dhcp6-nat-network.xml} | 19 ++++++++------- .../dhcp6-network.xml} | 24 +++++++------------ .../nat-network-dns-forwarders.xml | 3 ++- .../nat-network-dns-hosts.xml | 1 + ...s.xml => nat-network-dns-local-domain.xml} | 7 +----- .../nat-network-dns-srv-record-minimal.xml | 2 +- .../nat-network-dns-srv-record.xml | 6 +++++ .../nat-network-name-with-quotes.xml} | 2 +- .../ptr-domains-auto.xml} | 10 ++++---- ...s-srv-record.xml => dhcp6-nat-network.xml} | 13 ++++++---- ...v-record-minimal.xml => dhcp6-network.xml} | 23 +++++++----------- .../nat-network-dns-forwarders.xml | 3 ++- .../nat-network-dns-hosts.xml | 1 + ...s.xml => nat-network-dns-local-domain.xml} | 7 +----- .../nat-network-dns-srv-record-minimal.xml | 2 +- .../nat-network-dns-srv-record.xml | 6 +++++ .../nat-network-name-with-quotes.xml} | 3 ++- ...ecord-minimal.xml => ptr-domains-auto.xml} | 9 +++---- tests/networkxml2xmltest.c | 6 ++++- .../srv-record-protocol.xml | 2 +- .../nat-network-dns-hosts-modified.xml | 1 + .../nat-network-dns-more-hosts.xml | 1 + .../nat-network-dns-srv-records.xml | 6 +++++ .../nat-network-forward-ifaces.xml | 6 +++++ .../nat-network-no-forward-ifaces.xml | 6 +++++ .../nat-network-no-hosts.xml | 1 + tests/networkxml2xmlupdateout/nat-network.xml | 8 +++++++ 31 files changed, 106 insertions(+), 80 deletions(-) copy tests/networkxml2xmlin/{nat-network-dns-srv-record-minimal.xml => dhcp6-nat-network.xml} (53%) copy tests/{networkxml2xmlupdateout/nat-network.xml => networkxml2xmlin/dhcp6-network.xml} (29%) copy tests/networkxml2xmlin/{nat-network-dns-forwarders.xml => nat-network-dns-local-domain.xml} (55%) copy tests/{networkxml2confdata/nat-network-dns-srv-record-minimal.xml => networkxml2xmlin/nat-network-name-with-quotes.xml} (95%) copy tests/{networkxml2xmlupdateout/nat-network.xml => networkxml2xmlin/ptr-domains-auto.xml} (74%) copy tests/networkxml2xmlout/{nat-network-dns-srv-record.xml => dhcp6-nat-network.xml} (59%) copy tests/networkxml2xmlout/{nat-network-dns-srv-record-minimal.xml => dhcp6-network.xml} (39%) copy tests/networkxml2xmlout/{nat-network-dns-forwarders.xml => nat-network-dns-local-domain.xml} (62%) copy tests/{networkxml2confdata/nat-network-dns-srv-record-minimal.xml => networkxml2xmlout/nat-network-name-with-quotes.xml} (90%) copy tests/networkxml2xmlout/{nat-network-dns-srv-record-minimal.xml => ptr-domains-auto.xml} (79%) 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 @@ </ip> <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> </ip> - <ip family='ipv6' address='fc00:db8:ac10:fe01::1' prefix='64'> + <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> </ip> <ip family='ipv6' address='fc00:db8:ac10:fd01::1' prefix='64'> </ip> 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 @@ </forward> <bridge name='virbr0' stp='on' delay='0'/> <dns> - <srv service='name' protocol='tcp' domain='test-domain-name.com' target='test.example.com' port='1111' priority='11' weight='111'/> + <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> diff --git a/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlin/dhcp6-nat-network.xml similarity index 53% copy from tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml copy to tests/networkxml2xmlin/dhcp6-nat-network.xml index a18afae2fd..cab0700f2b 100644 --- a/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlin/dhcp6-nat-network.xml @@ -1,25 +1,26 @@ <network> <name>default</name> <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'> - <interface dev='eth1'/> - </forward> + <forward dev='eth1' mode='nat'/> <bridge name='virbr0' stp='on' delay='0'/> - <dns> - <srv service='name' protocol='tcp'/> - </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> + <range start='192.168.122.2' end='192.168.122.254'/> </dhcp> </ip> <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> + <dhcp> + <range start='2001:db8:ac10:fd01::1:10' end='2001:db8:ac10:fd01::1:ff'/> + <host id='0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63' ip='2001:db8:ac10:fd01::1:20'/> + <host name='paul' ip='2001:db8:ac10:fd01::1:21'/> + <host id='0:3:0:1:0:16:3e:11:22:33' name='peter.xyz' ip='2001:db8:ac10:fd01::1:22'/> + <host id='0:3:0:1:0:16:3e:44:55:33' ip='2001:db8:ac10:fd01::1:23'/> + <host id='0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66' name='badbob' ip='2001:db8:ac10:fd01::1:24'/> + </dhcp> </ip> <ip family='ipv4' address='10.24.10.1'> </ip> diff --git a/tests/networkxml2xmlupdateout/nat-network.xml b/tests/networkxml2xmlin/dhcp6-network.xml similarity index 29% copy from tests/networkxml2xmlupdateout/nat-network.xml copy to tests/networkxml2xmlin/dhcp6-network.xml index 93bc7db51d..ae9ff1f32c 100644 --- a/tests/networkxml2xmlupdateout/nat-network.xml +++ b/tests/networkxml2xmlin/dhcp6-network.xml @@ -1,23 +1,17 @@ <network> <name>default</name> <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'> - <interface dev='eth1'/> - </forward> + <forward dev='eth1' mode='nat'/> <bridge name='virbr0' stp='on' delay='0'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> + <domain name='mynet'/> + <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> + <range start='2001:db8:ac10:fd01::1:10' end='2001:db8:ac10:fd01::1:ff'/> + <host id='0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63' ip='2001:db8:ac10:fd01::1:20'/> + <host name='paul' ip='2001:db8:ac10:fd01::1:21'/> + <host id='0:3:0:1:0:16:3e:11:22:33' name='peter.xyz' ip='2001:db8:ac10:fd01::1:22'/> + <host id='0:3:0:1:0:16:3e:44:55:33' ip='2001:db8:ac10:fd01::1:23'/> + <host id='0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66' name='badbob' ip='2001:db8:ac10:fd01::1:24'/> </dhcp> </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> </network> 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 @@ <dns> <forwarder addr='8.8.8.8'/> <forwarder addr='8.8.4.4'/> - <forwarder domain='example.com' addr='192.168.1.1' port='1234'/> + <forwarder domain='example.com' addr='192.168.1.1'/> + <forwarder domain='example2.com' addr='192.168.2.1' port='1234'/> <forwarder domain='www.example.com'/> </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> 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 @@ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> <forward dev='eth0' mode='nat'/> <bridge name='virbr0' stp='on' delay='0'/> + <domain name="example.com"/> <dns forwardPlainNames='no'> <host ip='192.168.122.122'> <hostname>pudding</hostname> diff --git a/tests/networkxml2xmlin/nat-network-dns-forwarders.xml b/tests/networkxml2xmlin/nat-network-dns-local-domain.xml similarity index 55% copy from tests/networkxml2xmlin/nat-network-dns-forwarders.xml copy to tests/networkxml2xmlin/nat-network-dns-local-domain.xml index dd22b686ab..a92d71f1f2 100644 --- a/tests/networkxml2xmlin/nat-network-dns-forwarders.xml +++ b/tests/networkxml2xmlin/nat-network-dns-local-domain.xml @@ -3,12 +3,7 @@ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> <forward dev='eth0' mode='nat'/> <bridge name='virbr0' stp='on' delay='0' /> - <dns> - <forwarder addr='8.8.8.8'/> - <forwarder addr='8.8.4.4'/> - <forwarder domain='example.com' addr='192.168.1.1' port='1234'/> - <forwarder domain='www.example.com'/> - </dns> + <domain name='example.com' localOnly='yes'/> <ip address='192.168.122.1' netmask='255.255.255.0'> </ip> </network> 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 @@ </ip> <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> + <ip family='ipv6' address='fc00:db8:ac10:fd01::1' prefix='64'> </ip> <ip family='ipv4' address='10.24.10.1'> </ip> 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 @@ <bridge name='virbr0' stp='on' delay='0'/> <dns> <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> + <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> + <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> + <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> + <srv service='name5' protocol='udp' target='test5.example.com' priority='55' weight='555'/> + <srv service='name6' protocol='tcp' domain='test6.com' target='test6.example.com' port='6666' weight='666'/> + <srv service='name7' protocol='tcp' domain='test7.com' target='test7.example.com' weight='777'/> </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlin/nat-network-name-with-quotes.xml similarity index 95% copy from tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml copy to tests/networkxml2xmlin/nat-network-name-with-quotes.xml index 13b1c247d5..eba75d2e2d 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlin/nat-network-name-with-quotes.xml @@ -1,5 +1,5 @@ <network> - <name>default</name> + <name>default"with"quotes"</name> <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> <forward dev='eth1' mode='nat'> <interface dev='eth1'/> diff --git a/tests/networkxml2xmlupdateout/nat-network.xml b/tests/networkxml2xmlin/ptr-domains-auto.xml similarity index 74% copy from tests/networkxml2xmlupdateout/nat-network.xml copy to tests/networkxml2xmlin/ptr-domains-auto.xml index 93bc7db51d..7fe12dc671 100644 --- a/tests/networkxml2xmlupdateout/nat-network.xml +++ b/tests/networkxml2xmlin/ptr-domains-auto.xml @@ -1,20 +1,18 @@ <network> <name>default</name> <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'> - <interface dev='eth1'/> - </forward> + <forward dev='eth1' mode='nat'/> <bridge name='virbr0' stp='on' delay='0'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> + <ip address='192.168.122.1' netmask='255.255.255.0' localPtr='yes'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> </dhcp> </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> + <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0' localPtr='no'> </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> + <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64' localPtr='yes'> </ip> <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> </ip> diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record.xml b/tests/networkxml2xmlout/dhcp6-nat-network.xml similarity index 59% copy from tests/networkxml2xmlout/nat-network-dns-srv-record.xml copy to tests/networkxml2xmlout/dhcp6-nat-network.xml index 1486fc3224..44bb2d1f5d 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-record.xml +++ b/tests/networkxml2xmlout/dhcp6-nat-network.xml @@ -6,9 +6,6 @@ </forward> <bridge name='virbr0' stp='on' delay='0'/> <mac address='52:54:00:00:00:00'/> - <dns> - <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> - </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> @@ -18,9 +15,15 @@ </ip> <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> + <dhcp> + <range start='2001:db8:ac10:fd01::1:10' end='2001:db8:ac10:fd01::1:ff'/> + <host id='0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63' ip='2001:db8:ac10:fd01::1:20'/> + <host name='paul' ip='2001:db8:ac10:fd01::1:21'/> + <host id='0:3:0:1:0:16:3e:11:22:33' name='peter.xyz' ip='2001:db8:ac10:fd01::1:22'/> + <host id='0:3:0:1:0:16:3e:44:55:33' ip='2001:db8:ac10:fd01::1:23'/> + <host id='0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66' name='badbob' ip='2001:db8:ac10:fd01::1:24'/> + </dhcp> </ip> <ip family='ipv4' address='10.24.10.1'> </ip> diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlout/dhcp6-network.xml similarity index 39% copy from tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml copy to tests/networkxml2xmlout/dhcp6-network.xml index 50e968be9d..cabe833e03 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlout/dhcp6-network.xml @@ -6,22 +6,15 @@ </forward> <bridge name='virbr0' stp='on' delay='0'/> <mac address='52:54:00:00:00:00'/> - <dns> - <srv service='name' protocol='tcp'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> + <domain name='mynet'/> + <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> + <range start='2001:db8:ac10:fd01::1:10' end='2001:db8:ac10:fd01::1:ff'/> + <host id='0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63' ip='2001:db8:ac10:fd01::1:20'/> + <host name='paul' ip='2001:db8:ac10:fd01::1:21'/> + <host id='0:3:0:1:0:16:3e:11:22:33' name='peter.xyz' ip='2001:db8:ac10:fd01::1:22'/> + <host id='0:3:0:1:0:16:3e:44:55:33' ip='2001:db8:ac10:fd01::1:23'/> + <host id='0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66' name='badbob' ip='2001:db8:ac10:fd01::1:24'/> </dhcp> </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> </network> 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 @@ <dns> <forwarder addr='8.8.8.8'/> <forwarder addr='8.8.4.4'/> - <forwarder domain='example.com' addr='192.168.1.1' port='1234'/> + <forwarder domain='example.com' addr='192.168.1.1'/> + <forwarder domain='example2.com' addr='192.168.2.1' port='1234'/> <forwarder domain='www.example.com'/> </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> 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 @@ </forward> <bridge name='virbr0' stp='on' delay='0'/> <mac address='52:54:00:00:00:00'/> + <domain name='example.com'/> <dns forwardPlainNames='no'> <host ip='192.168.122.122'> <hostname>pudding</hostname> diff --git a/tests/networkxml2xmlout/nat-network-dns-forwarders.xml b/tests/networkxml2xmlout/nat-network-dns-local-domain.xml similarity index 62% copy from tests/networkxml2xmlout/nat-network-dns-forwarders.xml copy to tests/networkxml2xmlout/nat-network-dns-local-domain.xml index 170b043d09..33f4bbfc32 100644 --- a/tests/networkxml2xmlout/nat-network-dns-forwarders.xml +++ b/tests/networkxml2xmlout/nat-network-dns-local-domain.xml @@ -6,12 +6,7 @@ </forward> <bridge name='virbr0' stp='on' delay='0'/> <mac address='52:54:00:00:00:00'/> - <dns> - <forwarder addr='8.8.8.8'/> - <forwarder addr='8.8.4.4'/> - <forwarder domain='example.com' addr='192.168.1.1' port='1234'/> - <forwarder domain='www.example.com'/> - </dns> + <domain name='example.com' localOnly='yes'/> <ip address='192.168.122.1' netmask='255.255.255.0'> </ip> </network> 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 @@ </ip> <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> + <ip family='ipv6' address='fc00:db8:ac10:fd01::1' prefix='64'> </ip> <ip family='ipv4' address='10.24.10.1'> </ip> 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 @@ <mac address='52:54:00:00:00:00'/> <dns> <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> + <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> + <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> + <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> + <srv service='name5' protocol='udp' target='test5.example.com' priority='55' weight='555'/> + <srv service='name6' protocol='tcp' domain='test6.com' target='test6.example.com' port='6666' weight='666'/> + <srv service='name7' protocol='tcp' domain='test7.com' target='test7.example.com' weight='777'/> </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlout/nat-network-name-with-quotes.xml similarity index 90% copy from tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml copy to tests/networkxml2xmlout/nat-network-name-with-quotes.xml index 13b1c247d5..c0a9cedc7d 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlout/nat-network-name-with-quotes.xml @@ -1,10 +1,11 @@ <network> - <name>default</name> + <name>default"with"quotes"</name> <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> <forward dev='eth1' mode='nat'> <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <mac address='52:54:00:00:00:00'/> <dns> <srv service='name' protocol='tcp'/> </dns> diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlout/ptr-domains-auto.xml similarity index 79% copy from tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml copy to tests/networkxml2xmlout/ptr-domains-auto.xml index 50e968be9d..fe2047b708 100644 --- a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml +++ b/tests/networkxml2xmlout/ptr-domains-auto.xml @@ -6,19 +6,16 @@ </forward> <bridge name='virbr0' stp='on' delay='0'/> <mac address='52:54:00:00:00:00'/> - <dns> - <srv service='name' protocol='tcp'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> + <ip address='192.168.122.1' netmask='255.255.255.0' localPtr='yes'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> </dhcp> </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> + <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0' localPtr='no'> </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> + <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64' localPtr='yes'> </ip> <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> </ip> 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 @@ -<srv protocol='tcp'/> +<srv protocol='tcp' target='test7.example.com'/> 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 @@ <interface dev='eth0'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <domain name='example.com'/> <dns forwardPlainNames='no'> <host ip='192.168.122.122'> <hostname>pudding</hostname> 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 @@ <interface dev='eth0'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <domain name='example.com'/> <dns forwardPlainNames='no'> <host ip='f0:d::f0:d'> <hostname>pudding</hostname> 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 @@ <bridge name='virbr0' stp='on' delay='0'/> <dns> <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> + <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> + <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> + <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> + <srv service='name5' protocol='udp' target='test5.example.com' priority='55' weight='555'/> + <srv service='name6' protocol='tcp' domain='test6.com' target='test6.example.com' port='6666' weight='666'/> + <srv service='name7' protocol='tcp' domain='test7.com' target='test7.example.com' weight='777'/> <srv service='name' protocol='tcp' domain='donkey' target='.' port='404' priority='10' weight='10'/> </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> 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 @@ <bridge name='virbr0' stp='on' delay='0'/> <dns> <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> + <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> + <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> + <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> + <srv service='name5' protocol='udp' target='test5.example.com' priority='55' weight='555'/> + <srv service='name6' protocol='tcp' domain='test6.com' target='test6.example.com' port='6666' weight='666'/> + <srv service='name7' protocol='tcp' domain='test7.com' target='test7.example.com' weight='777'/> </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> 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 @@ <bridge name='virbr0' stp='on' delay='0'/> <dns> <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> + <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> + <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> + <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> + <srv service='name5' protocol='udp' target='test5.example.com' priority='55' weight='555'/> + <srv service='name6' protocol='tcp' domain='test6.com' target='test6.example.com' port='6666' weight='666'/> + <srv service='name7' protocol='tcp' domain='test7.com' target='test7.example.com' weight='777'/> </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> 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 @@ <interface dev='eth0'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <domain name='example.com'/> <dns forwardPlainNames='no'> <host ip='192.168.122.122'> <hostname>pudding</hostname> 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 @@ <interface dev='eth1'/> </forward> <bridge name='virbr0' stp='on' delay='0'/> + <dns> + <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> + <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> + <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> + <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> + <srv service='name5' protocol='udp' target='test5.example.com' priority='55' weight='555'/> + <srv service='name6' protocol='tcp' domain='test6.com' target='test6.example.com' port='6666' weight='666'/> + </dns> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254'/> -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/network/bridge_driver.c | 2 +- .../bandwidth-network.conf | 16 +++ .../nat-network-dns-srv-records.conf | 20 +++ .../nat-network-dns-srv-records.hostsfile | 2 + .../nat-network-explicit-flood.conf | 18 +++ .../nat-network-explicit-flood.hostsfile | 2 + .../nat-network-forward-nat-address.conf | 18 +++ .../nat-network-forward-nat-address.hostsfile | 2 + .../nat-network-forward-nat-ipv6.conf | 12 ++ .../nat-network-forward-nat-no-address.conf | 18 +++ ...t-network-forward-nat-no-address.hostsfile | 2 + tests/networkxml2confdata/passthrough-pf.conf | 11 ++ tests/networkxml2confdata/set-mtu.conf | 20 +++ tests/networkxml2xmltest.c | 136 +++++++++++++++++- 14 files changed, 277 insertions(+), 2 deletions(-) create mode 100644 tests/networkxml2confdata/bandwidth-network.conf create mode 100644 tests/networkxml2confdata/nat-network-dns-srv-records.conf create mode 100644 tests/networkxml2confdata/nat-network-dns-srv-records.hostsfile create mode 100644 tests/networkxml2confdata/nat-network-explicit-flood.conf create mode 100644 tests/networkxml2confdata/nat-network-explicit-flood.hostsfile create mode 100644 tests/networkxml2confdata/nat-network-forward-nat-address.conf create mode 100644 tests/networkxml2confdata/nat-network-forward-nat-address.hostsfile create mode 100644 tests/networkxml2confdata/nat-network-forward-nat-ipv6.conf create mode 100644 tests/networkxml2confdata/nat-network-forward-nat-no-address.conf create mode 100644 tests/networkxml2confdata/nat-network-forward-nat-no-address.hostsfile create mode 100644 tests/networkxml2confdata/passthrough-pf.conf create mode 100644 tests/networkxml2confdata/set-mtu.conf diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 9636984390..104c298683 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -1178,7 +1178,7 @@ networkDnsmasqConfContents(virNetworkObj *obj, /* create dnsmasq config file appropriate for this network */ - /* Don't forget to update networkxml2conftest :-) */ + /* Don't forget to update networkxml2conftest and networkxml2xmltest :-) */ virBufferAsprintf(&configbuf, "##WARNING: THIS IS AN AUTO-GENERATED FILE. " "CHANGES TO IT ARE LIKELY TO BE\n" diff --git a/tests/networkxml2confdata/bandwidth-network.conf b/tests/networkxml2confdata/bandwidth-network.conf new file mode 100644 index 0000000000..d45b23ad7a --- /dev/null +++ b/tests/networkxml2confdata/bandwidth-network.conf @@ -0,0 +1,16 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit test-net +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=virbr1 +dhcp-range=192.168.120.2,192.168.120.254,255.255.255.0 +dhcp-no-override +dhcp-authoritative +dhcp-lease-max=253 +dhcp-hostsfile=/var/lib/libvirt/dnsmasq/test-net.hostsfile +addn-hosts=/var/lib/libvirt/dnsmasq/test-net.addnhosts diff --git a/tests/networkxml2confdata/nat-network-dns-srv-records.conf b/tests/networkxml2confdata/nat-network-dns-srv-records.conf new file mode 100644 index 0000000000..b85eb85af3 --- /dev/null +++ b/tests/networkxml2confdata/nat-network-dns-srv-records.conf @@ -0,0 +1,20 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit default +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=virbr0 +srv-host=_name._tcp.test-domain-name +srv-host=_name._tcp.donkey +dhcp-range=192.168.122.2,192.168.122.254,255.255.255.0 +dhcp-no-override +dhcp-authoritative +dhcp-lease-max=253 +dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile +addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts +dhcp-range=2001:db8:ac10:fe01::1,ra-only +dhcp-range=2001:db8:ac10:fd01::1,ra-only diff --git a/tests/networkxml2confdata/nat-network-dns-srv-records.hostsfile b/tests/networkxml2confdata/nat-network-dns-srv-records.hostsfile new file mode 100644 index 0000000000..deb3f00ac1 --- /dev/null +++ b/tests/networkxml2confdata/nat-network-dns-srv-records.hostsfile @@ -0,0 +1,2 @@ +00:16:3e:77:e2:ed,192.168.122.10,a.example.com +00:16:3e:3e:a9:1a,192.168.122.11,b.example.com diff --git a/tests/networkxml2confdata/nat-network-explicit-flood.conf b/tests/networkxml2confdata/nat-network-explicit-flood.conf new file mode 100644 index 0000000000..873a360acc --- /dev/null +++ b/tests/networkxml2confdata/nat-network-explicit-flood.conf @@ -0,0 +1,18 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit default +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=virbr0 +dhcp-range=192.168.122.2,192.168.122.254,255.255.255.0 +dhcp-no-override +dhcp-authoritative +dhcp-lease-max=253 +dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile +addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts +dhcp-range=2001:db8:ac10:fe01::1,ra-only +dhcp-range=2001:db8:ac10:fd01::1,ra-only diff --git a/tests/networkxml2confdata/nat-network-explicit-flood.hostsfile b/tests/networkxml2confdata/nat-network-explicit-flood.hostsfile new file mode 100644 index 0000000000..deb3f00ac1 --- /dev/null +++ b/tests/networkxml2confdata/nat-network-explicit-flood.hostsfile @@ -0,0 +1,2 @@ +00:16:3e:77:e2:ed,192.168.122.10,a.example.com +00:16:3e:3e:a9:1a,192.168.122.11,b.example.com diff --git a/tests/networkxml2confdata/nat-network-forward-nat-address.conf b/tests/networkxml2confdata/nat-network-forward-nat-address.conf new file mode 100644 index 0000000000..873a360acc --- /dev/null +++ b/tests/networkxml2confdata/nat-network-forward-nat-address.conf @@ -0,0 +1,18 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit default +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=virbr0 +dhcp-range=192.168.122.2,192.168.122.254,255.255.255.0 +dhcp-no-override +dhcp-authoritative +dhcp-lease-max=253 +dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile +addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts +dhcp-range=2001:db8:ac10:fe01::1,ra-only +dhcp-range=2001:db8:ac10:fd01::1,ra-only diff --git a/tests/networkxml2confdata/nat-network-forward-nat-address.hostsfile b/tests/networkxml2confdata/nat-network-forward-nat-address.hostsfile new file mode 100644 index 0000000000..deb3f00ac1 --- /dev/null +++ b/tests/networkxml2confdata/nat-network-forward-nat-address.hostsfile @@ -0,0 +1,2 @@ +00:16:3e:77:e2:ed,192.168.122.10,a.example.com +00:16:3e:3e:a9:1a,192.168.122.11,b.example.com diff --git a/tests/networkxml2confdata/nat-network-forward-nat-ipv6.conf b/tests/networkxml2confdata/nat-network-forward-nat-ipv6.conf new file mode 100644 index 0000000000..3627bbaf1d --- /dev/null +++ b/tests/networkxml2confdata/nat-network-forward-nat-ipv6.conf @@ -0,0 +1,12 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit default +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=virbr0 +addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts +dhcp-range=2001:db8:ac10:fe01::1,ra-only diff --git a/tests/networkxml2confdata/nat-network-forward-nat-no-address.conf b/tests/networkxml2confdata/nat-network-forward-nat-no-address.conf new file mode 100644 index 0000000000..873a360acc --- /dev/null +++ b/tests/networkxml2confdata/nat-network-forward-nat-no-address.conf @@ -0,0 +1,18 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit default +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=virbr0 +dhcp-range=192.168.122.2,192.168.122.254,255.255.255.0 +dhcp-no-override +dhcp-authoritative +dhcp-lease-max=253 +dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile +addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts +dhcp-range=2001:db8:ac10:fe01::1,ra-only +dhcp-range=2001:db8:ac10:fd01::1,ra-only diff --git a/tests/networkxml2confdata/nat-network-forward-nat-no-address.hostsfile b/tests/networkxml2confdata/nat-network-forward-nat-no-address.hostsfile new file mode 100644 index 0000000000..deb3f00ac1 --- /dev/null +++ b/tests/networkxml2confdata/nat-network-forward-nat-no-address.hostsfile @@ -0,0 +1,2 @@ +00:16:3e:77:e2:ed,192.168.122.10,a.example.com +00:16:3e:3e:a9:1a,192.168.122.11,b.example.com diff --git a/tests/networkxml2confdata/passthrough-pf.conf b/tests/networkxml2confdata/passthrough-pf.conf new file mode 100644 index 0000000000..1957dc8011 --- /dev/null +++ b/tests/networkxml2confdata/passthrough-pf.conf @@ -0,0 +1,11 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit local +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=(null) +addn-hosts=/var/lib/libvirt/dnsmasq/local.addnhosts diff --git a/tests/networkxml2confdata/set-mtu.conf b/tests/networkxml2confdata/set-mtu.conf new file mode 100644 index 0000000000..011a288a5b --- /dev/null +++ b/tests/networkxml2confdata/set-mtu.conf @@ -0,0 +1,20 @@ +##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE +##OVERWRITTEN AND LOST. Changes to this configuration should be made using: +## virsh net-edit private +## or other application using the libvirt API. +## +## dnsmasq conf file created by libvirt +strict-order +except-interface=lo +bind-dynamic +interface=virbr2 +dhcp-option=3 +no-resolv +ra-param=*,0,0 +dhcp-range=192.168.152.2,192.168.152.254,255.255.255.0 +dhcp-no-override +dhcp-authoritative +dhcp-lease-max=253 +dhcp-hostsfile=/var/lib/libvirt/dnsmasq/private.hostsfile +addn-hosts=/var/lib/libvirt/dnsmasq/private.addnhosts +dhcp-option=option:mtu,9000 diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index a8dacfe0f3..1d897c1fe4 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -11,6 +11,8 @@ #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 @@ -27,9 +29,12 @@ struct _testInfo { unsigned int flags; testCompareNetXML2XMLResult expectResult; virNetworkXMLOption *xmlopt; /* borrowed, immutable */ + dnsmasqCaps *caps; virNetworkDef *def; char *inxml; char *outxml; + char *outconf; + char *outhostsfile; }; typedef struct _testInfo testInfo; @@ -44,6 +49,8 @@ void testInfoFree(testInfo *info) virNetworkDefFree(info->def); VIR_FREE(info->inxml); VIR_FREE(info->outxml); + VIR_FREE(info->outconf); + VIR_FREE(info->outhostsfile); VIR_FREE(info); } @@ -104,37 +111,163 @@ testCompareXMLToXMLFiles(const void *data) } +static int +testCompareXMLToConfFiles(const void *data) +{ + testInfo *info = (void *) data; + char *confactual = NULL; + g_autofree char *hostsfileactual = NULL; + int ret = -1; + virNetworkDef *def = NULL; + virNetworkObj *obj = NULL; + g_autofree char *pidfile = NULL; + g_autoptr(dnsmasqContext) dctx = NULL; + bool compareFailed = false; + + if (!(obj = virNetworkObjNew())) + goto fail; + + if (!(def = g_steal_pointer(&info->def))) { + /* Previous test wasn't executed. */ + if (!(def = virNetworkDefParse(NULL, info->inxml, info->xmlopt, false))) + goto fail; + + if (networkValidateTests(def) < 0) { + virNetworkDefFree(def); + goto fail; + } + } + + virNetworkObjSetDef(obj, def); + + if (!networkNeedsDnsmasq(def)) + return EXIT_AM_SKIP; + + dctx = dnsmasqContextNew(def->name, "/var/lib/libvirt/dnsmasq"); + + if (dctx == NULL) + goto fail; + + if (networkDnsmasqConfContents(obj, pidfile, &confactual, + &hostsfileactual, dctx, info->caps) < 0) + goto fail; + + /* Any changes to this function ^^ should be reflected here too. */ +#ifndef __linux__ + { + char * tmp; + + if (!(tmp = virStringReplace(confactual, + "except-interface=lo0\n", + "except-interface=lo\n"))) + goto fail; + VIR_FREE(confactual); + confactual = g_steal_pointer(&tmp); + } +#endif + + if (virTestCompareToFile(confactual, info->outconf) < 0) + compareFailed = true; + + if (hostsfileactual) { + if (virTestCompareToFile(hostsfileactual, info->outhostsfile) < 0) { + compareFailed = true; + } + } else { + if (virFileExists(info->outhostsfile)) { + VIR_TEST_DEBUG("%s: hostsfile exists but the configuration did not specify any host", + info->outhostsfile); + compareFailed = true; + } + } + + if (compareFailed) + goto fail; + + ret = 0; + + fail: + VIR_FREE(confactual); + virNetworkObjEndAPI(&obj); + return ret; +} + +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 = g_strdup("Dnsmasq version 2.67\n"); + *status = EXIT_SUCCESS; + } else { + *status = EXIT_FAILURE; + } +} + + +static dnsmasqCaps * +buildCaps(void) +{ + g_autoptr(dnsmasqCaps) caps = NULL; + g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew(); + + virCommandSetDryRun(dryRunToken, NULL, true, true, buildCapsCallback, NULL); + + caps = dnsmasqCapsNewFromBinary(); + + return g_steal_pointer(&caps); +} + + static void testRun(const char *name, int *ret, virNetworkXMLOption *xmlopt, + dnsmasqCaps *caps, testCompareNetXML2XMLResult expectResult, unsigned int flags) { g_autofree char *name_xml2xml = g_strdup_printf("Network XML-2-XML %s", name); + g_autofree char *name_xml2conf = g_strdup_printf("Network XML-2-Conf %s", name); g_autoptr(testInfo) info = g_new0(testInfo, 1); info->name = name; info->flags = flags; info->expectResult = expectResult; info->xmlopt = xmlopt; + info->caps = caps; info->inxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", abs_srcdir, name); info->outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, name); + /* Temporarily use conf files from networkxml2confdata/ */ + info->outconf = g_strdup_printf("%s/networkxml2confdata/%s.conf", abs_srcdir, name); + info->outhostsfile = g_strdup_printf("%s/networkxml2confdata/%s.hostsfile", abs_srcdir, name); virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLFiles, info); + + if (expectResult == TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) + virTestRunLog(ret, name_xml2conf, testCompareXMLToConfFiles, info); } static int mymain(void) { g_autoptr(virNetworkXMLOption) xmlopt = NULL; + g_autoptr(dnsmasqCaps) caps = NULL; int ret = 0; if (!(xmlopt = networkDnsmasqCreateXMLConf())) return -1; + if (!(caps = buildCaps())) + return -1; + #define DO_TEST_FULL(name, flags, expectResult) \ - testRun(name, &ret, xmlopt, expectResult, flags) + testRun(name, &ret, xmlopt, caps, expectResult, flags) #define DO_TEST(name) \ DO_TEST_FULL(name, 0, TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS) #define DO_TEST_FLAGS(name, flags) \ @@ -202,4 +335,5 @@ mymain(void) VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci"), + VIR_TEST_MOCK("virdnsmasq"), VIR_TEST_MOCK("virrandom")) -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Now that networkxml2xmltest does XML->conf tests the networkxml2conftest is redundant. Drop it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- 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, /* create dnsmasq config file appropriate for this network */ - /* 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 if conf.has('WITH_NETWORK') tests += [ - { '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 <config.h> - -#include <unistd.h> - -#include <sys/types.h> -#include <fcntl.h> - -#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 = NULL; - g_autofree char *hostsfileactual = NULL; - int ret = -1; - virNetworkDef *def = NULL; - virNetworkObj *obj = NULL; - g_autofree char *pidfile = NULL; - g_autoptr(dnsmasqContext) dctx = NULL; - g_autoptr(virNetworkXMLOption) xmlopt = NULL; - bool compareFailed = false; - - if (!(xmlopt = networkDnsmasqCreateXMLConf())) - goto fail; - - if (!(obj = virNetworkObjNew())) - goto fail; - - if (!(def = 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 not start dnsmasq in real life scenario"); - goto fail; - } - - dctx = dnsmasqContextNew(def->name, "/var/lib/libvirt/dnsmasq"); - - if (dctx == 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 = virStringReplace(confactual, - "except-interface=lo0\n", - "except-interface=lo\n"))) - goto fail; - VIR_FREE(confactual); - confactual = g_steal_pointer(&tmp); - } -#endif - - if (virTestCompareToFile(confactual, outconf) < 0) - compareFailed = true; - - if (hostsfileactual) { - if (virTestCompareToFile(hostsfileactual, outhostsfile) < 0) { - compareFailed = true; - } - } else { - if (virFileExists(outhostsfile)) { - VIR_TEST_DEBUG("%s: hostsfile exists but the configuration did not specify any host", - outhostsfile); - compareFailed = true; - } - } - - if (compareFailed) - goto fail; - - ret = 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 = -1; - const testInfo *info = data; - g_autofree char *inxml = NULL; - g_autofree char *outconf = NULL; - g_autofree char *outhostsfile = NULL; - - inxml = g_strdup_printf("%s/networkxml2confdata/%s.xml", abs_srcdir, info->name); - outconf = g_strdup_printf("%s/networkxml2confdata/%s.conf", abs_srcdir, info->name); - outhostsfile = g_strdup_printf("%s/networkxml2confdata/%s.hostsfile", abs_srcdir, info->name); - - result = testCompareXMLToConfFiles(inxml, outconf, outhostsfile, info->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 = g_strdup("Dnsmasq version 2.67\n"); - *status = EXIT_SUCCESS; - } else { - *status = EXIT_FAILURE; - } -} - -static dnsmasqCaps * -buildCaps(void) -{ - g_autoptr(dnsmasqCaps) caps = NULL; - g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew(); - - virCommandSetDryRun(dryRunToken, NULL, true, true, buildCapsCallback, NULL); - - caps = dnsmasqCapsNewFromBinary(); - - return g_steal_pointer(&caps); -} - - -static int -mymain(void) -{ - int ret = 0; - g_autoptr(dnsmasqCaps) full = NULL; - - if (!(full = 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 = xname; \ - info.caps = xcaps; \ - if (virTestRun("Network XML-2-Conf " xname, \ - testCompareXMLToConfHelper, &info) < 0) { \ - ret = -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 == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIR_TEST_MAIN_PRELOAD(mymain, - VIR_TEST_MOCK("virpci"), - VIR_TEST_MOCK("virrandom"), - VIR_TEST_MOCK("virdnsmasq")) -- 2.52.0
From: Michal Privoznik <mprivozn@redhat.com> Now that networkxml2xmltest does both XML -> XML and XML -> conf tests its name became misleading. Rename it to networkxmlconftest and move its data into networkxmlconfdata/ dir. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/network/bridge_driver.c | 2 +- tests/meson.build | 2 +- .../dhcp6host-routed-network.xml | 22 ------------- .../networkxml2confdata/isolated-network.xml | 11 ------- .../nat-network-dns-forwarders.xml | 15 --------- .../nat-network-dns-hosts.xml | 15 --------- tests/networkxml2confdata/nat-network-mtu.xml | 22 ------------- tests/networkxml2confdata/nat-network.xml | 21 ------------ tests/networkxml2confdata/netboot-network.xml | 14 -------- .../netboot-proxy-network.xml | 13 -------- tests/networkxml2confdata/open-network.xml | 9 ------ tests/networkxml2confdata/routed-network.xml | 9 ------ tests/networkxml2xmlin/dhcp6-nat-network.xml | 27 ---------------- tests/networkxml2xmlin/dhcp6-network.xml | 17 ---------- tests/networkxml2xmlin/dnsmasq-options.xml | 15 --------- tests/networkxml2xmlin/leasetime-hours.xml | 1 - tests/networkxml2xmlin/leasetime-infinite.xml | 1 - tests/networkxml2xmlin/leasetime-minutes.xml | 1 - tests/networkxml2xmlin/leasetime-seconds.xml | 1 - .../nat-network-dns-forward-plain.xml | 9 ------ .../nat-network-dns-forwarder-no-resolv.xml | 11 ------- .../nat-network-dns-local-domain.xml | 9 ------ .../nat-network-dns-srv-record-minimal.xml | 26 --------------- .../nat-network-dns-srv-record.xml | 32 ------------------- .../nat-network-dns-txt-record.xml | 24 -------------- .../nat-network-name-with-quotes.xml | 26 --------------- tests/networkxml2xmlin/netboot-tftp.xml | 1 - tests/networkxml2xmlin/ptr-domains-auto.xml | 21 ------------ tests/networkxml2xmlout/leasetime-hours.xml | 1 - .../networkxml2xmlout/leasetime-infinite.xml | 1 - tests/networkxml2xmlout/leasetime-minutes.xml | 1 - tests/networkxml2xmlout/leasetime-seconds.xml | 1 - tests/networkxml2xmlout/netboot-tftp.xml | 1 - tests/networkxml2xmlupdatetest.c | 2 +- .../8021Qbh-net.expect.xml} | 0 .../8021Qbh-net.xml | 0 .../bandwidth-network.conf | 0 .../bandwidth-network.expect.xml} | 0 .../bandwidth-network.xml | 0 .../dhcp6-nat-network.conf | 0 .../dhcp6-nat-network.expect.xml} | 0 .../dhcp6-nat-network.hostsfile | 0 .../dhcp6-nat-network.xml | 0 .../dhcp6-network.conf | 0 .../dhcp6-network.expect.xml} | 0 .../dhcp6-network.hostsfile | 0 .../dhcp6-network.xml | 0 .../dhcp6host-routed-network.conf | 0 .../dhcp6host-routed-network.expect.xml} | 0 .../dhcp6host-routed-network.hostsfile | 0 .../dhcp6host-routed-network.xml | 0 .../direct-net.expect.xml} | 0 .../direct-net.xml | 0 .../dnsmasq-options.conf | 0 .../dnsmasq-options.expect.xml} | 0 .../dnsmasq-options.xml | 0 .../empty-allow-ipv6.expect.xml} | 0 .../empty-allow-ipv6.xml | 0 .../host-bridge-net.expect.xml} | 0 .../host-bridge-net.xml | 0 .../host-bridge-no-flood.expect.xml} | 0 .../host-bridge-no-flood.xml | 0 .../hostdev-duplicate.xml | 0 .../hostdev-pf-driver-model.expect.xml} | 0 .../hostdev-pf-driver-model.xml | 0 .../hostdev-pf.expect.xml} | 0 .../hostdev-pf.xml | 0 .../hostdev.expect.xml} | 0 .../hostdev.xml | 0 .../isolated-network.conf | 0 .../isolated-network.expect.xml} | 0 .../isolated-network.xml | 0 .../isolated-ports.expect.xml} | 0 .../isolated-ports.xml | 0 .../leasetime-hours.conf | 0 .../leasetime-hours.expect.xml | 1 + .../leasetime-hours.hostsfile | 0 .../leasetime-hours.xml | 0 .../leasetime-infinite.conf | 0 .../leasetime-infinite.expect.xml | 1 + .../leasetime-infinite.hostsfile | 0 .../leasetime-infinite.xml | 0 .../leasetime-minutes.conf | 0 .../leasetime-minutes.expect.xml | 1 + .../leasetime-minutes.hostsfile | 0 .../leasetime-minutes.xml | 0 .../leasetime-seconds.conf | 0 .../leasetime-seconds.expect.xml | 1 + .../leasetime-seconds.hostsfile | 0 .../leasetime-seconds.xml | 0 .../metadata.expect.xml} | 0 .../metadata.xml | 0 .../nat-network-dns-forward-plain.conf | 0 .../nat-network-dns-forward-plain.expect.xml} | 0 .../nat-network-dns-forward-plain.xml | 0 .../nat-network-dns-forwarder-no-resolv.conf | 0 ...etwork-dns-forwarder-no-resolv.expect.xml} | 0 .../nat-network-dns-forwarder-no-resolv.xml | 0 .../nat-network-dns-forwarders.conf | 0 .../nat-network-dns-forwarders.expect.xml} | 0 .../nat-network-dns-forwarders.xml | 0 .../nat-network-dns-hosts.conf | 0 .../nat-network-dns-hosts.expect.xml} | 0 .../nat-network-dns-hosts.xml | 0 .../nat-network-dns-local-domain.conf | 0 .../nat-network-dns-local-domain.expect.xml} | 0 .../nat-network-dns-local-domain.xml | 0 .../nat-network-dns-srv-record-minimal.conf | 0 ...network-dns-srv-record-minimal.expect.xml} | 0 ...t-network-dns-srv-record-minimal.hostsfile | 0 .../nat-network-dns-srv-record-minimal.xml | 0 .../nat-network-dns-srv-record.conf | 0 .../nat-network-dns-srv-record.expect.xml} | 0 .../nat-network-dns-srv-record.hostsfile | 0 .../nat-network-dns-srv-record.xml | 0 .../nat-network-dns-srv-records.conf | 0 .../nat-network-dns-srv-records.expect.xml} | 0 .../nat-network-dns-srv-records.hostsfile | 0 .../nat-network-dns-srv-records.xml | 0 .../nat-network-dns-txt-record.conf | 0 .../nat-network-dns-txt-record.expect.xml} | 0 .../nat-network-dns-txt-record.hostsfile | 0 .../nat-network-dns-txt-record.xml | 0 .../nat-network-explicit-flood.conf | 0 .../nat-network-explicit-flood.expect.xml} | 0 .../nat-network-explicit-flood.hostsfile | 0 .../nat-network-explicit-flood.xml | 0 .../nat-network-forward-nat-address.conf | 0 ...at-network-forward-nat-address.expect.xml} | 0 .../nat-network-forward-nat-address.hostsfile | 0 .../nat-network-forward-nat-address.xml | 0 .../nat-network-forward-nat-ipv6.conf | 0 .../nat-network-forward-nat-ipv6.expect.xml} | 0 .../nat-network-forward-nat-ipv6.xml | 0 .../nat-network-forward-nat-no-address.conf | 0 ...network-forward-nat-no-address.expect.xml} | 0 ...t-network-forward-nat-no-address.hostsfile | 0 .../nat-network-forward-nat-no-address.xml | 0 .../nat-network-mtu.conf | 0 .../nat-network-mtu.expect.xml} | 0 .../nat-network-mtu.hostsfile | 0 .../nat-network-mtu.xml | 0 .../nat-network-name-with-quotes.conf | 0 .../nat-network-name-with-quotes.expect.xml} | 0 .../nat-network-name-with-quotes.hostsfile | 0 .../nat-network-name-with-quotes.xml | 0 .../nat-network.conf | 0 .../nat-network.expect.xml} | 0 .../nat-network.hostsfile | 0 .../nat-network.xml | 0 .../netboot-network.conf | 0 .../netboot-network.expect.xml} | 0 .../netboot-network.xml | 0 .../netboot-proxy-network.conf | 0 .../netboot-proxy-network.expect.xml} | 0 .../netboot-proxy-network.xml | 0 .../netboot-tftp.conf | 0 .../netboot-tftp.expect.xml | 1 + .../netboot-tftp.xml | 0 .../open-network-with-forward-dev.xml | 0 .../open-network.conf | 0 .../open-network.expect.xml} | 0 .../open-network.xml | 0 .../openvswitch-net.expect.xml} | 0 .../openvswitch-net.xml | 0 .../passthrough-address-crash.xml | 0 .../passthrough-duplicate.xml | 0 .../passthrough-pf.conf | 0 .../passthrough-pf.xml | 0 .../ptr-domains-auto.conf | 0 .../ptr-domains-auto.expect.xml} | 0 .../ptr-domains-auto.hostsfile | 0 .../ptr-domains-auto.xml | 0 .../routed-network-no-dns-extra-elements.xml | 0 .../routed-network-no-dns.expect.xml} | 0 .../routed-network-no-dns.xml | 0 .../routed-network.conf | 0 .../routed-network.expect.xml} | 0 .../routed-network.xml | 0 .../set-mtu.conf | 0 .../set-mtu.expect.xml} | 0 .../set-mtu.xml | 0 .../vepa-net.expect.xml} | 0 .../vepa-net.xml | 0 ...workxml2xmltest.c => networkxmlconftest.c} | 9 +++--- tests/qemuxmlconftest.c | 6 ++-- tests/virschematest.c | 4 +-- 187 files changed, 16 insertions(+), 392 deletions(-) delete mode 100644 tests/networkxml2confdata/dhcp6host-routed-network.xml delete mode 100644 tests/networkxml2confdata/isolated-network.xml delete mode 100644 tests/networkxml2confdata/nat-network-dns-forwarders.xml delete mode 100644 tests/networkxml2confdata/nat-network-dns-hosts.xml delete mode 100644 tests/networkxml2confdata/nat-network-mtu.xml delete mode 100644 tests/networkxml2confdata/nat-network.xml delete mode 100644 tests/networkxml2confdata/netboot-network.xml delete mode 100644 tests/networkxml2confdata/netboot-proxy-network.xml delete mode 100644 tests/networkxml2confdata/open-network.xml delete mode 100644 tests/networkxml2confdata/routed-network.xml delete mode 100644 tests/networkxml2xmlin/dhcp6-nat-network.xml delete mode 100644 tests/networkxml2xmlin/dhcp6-network.xml delete mode 100644 tests/networkxml2xmlin/dnsmasq-options.xml delete mode 120000 tests/networkxml2xmlin/leasetime-hours.xml delete mode 120000 tests/networkxml2xmlin/leasetime-infinite.xml delete mode 120000 tests/networkxml2xmlin/leasetime-minutes.xml delete mode 120000 tests/networkxml2xmlin/leasetime-seconds.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-forward-plain.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-forwarder-no-resolv.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-local-domain.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-srv-record.xml delete mode 100644 tests/networkxml2xmlin/nat-network-dns-txt-record.xml delete mode 100644 tests/networkxml2xmlin/nat-network-name-with-quotes.xml delete mode 120000 tests/networkxml2xmlin/netboot-tftp.xml delete mode 100644 tests/networkxml2xmlin/ptr-domains-auto.xml delete mode 120000 tests/networkxml2xmlout/leasetime-hours.xml delete mode 120000 tests/networkxml2xmlout/leasetime-infinite.xml delete mode 120000 tests/networkxml2xmlout/leasetime-minutes.xml delete mode 120000 tests/networkxml2xmlout/leasetime-seconds.xml delete mode 120000 tests/networkxml2xmlout/netboot-tftp.xml rename tests/{networkxml2xmlout/8021Qbh-net.xml => networkxmlconfdata/8021Qbh-net.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/8021Qbh-net.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/bandwidth-network.conf (100%) rename tests/{networkxml2xmlout/bandwidth-network.xml => networkxmlconfdata/bandwidth-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/bandwidth-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-nat-network.conf (100%) rename tests/{networkxml2xmlout/dhcp6-nat-network.xml => networkxmlconfdata/dhcp6-nat-network.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-nat-network.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-nat-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-network.conf (100%) rename tests/{networkxml2xmlout/dhcp6-network.xml => networkxmlconfdata/dhcp6-network.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-network.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6host-routed-network.conf (100%) rename tests/{networkxml2xmlout/dhcp6host-routed-network.xml => networkxmlconfdata/dhcp6host-routed-network.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dhcp6host-routed-network.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/dhcp6host-routed-network.xml (100%) rename tests/{networkxml2xmlout/direct-net.xml => networkxmlconfdata/direct-net.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/direct-net.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dnsmasq-options.conf (100%) rename tests/{networkxml2xmlout/dnsmasq-options.xml => networkxmlconfdata/dnsmasq-options.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/dnsmasq-options.xml (100%) rename tests/{networkxml2xmlout/empty-allow-ipv6.xml => networkxmlconfdata/empty-allow-ipv6.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/empty-allow-ipv6.xml (100%) rename tests/{networkxml2xmlout/host-bridge-net.xml => networkxmlconfdata/host-bridge-net.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/host-bridge-net.xml (100%) rename tests/{networkxml2xmlout/host-bridge-no-flood.xml => networkxmlconfdata/host-bridge-no-flood.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/host-bridge-no-flood.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/hostdev-duplicate.xml (100%) rename tests/{networkxml2xmlin/hostdev-pf-driver-model.xml => networkxmlconfdata/hostdev-pf-driver-model.expect.xml} (100%) rename tests/{networkxml2xmlout => networkxmlconfdata}/hostdev-pf-driver-model.xml (100%) rename tests/{networkxml2xmlin/hostdev-pf.xml => networkxmlconfdata/hostdev-pf.expect.xml} (100%) rename tests/{networkxml2xmlout => networkxmlconfdata}/hostdev-pf.xml (100%) rename tests/{networkxml2xmlin/hostdev.xml => networkxmlconfdata/hostdev.expect.xml} (100%) rename tests/{networkxml2xmlout => networkxmlconfdata}/hostdev.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/isolated-network.conf (100%) rename tests/{networkxml2xmlout/isolated-network.xml => networkxmlconfdata/isolated-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/isolated-network.xml (100%) rename tests/{networkxml2xmlout/isolated-ports.xml => networkxmlconfdata/isolated-ports.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/isolated-ports.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-hours.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-hours.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-hours.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-hours.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-infinite.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-infinite.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-infinite.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-infinite.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-minutes.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-minutes.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-minutes.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-minutes.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-seconds.conf (100%) create mode 120000 tests/networkxmlconfdata/leasetime-seconds.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-seconds.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/leasetime-seconds.xml (100%) rename tests/{networkxml2xmlout/metadata.xml => networkxmlconfdata/metadata.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/metadata.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forward-plain.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-forward-plain.xml => networkxmlconfdata/nat-network-dns-forward-plain.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forward-plain.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forwarder-no-resolv.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml => networkxmlconfdata/nat-network-dns-forwarder-no-resolv.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forwarder-no-resolv.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-forwarders.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-forwarders.xml => networkxmlconfdata/nat-network-dns-forwarders.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-dns-forwarders.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-hosts.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-hosts.xml => networkxmlconfdata/nat-network-dns-hosts.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-dns-hosts.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-local-domain.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-local-domain.xml => networkxmlconfdata/nat-network-dns-local-domain.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-local-domain.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record-minimal.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-srv-record-minimal.xml => networkxmlconfdata/nat-network-dns-srv-record-minimal.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record-minimal.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record-minimal.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-srv-record.xml => networkxmlconfdata/nat-network-dns-srv-record.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-record.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-records.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-srv-records.xml => networkxmlconfdata/nat-network-dns-srv-records.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-srv-records.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-dns-srv-records.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-txt-record.conf (100%) rename tests/{networkxml2xmlout/nat-network-dns-txt-record.xml => networkxmlconfdata/nat-network-dns-txt-record.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-txt-record.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-dns-txt-record.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-explicit-flood.conf (100%) rename tests/{networkxml2xmlout/nat-network-explicit-flood.xml => networkxmlconfdata/nat-network-explicit-flood.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-explicit-flood.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-explicit-flood.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-forward-nat-address.conf (100%) rename tests/{networkxml2xmlout/nat-network-forward-nat-address.xml => networkxmlconfdata/nat-network-forward-nat-address.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-forward-nat-address.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-forward-nat-address.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-forward-nat-ipv6.conf (100%) rename tests/{networkxml2xmlout/nat-network-forward-nat-ipv6.xml => networkxmlconfdata/nat-network-forward-nat-ipv6.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-forward-nat-ipv6.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-forward-nat-no-address.conf (100%) rename tests/{networkxml2xmlout/nat-network-forward-nat-no-address.xml => networkxmlconfdata/nat-network-forward-nat-no-address.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-forward-nat-no-address.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-forward-nat-no-address.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-mtu.conf (100%) rename tests/{networkxml2xmlout/nat-network-mtu.xml => networkxmlconfdata/nat-network-mtu.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-mtu.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network-mtu.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-name-with-quotes.conf (100%) rename tests/{networkxml2xmlout/nat-network-name-with-quotes.xml => networkxmlconfdata/nat-network-name-with-quotes.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-name-with-quotes.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network-name-with-quotes.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network.conf (100%) rename tests/{networkxml2xmlout/nat-network.xml => networkxmlconfdata/nat-network.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/nat-network.hostsfile (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/nat-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-network.conf (100%) rename tests/{networkxml2xmlout/netboot-network.xml => networkxmlconfdata/netboot-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/netboot-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-proxy-network.conf (100%) rename tests/{networkxml2xmlout/netboot-proxy-network.xml => networkxmlconfdata/netboot-proxy-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/netboot-proxy-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-tftp.conf (100%) create mode 120000 tests/networkxmlconfdata/netboot-tftp.expect.xml rename tests/{networkxml2confdata => networkxmlconfdata}/netboot-tftp.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/open-network-with-forward-dev.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/open-network.conf (100%) rename tests/{networkxml2xmlout/open-network.xml => networkxmlconfdata/open-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/open-network.xml (100%) rename tests/{networkxml2xmlin/openvswitch-net.xml => networkxmlconfdata/openvswitch-net.expect.xml} (100%) rename tests/{networkxml2xmlout => networkxmlconfdata}/openvswitch-net.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/passthrough-address-crash.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/passthrough-duplicate.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/passthrough-pf.conf (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/passthrough-pf.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/ptr-domains-auto.conf (100%) rename tests/{networkxml2xmlout/ptr-domains-auto.xml => networkxmlconfdata/ptr-domains-auto.expect.xml} (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/ptr-domains-auto.hostsfile (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/ptr-domains-auto.xml (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/routed-network-no-dns-extra-elements.xml (100%) rename tests/{networkxml2xmlout/routed-network-no-dns.xml => networkxmlconfdata/routed-network-no-dns.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/routed-network-no-dns.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/routed-network.conf (100%) rename tests/{networkxml2xmlout/routed-network.xml => networkxmlconfdata/routed-network.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/routed-network.xml (100%) rename tests/{networkxml2confdata => networkxmlconfdata}/set-mtu.conf (100%) rename tests/{networkxml2xmlout/set-mtu.xml => networkxmlconfdata/set-mtu.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/set-mtu.xml (100%) rename tests/{networkxml2xmlout/vepa-net.xml => networkxmlconfdata/vepa-net.expect.xml} (100%) rename tests/{networkxml2xmlin => networkxmlconfdata}/vepa-net.xml (100%) rename tests/{networkxml2xmltest.c => networkxmlconftest.c} (96%) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 665eeecedb..d50d42c98c 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -1178,7 +1178,7 @@ networkDnsmasqConfContents(virNetworkObj *obj, /* create dnsmasq config file appropriate for this network */ - /* Don't forget to update networkxml2xmltest :-) */ + /* Don't forget to update networkxmlconftest :-) */ 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 00c81877af..b28ad4a65b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -408,7 +408,7 @@ endif if conf.has('WITH_NETWORK') tests += [ { 'name': 'networkxml2firewalltest', 'include': [ network_inc_dir ], 'link_with': [ network_driver_impl ] }, - { 'name': 'networkxml2xmltest', 'include': [ network_inc_dir ], 'link_with': [ network_driver_impl ], }, + { 'name': 'networkxmlconftest', 'include': [ network_inc_dir ], 'link_with': [ network_driver_impl ], }, ] endif diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.xml b/tests/networkxml2confdata/dhcp6host-routed-network.xml deleted file mode 100644 index 42b9d3f16a..0000000000 --- a/tests/networkxml2confdata/dhcp6host-routed-network.xml +++ /dev/null @@ -1,22 +0,0 @@ -<network> - <name>local</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='route'/> - <bridge name='virbr1' stp='on' delay='0'/> - <mac address='12:34:56:78:9A:BC'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - <dhcp> - <host id='0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63' ip='2001:db8:ac10:fd01::1:20'/> - <host name='paul' ip='2001:db8:ac10:fd01::1:21'/> - <host id='0:3:0:1:0:16:3e:11:22:33' name='peter.xyz' ip='2001:db8:ac10:fd01::1:22'/> - <host id='0:3:0:1:0:16:3e:44:55:33' ip='2001:db8:ac10:fd01::1:23'/> - <host id='0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66' name='badbob' ip='2001:db8:ac10:fd01::1:24'/> - </dhcp> - </ip> -</network> diff --git a/tests/networkxml2confdata/isolated-network.xml b/tests/networkxml2confdata/isolated-network.xml deleted file mode 100644 index b22d4ea775..0000000000 --- a/tests/networkxml2confdata/isolated-network.xml +++ /dev/null @@ -1,11 +0,0 @@ -<network> - <name>private</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <bridge name='virbr2' stp='on' delay='0'/> - <mac address='52:54:00:17:3F:37'/> - <ip address='192.168.152.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.152.2' end='192.168.152.254'/> - </dhcp> - </ip> -</network> diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.xml b/tests/networkxml2confdata/nat-network-dns-forwarders.xml deleted file mode 100644 index d84576b1b3..0000000000 --- a/tests/networkxml2confdata/nat-network-dns-forwarders.xml +++ /dev/null @@ -1,15 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> - <forward dev='eth0' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <dns> - <forwarder addr='8.8.8.8'/> - <forwarder addr='8.8.4.4'/> - <forwarder domain='example.com' addr='192.168.1.1'/> - <forwarder domain='example2.com' addr='192.168.2.1' port='1234'/> - <forwarder domain='www.example.com'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.xml b/tests/networkxml2confdata/nat-network-dns-hosts.xml deleted file mode 100644 index 9add45656a..0000000000 --- a/tests/networkxml2confdata/nat-network-dns-hosts.xml +++ /dev/null @@ -1,15 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> - <forward dev='eth0' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <domain name="example.com"/> - <dns forwardPlainNames='no'> - <host ip='192.168.122.1'> - <hostname>host</hostname> - <hostname>gateway</hostname> - </host> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2confdata/nat-network-mtu.xml b/tests/networkxml2confdata/nat-network-mtu.xml deleted file mode 100644 index 87b214e95c..0000000000 --- a/tests/networkxml2confdata/nat-network-mtu.xml +++ /dev/null @@ -1,22 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <mtu size='7000'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2confdata/nat-network.xml b/tests/networkxml2confdata/nat-network.xml deleted file mode 100644 index e44d35d83d..0000000000 --- a/tests/networkxml2confdata/nat-network.xml +++ /dev/null @@ -1,21 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2confdata/netboot-network.xml b/tests/networkxml2confdata/netboot-network.xml deleted file mode 100644 index ec06c30050..0000000000 --- a/tests/networkxml2confdata/netboot-network.xml +++ /dev/null @@ -1,14 +0,0 @@ -<network> - <name>netboot</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward mode='nat'/> - <bridge name='virbr1' stp='off' delay='1'/> - <domain name='example.com'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <bootp file='pxeboot.img'/> - </dhcp> - <tftp root='/var/lib/tftproot'/> - </ip> -</network> diff --git a/tests/networkxml2confdata/netboot-proxy-network.xml b/tests/networkxml2confdata/netboot-proxy-network.xml deleted file mode 100644 index a5b7c1e4e6..0000000000 --- a/tests/networkxml2confdata/netboot-proxy-network.xml +++ /dev/null @@ -1,13 +0,0 @@ -<network> - <name>netboot</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward mode='nat'/> - <bridge name='virbr1' stp='off' delay='1'/> - <domain name='example.com'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <bootp file='pxeboot.img' server='10.20.30.40'/> - </dhcp> - </ip> -</network> diff --git a/tests/networkxml2confdata/open-network.xml b/tests/networkxml2confdata/open-network.xml deleted file mode 100644 index e0b3f039f4..0000000000 --- a/tests/networkxml2confdata/open-network.xml +++ /dev/null @@ -1,9 +0,0 @@ -<network> - <name>open</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward mode='open'/> - <bridge name='virbr1' stp='on' delay='0'/> - <mac address='12:34:56:78:9A:BC'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2confdata/routed-network.xml b/tests/networkxml2confdata/routed-network.xml deleted file mode 100644 index 6b0853a0b4..0000000000 --- a/tests/networkxml2confdata/routed-network.xml +++ /dev/null @@ -1,9 +0,0 @@ -<network> - <name>local</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='route'/> - <bridge name='virbr1' stp='on' delay='0'/> - <mac address='12:34:56:78:9A:BC'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/dhcp6-nat-network.xml b/tests/networkxml2xmlin/dhcp6-nat-network.xml deleted file mode 100644 index cab0700f2b..0000000000 --- a/tests/networkxml2xmlin/dhcp6-nat-network.xml +++ /dev/null @@ -1,27 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - <range start='192.168.122.2' end='192.168.122.254'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - <dhcp> - <range start='2001:db8:ac10:fd01::1:10' end='2001:db8:ac10:fd01::1:ff'/> - <host id='0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63' ip='2001:db8:ac10:fd01::1:20'/> - <host name='paul' ip='2001:db8:ac10:fd01::1:21'/> - <host id='0:3:0:1:0:16:3e:11:22:33' name='peter.xyz' ip='2001:db8:ac10:fd01::1:22'/> - <host id='0:3:0:1:0:16:3e:44:55:33' ip='2001:db8:ac10:fd01::1:23'/> - <host id='0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66' name='badbob' ip='2001:db8:ac10:fd01::1:24'/> - </dhcp> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/dhcp6-network.xml b/tests/networkxml2xmlin/dhcp6-network.xml deleted file mode 100644 index ae9ff1f32c..0000000000 --- a/tests/networkxml2xmlin/dhcp6-network.xml +++ /dev/null @@ -1,17 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <domain name='mynet'/> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - <dhcp> - <range start='2001:db8:ac10:fd01::1:10' end='2001:db8:ac10:fd01::1:ff'/> - <host id='0:4:7e:7d:f0:7d:a8:bc:c5:d2:13:32:11:ed:16:ea:84:63' ip='2001:db8:ac10:fd01::1:20'/> - <host name='paul' ip='2001:db8:ac10:fd01::1:21'/> - <host id='0:3:0:1:0:16:3e:11:22:33' name='peter.xyz' ip='2001:db8:ac10:fd01::1:22'/> - <host id='0:3:0:1:0:16:3e:44:55:33' ip='2001:db8:ac10:fd01::1:23'/> - <host id='0:1:0:1:18:aa:62:fe:0:16:3e:44:55:66' name='badbob' ip='2001:db8:ac10:fd01::1:24'/> - </dhcp> - </ip> -</network> diff --git a/tests/networkxml2xmlin/dnsmasq-options.xml b/tests/networkxml2xmlin/dnsmasq-options.xml deleted file mode 100644 index 35a87b8e3e..0000000000 --- a/tests/networkxml2xmlin/dnsmasq-options.xml +++ /dev/null @@ -1,15 +0,0 @@ -<network xmlns:dnsmasq="http://libvirt.org/schemas/network/dnsmasq/1.0"> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <bridge name="virbr0"/> - <forward mode="nat" dev="eth1"/> - <ip address="192.168.122.1" netmask="255.255.255.0"> - <dhcp> - <range start="192.168.122.2" end="192.168.122.254"/> - </dhcp> - </ip> - <dnsmasq:options> - <dnsmasq:option value="foo=bar"/> - <dnsmasq:option value="cname=*.cloudapps.example.com,master.example.com"/> - </dnsmasq:options> -</network> diff --git a/tests/networkxml2xmlin/leasetime-hours.xml b/tests/networkxml2xmlin/leasetime-hours.xml deleted file mode 120000 index 5a6bed3d5f..0000000000 --- a/tests/networkxml2xmlin/leasetime-hours.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2confdata/leasetime-hours.xml \ No newline at end of file diff --git a/tests/networkxml2xmlin/leasetime-infinite.xml b/tests/networkxml2xmlin/leasetime-infinite.xml deleted file mode 120000 index 706e4cdf11..0000000000 --- a/tests/networkxml2xmlin/leasetime-infinite.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2confdata/leasetime-infinite.xml \ No newline at end of file diff --git a/tests/networkxml2xmlin/leasetime-minutes.xml b/tests/networkxml2xmlin/leasetime-minutes.xml deleted file mode 120000 index 2c19b06a8a..0000000000 --- a/tests/networkxml2xmlin/leasetime-minutes.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2confdata/leasetime-minutes.xml \ No newline at end of file diff --git a/tests/networkxml2xmlin/leasetime-seconds.xml b/tests/networkxml2xmlin/leasetime-seconds.xml deleted file mode 120000 index f182cfa2f1..0000000000 --- a/tests/networkxml2xmlin/leasetime-seconds.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2confdata/leasetime-seconds.xml \ No newline at end of file diff --git a/tests/networkxml2xmlin/nat-network-dns-forward-plain.xml b/tests/networkxml2xmlin/nat-network-dns-forward-plain.xml deleted file mode 100644 index 10bacb5cbb..0000000000 --- a/tests/networkxml2xmlin/nat-network-dns-forward-plain.xml +++ /dev/null @@ -1,9 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> - <forward dev='eth0' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0' /> - <dns forwardPlainNames='yes'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/nat-network-dns-forwarder-no-resolv.xml b/tests/networkxml2xmlin/nat-network-dns-forwarder-no-resolv.xml deleted file mode 100644 index 9661ce561e..0000000000 --- a/tests/networkxml2xmlin/nat-network-dns-forwarder-no-resolv.xml +++ /dev/null @@ -1,11 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> - <forward mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <dns> - <forwarder domain='example.com' addr='192.168.1.1'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/nat-network-dns-local-domain.xml b/tests/networkxml2xmlin/nat-network-dns-local-domain.xml deleted file mode 100644 index a92d71f1f2..0000000000 --- a/tests/networkxml2xmlin/nat-network-dns-local-domain.xml +++ /dev/null @@ -1,9 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid> - <forward dev='eth0' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0' /> - <domain name='example.com' localOnly='yes'/> - <ip address='192.168.122.1' netmask='255.255.255.0'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml b/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml deleted file mode 100644 index 83838d01d3..0000000000 --- a/tests/networkxml2xmlin/nat-network-dns-srv-record-minimal.xml +++ /dev/null @@ -1,26 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'> - <interface dev='eth1'/> - </forward> - <bridge name='virbr0' stp='on' delay='0'/> - <dns> - <srv service='name' protocol='tcp'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='fc00:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/nat-network-dns-srv-record.xml b/tests/networkxml2xmlin/nat-network-dns-srv-record.xml deleted file mode 100644 index 0369f4caa9..0000000000 --- a/tests/networkxml2xmlin/nat-network-dns-srv-record.xml +++ /dev/null @@ -1,32 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'> - <interface dev='eth1'/> - </forward> - <bridge name='virbr0' stp='on' delay='0'/> - <dns> - <srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/> - <srv service='name2' protocol='udp' target='test2.example.com' port='2222' priority='22' weight='222'/> - <srv service='name3' protocol='tcp' domain='test3.com' target='test3.example.com' port='3333' priority='33'/> - <srv service='name4' protocol='tcp' domain='test4.com' target='test4.example.com' port='4444'/> - <srv service='name5' protocol='udp' target='test5.example.com' priority='55' weight='555'/> - <srv service='name6' protocol='tcp' domain='test6.com' target='test6.example.com' port='6666' weight='666'/> - <srv service='name7' protocol='tcp' domain='test7.com' target='test7.example.com' weight='777'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/nat-network-dns-txt-record.xml b/tests/networkxml2xmlin/nat-network-dns-txt-record.xml deleted file mode 100644 index 0a6bd595ae..0000000000 --- a/tests/networkxml2xmlin/nat-network-dns-txt-record.xml +++ /dev/null @@ -1,24 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <dns> - <txt name='example' value='example value'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/nat-network-name-with-quotes.xml b/tests/networkxml2xmlin/nat-network-name-with-quotes.xml deleted file mode 100644 index eba75d2e2d..0000000000 --- a/tests/networkxml2xmlin/nat-network-name-with-quotes.xml +++ /dev/null @@ -1,26 +0,0 @@ -<network> - <name>default"with"quotes"</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'> - <interface dev='eth1'/> - </forward> - <bridge name='virbr0' stp='on' delay='0'/> - <dns> - <srv service='name' protocol='tcp'/> - </dns> - <ip address='192.168.122.1' netmask='255.255.255.0'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0'> - </ip> - <ip family='ipv6' address='fc00:db8:ac10:fe01::1' prefix='64'> - </ip> - <ip family='ipv6' address='fc00:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2xmlin/netboot-tftp.xml b/tests/networkxml2xmlin/netboot-tftp.xml deleted file mode 120000 index 1487de558b..0000000000 --- a/tests/networkxml2xmlin/netboot-tftp.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2confdata/netboot-tftp.xml \ No newline at end of file diff --git a/tests/networkxml2xmlin/ptr-domains-auto.xml b/tests/networkxml2xmlin/ptr-domains-auto.xml deleted file mode 100644 index 7fe12dc671..0000000000 --- a/tests/networkxml2xmlin/ptr-domains-auto.xml +++ /dev/null @@ -1,21 +0,0 @@ -<network> - <name>default</name> - <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid> - <forward dev='eth1' mode='nat'/> - <bridge name='virbr0' stp='on' delay='0'/> - <ip address='192.168.122.1' netmask='255.255.255.0' localPtr='yes'> - <dhcp> - <range start='192.168.122.2' end='192.168.122.254'/> - <host mac='00:16:3e:77:e2:ed' name='a.example.com' ip='192.168.122.10'/> - <host mac='00:16:3e:3e:a9:1a' name='b.example.com' ip='192.168.122.11'/> - </dhcp> - </ip> - <ip family='ipv4' address='192.168.123.1' netmask='255.255.255.0' localPtr='no'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fe01::1' prefix='64' localPtr='yes'> - </ip> - <ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'> - </ip> - <ip family='ipv4' address='10.24.10.1'> - </ip> -</network> diff --git a/tests/networkxml2xmlout/leasetime-hours.xml b/tests/networkxml2xmlout/leasetime-hours.xml deleted file mode 120000 index d3cf0fb342..0000000000 --- a/tests/networkxml2xmlout/leasetime-hours.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2xmlin/leasetime-hours.xml \ No newline at end of file diff --git a/tests/networkxml2xmlout/leasetime-infinite.xml b/tests/networkxml2xmlout/leasetime-infinite.xml deleted file mode 120000 index 2390f7a3a7..0000000000 --- a/tests/networkxml2xmlout/leasetime-infinite.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2xmlin/leasetime-infinite.xml \ No newline at end of file diff --git a/tests/networkxml2xmlout/leasetime-minutes.xml b/tests/networkxml2xmlout/leasetime-minutes.xml deleted file mode 120000 index 09ebdb9c14..0000000000 --- a/tests/networkxml2xmlout/leasetime-minutes.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2xmlin/leasetime-minutes.xml \ No newline at end of file diff --git a/tests/networkxml2xmlout/leasetime-seconds.xml b/tests/networkxml2xmlout/leasetime-seconds.xml deleted file mode 120000 index 7036ca6713..0000000000 --- a/tests/networkxml2xmlout/leasetime-seconds.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2xmlin/leasetime-seconds.xml \ No newline at end of file diff --git a/tests/networkxml2xmlout/netboot-tftp.xml b/tests/networkxml2xmlout/netboot-tftp.xml deleted file mode 120000 index 1487de558b..0000000000 --- a/tests/networkxml2xmlout/netboot-tftp.xml +++ /dev/null @@ -1 +0,0 @@ -../networkxml2confdata/netboot-tftp.xml \ No newline at end of file diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatetest.c index 60931a2eba..b017922d94 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -76,7 +76,7 @@ testCompareXMLToXMLHelper(const void *data) g_autofree char *updatexml = NULL; g_autofree char *outxml = NULL; - netxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", + netxml = g_strdup_printf("%s/networkxmlconfdata/%s.xml", abs_srcdir, info->netxml); updatexml = g_strdup_printf("%s/networkxml2xmlupdatein/%s.xml", abs_srcdir, info->updatexml); diff --git a/tests/networkxml2xmlout/8021Qbh-net.xml b/tests/networkxmlconfdata/8021Qbh-net.expect.xml similarity index 100% rename from tests/networkxml2xmlout/8021Qbh-net.xml rename to tests/networkxmlconfdata/8021Qbh-net.expect.xml diff --git a/tests/networkxml2xmlin/8021Qbh-net.xml b/tests/networkxmlconfdata/8021Qbh-net.xml similarity index 100% rename from tests/networkxml2xmlin/8021Qbh-net.xml rename to tests/networkxmlconfdata/8021Qbh-net.xml diff --git a/tests/networkxml2confdata/bandwidth-network.conf b/tests/networkxmlconfdata/bandwidth-network.conf similarity index 100% rename from tests/networkxml2confdata/bandwidth-network.conf rename to tests/networkxmlconfdata/bandwidth-network.conf diff --git a/tests/networkxml2xmlout/bandwidth-network.xml b/tests/networkxmlconfdata/bandwidth-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/bandwidth-network.xml rename to tests/networkxmlconfdata/bandwidth-network.expect.xml diff --git a/tests/networkxml2xmlin/bandwidth-network.xml b/tests/networkxmlconfdata/bandwidth-network.xml similarity index 100% rename from tests/networkxml2xmlin/bandwidth-network.xml rename to tests/networkxmlconfdata/bandwidth-network.xml diff --git a/tests/networkxml2confdata/dhcp6-nat-network.conf b/tests/networkxmlconfdata/dhcp6-nat-network.conf similarity index 100% rename from tests/networkxml2confdata/dhcp6-nat-network.conf rename to tests/networkxmlconfdata/dhcp6-nat-network.conf diff --git a/tests/networkxml2xmlout/dhcp6-nat-network.xml b/tests/networkxmlconfdata/dhcp6-nat-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/dhcp6-nat-network.xml rename to tests/networkxmlconfdata/dhcp6-nat-network.expect.xml diff --git a/tests/networkxml2confdata/dhcp6-nat-network.hostsfile b/tests/networkxmlconfdata/dhcp6-nat-network.hostsfile similarity index 100% rename from tests/networkxml2confdata/dhcp6-nat-network.hostsfile rename to tests/networkxmlconfdata/dhcp6-nat-network.hostsfile diff --git a/tests/networkxml2confdata/dhcp6-nat-network.xml b/tests/networkxmlconfdata/dhcp6-nat-network.xml similarity index 100% rename from tests/networkxml2confdata/dhcp6-nat-network.xml rename to tests/networkxmlconfdata/dhcp6-nat-network.xml diff --git a/tests/networkxml2confdata/dhcp6-network.conf b/tests/networkxmlconfdata/dhcp6-network.conf similarity index 100% rename from tests/networkxml2confdata/dhcp6-network.conf rename to tests/networkxmlconfdata/dhcp6-network.conf diff --git a/tests/networkxml2xmlout/dhcp6-network.xml b/tests/networkxmlconfdata/dhcp6-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/dhcp6-network.xml rename to tests/networkxmlconfdata/dhcp6-network.expect.xml diff --git a/tests/networkxml2confdata/dhcp6-network.hostsfile b/tests/networkxmlconfdata/dhcp6-network.hostsfile similarity index 100% rename from tests/networkxml2confdata/dhcp6-network.hostsfile rename to tests/networkxmlconfdata/dhcp6-network.hostsfile diff --git a/tests/networkxml2confdata/dhcp6-network.xml b/tests/networkxmlconfdata/dhcp6-network.xml similarity index 100% rename from tests/networkxml2confdata/dhcp6-network.xml rename to tests/networkxmlconfdata/dhcp6-network.xml diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.conf b/tests/networkxmlconfdata/dhcp6host-routed-network.conf similarity index 100% rename from tests/networkxml2confdata/dhcp6host-routed-network.conf rename to tests/networkxmlconfdata/dhcp6host-routed-network.conf diff --git a/tests/networkxml2xmlout/dhcp6host-routed-network.xml b/tests/networkxmlconfdata/dhcp6host-routed-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/dhcp6host-routed-network.xml rename to tests/networkxmlconfdata/dhcp6host-routed-network.expect.xml diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.hostsfile b/tests/networkxmlconfdata/dhcp6host-routed-network.hostsfile similarity index 100% rename from tests/networkxml2confdata/dhcp6host-routed-network.hostsfile rename to tests/networkxmlconfdata/dhcp6host-routed-network.hostsfile diff --git a/tests/networkxml2xmlin/dhcp6host-routed-network.xml b/tests/networkxmlconfdata/dhcp6host-routed-network.xml similarity index 100% rename from tests/networkxml2xmlin/dhcp6host-routed-network.xml rename to tests/networkxmlconfdata/dhcp6host-routed-network.xml diff --git a/tests/networkxml2xmlout/direct-net.xml b/tests/networkxmlconfdata/direct-net.expect.xml similarity index 100% rename from tests/networkxml2xmlout/direct-net.xml rename to tests/networkxmlconfdata/direct-net.expect.xml diff --git a/tests/networkxml2xmlin/direct-net.xml b/tests/networkxmlconfdata/direct-net.xml similarity index 100% rename from tests/networkxml2xmlin/direct-net.xml rename to tests/networkxmlconfdata/direct-net.xml diff --git a/tests/networkxml2confdata/dnsmasq-options.conf b/tests/networkxmlconfdata/dnsmasq-options.conf similarity index 100% rename from tests/networkxml2confdata/dnsmasq-options.conf rename to tests/networkxmlconfdata/dnsmasq-options.conf diff --git a/tests/networkxml2xmlout/dnsmasq-options.xml b/tests/networkxmlconfdata/dnsmasq-options.expect.xml similarity index 100% rename from tests/networkxml2xmlout/dnsmasq-options.xml rename to tests/networkxmlconfdata/dnsmasq-options.expect.xml diff --git a/tests/networkxml2confdata/dnsmasq-options.xml b/tests/networkxmlconfdata/dnsmasq-options.xml similarity index 100% rename from tests/networkxml2confdata/dnsmasq-options.xml rename to tests/networkxmlconfdata/dnsmasq-options.xml diff --git a/tests/networkxml2xmlout/empty-allow-ipv6.xml b/tests/networkxmlconfdata/empty-allow-ipv6.expect.xml similarity index 100% rename from tests/networkxml2xmlout/empty-allow-ipv6.xml rename to tests/networkxmlconfdata/empty-allow-ipv6.expect.xml diff --git a/tests/networkxml2xmlin/empty-allow-ipv6.xml b/tests/networkxmlconfdata/empty-allow-ipv6.xml similarity index 100% rename from tests/networkxml2xmlin/empty-allow-ipv6.xml rename to tests/networkxmlconfdata/empty-allow-ipv6.xml diff --git a/tests/networkxml2xmlout/host-bridge-net.xml b/tests/networkxmlconfdata/host-bridge-net.expect.xml similarity index 100% rename from tests/networkxml2xmlout/host-bridge-net.xml rename to tests/networkxmlconfdata/host-bridge-net.expect.xml diff --git a/tests/networkxml2xmlin/host-bridge-net.xml b/tests/networkxmlconfdata/host-bridge-net.xml similarity index 100% rename from tests/networkxml2xmlin/host-bridge-net.xml rename to tests/networkxmlconfdata/host-bridge-net.xml diff --git a/tests/networkxml2xmlout/host-bridge-no-flood.xml b/tests/networkxmlconfdata/host-bridge-no-flood.expect.xml similarity index 100% rename from tests/networkxml2xmlout/host-bridge-no-flood.xml rename to tests/networkxmlconfdata/host-bridge-no-flood.expect.xml diff --git a/tests/networkxml2xmlin/host-bridge-no-flood.xml b/tests/networkxmlconfdata/host-bridge-no-flood.xml similarity index 100% rename from tests/networkxml2xmlin/host-bridge-no-flood.xml rename to tests/networkxmlconfdata/host-bridge-no-flood.xml diff --git a/tests/networkxml2xmlin/hostdev-duplicate.xml b/tests/networkxmlconfdata/hostdev-duplicate.xml similarity index 100% rename from tests/networkxml2xmlin/hostdev-duplicate.xml rename to tests/networkxmlconfdata/hostdev-duplicate.xml diff --git a/tests/networkxml2xmlin/hostdev-pf-driver-model.xml b/tests/networkxmlconfdata/hostdev-pf-driver-model.expect.xml similarity index 100% rename from tests/networkxml2xmlin/hostdev-pf-driver-model.xml rename to tests/networkxmlconfdata/hostdev-pf-driver-model.expect.xml diff --git a/tests/networkxml2xmlout/hostdev-pf-driver-model.xml b/tests/networkxmlconfdata/hostdev-pf-driver-model.xml similarity index 100% rename from tests/networkxml2xmlout/hostdev-pf-driver-model.xml rename to tests/networkxmlconfdata/hostdev-pf-driver-model.xml diff --git a/tests/networkxml2xmlin/hostdev-pf.xml b/tests/networkxmlconfdata/hostdev-pf.expect.xml similarity index 100% rename from tests/networkxml2xmlin/hostdev-pf.xml rename to tests/networkxmlconfdata/hostdev-pf.expect.xml diff --git a/tests/networkxml2xmlout/hostdev-pf.xml b/tests/networkxmlconfdata/hostdev-pf.xml similarity index 100% rename from tests/networkxml2xmlout/hostdev-pf.xml rename to tests/networkxmlconfdata/hostdev-pf.xml diff --git a/tests/networkxml2xmlin/hostdev.xml b/tests/networkxmlconfdata/hostdev.expect.xml similarity index 100% rename from tests/networkxml2xmlin/hostdev.xml rename to tests/networkxmlconfdata/hostdev.expect.xml diff --git a/tests/networkxml2xmlout/hostdev.xml b/tests/networkxmlconfdata/hostdev.xml similarity index 100% rename from tests/networkxml2xmlout/hostdev.xml rename to tests/networkxmlconfdata/hostdev.xml diff --git a/tests/networkxml2confdata/isolated-network.conf b/tests/networkxmlconfdata/isolated-network.conf similarity index 100% rename from tests/networkxml2confdata/isolated-network.conf rename to tests/networkxmlconfdata/isolated-network.conf diff --git a/tests/networkxml2xmlout/isolated-network.xml b/tests/networkxmlconfdata/isolated-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/isolated-network.xml rename to tests/networkxmlconfdata/isolated-network.expect.xml diff --git a/tests/networkxml2xmlin/isolated-network.xml b/tests/networkxmlconfdata/isolated-network.xml similarity index 100% rename from tests/networkxml2xmlin/isolated-network.xml rename to tests/networkxmlconfdata/isolated-network.xml diff --git a/tests/networkxml2xmlout/isolated-ports.xml b/tests/networkxmlconfdata/isolated-ports.expect.xml similarity index 100% rename from tests/networkxml2xmlout/isolated-ports.xml rename to tests/networkxmlconfdata/isolated-ports.expect.xml diff --git a/tests/networkxml2xmlin/isolated-ports.xml b/tests/networkxmlconfdata/isolated-ports.xml similarity index 100% rename from tests/networkxml2xmlin/isolated-ports.xml rename to tests/networkxmlconfdata/isolated-ports.xml diff --git a/tests/networkxml2confdata/leasetime-hours.conf b/tests/networkxmlconfdata/leasetime-hours.conf similarity index 100% rename from tests/networkxml2confdata/leasetime-hours.conf rename to tests/networkxmlconfdata/leasetime-hours.conf diff --git a/tests/networkxmlconfdata/leasetime-hours.expect.xml b/tests/networkxmlconfdata/leasetime-hours.expect.xml new file mode 120000 index 0000000000..9ba0abf62b --- /dev/null +++ b/tests/networkxmlconfdata/leasetime-hours.expect.xml @@ -0,0 +1 @@ +leasetime-hours.xml \ No newline at end of file diff --git a/tests/networkxml2confdata/leasetime-hours.hostsfile b/tests/networkxmlconfdata/leasetime-hours.hostsfile similarity index 100% rename from tests/networkxml2confdata/leasetime-hours.hostsfile rename to tests/networkxmlconfdata/leasetime-hours.hostsfile diff --git a/tests/networkxml2confdata/leasetime-hours.xml b/tests/networkxmlconfdata/leasetime-hours.xml similarity index 100% rename from tests/networkxml2confdata/leasetime-hours.xml rename to tests/networkxmlconfdata/leasetime-hours.xml diff --git a/tests/networkxml2confdata/leasetime-infinite.conf b/tests/networkxmlconfdata/leasetime-infinite.conf similarity index 100% rename from tests/networkxml2confdata/leasetime-infinite.conf rename to tests/networkxmlconfdata/leasetime-infinite.conf diff --git a/tests/networkxmlconfdata/leasetime-infinite.expect.xml b/tests/networkxmlconfdata/leasetime-infinite.expect.xml new file mode 120000 index 0000000000..8862319079 --- /dev/null +++ b/tests/networkxmlconfdata/leasetime-infinite.expect.xml @@ -0,0 +1 @@ +leasetime-infinite.xml \ No newline at end of file diff --git a/tests/networkxml2confdata/leasetime-infinite.hostsfile b/tests/networkxmlconfdata/leasetime-infinite.hostsfile similarity index 100% rename from tests/networkxml2confdata/leasetime-infinite.hostsfile rename to tests/networkxmlconfdata/leasetime-infinite.hostsfile diff --git a/tests/networkxml2confdata/leasetime-infinite.xml b/tests/networkxmlconfdata/leasetime-infinite.xml similarity index 100% rename from tests/networkxml2confdata/leasetime-infinite.xml rename to tests/networkxmlconfdata/leasetime-infinite.xml diff --git a/tests/networkxml2confdata/leasetime-minutes.conf b/tests/networkxmlconfdata/leasetime-minutes.conf similarity index 100% rename from tests/networkxml2confdata/leasetime-minutes.conf rename to tests/networkxmlconfdata/leasetime-minutes.conf diff --git a/tests/networkxmlconfdata/leasetime-minutes.expect.xml b/tests/networkxmlconfdata/leasetime-minutes.expect.xml new file mode 120000 index 0000000000..ef86e9cf90 --- /dev/null +++ b/tests/networkxmlconfdata/leasetime-minutes.expect.xml @@ -0,0 +1 @@ +leasetime-minutes.xml \ No newline at end of file diff --git a/tests/networkxml2confdata/leasetime-minutes.hostsfile b/tests/networkxmlconfdata/leasetime-minutes.hostsfile similarity index 100% rename from tests/networkxml2confdata/leasetime-minutes.hostsfile rename to tests/networkxmlconfdata/leasetime-minutes.hostsfile diff --git a/tests/networkxml2confdata/leasetime-minutes.xml b/tests/networkxmlconfdata/leasetime-minutes.xml similarity index 100% rename from tests/networkxml2confdata/leasetime-minutes.xml rename to tests/networkxmlconfdata/leasetime-minutes.xml diff --git a/tests/networkxml2confdata/leasetime-seconds.conf b/tests/networkxmlconfdata/leasetime-seconds.conf similarity index 100% rename from tests/networkxml2confdata/leasetime-seconds.conf rename to tests/networkxmlconfdata/leasetime-seconds.conf diff --git a/tests/networkxmlconfdata/leasetime-seconds.expect.xml b/tests/networkxmlconfdata/leasetime-seconds.expect.xml new file mode 120000 index 0000000000..e7944dc429 --- /dev/null +++ b/tests/networkxmlconfdata/leasetime-seconds.expect.xml @@ -0,0 +1 @@ +leasetime-seconds.xml \ No newline at end of file diff --git a/tests/networkxml2confdata/leasetime-seconds.hostsfile b/tests/networkxmlconfdata/leasetime-seconds.hostsfile similarity index 100% rename from tests/networkxml2confdata/leasetime-seconds.hostsfile rename to tests/networkxmlconfdata/leasetime-seconds.hostsfile diff --git a/tests/networkxml2confdata/leasetime-seconds.xml b/tests/networkxmlconfdata/leasetime-seconds.xml similarity index 100% rename from tests/networkxml2confdata/leasetime-seconds.xml rename to tests/networkxmlconfdata/leasetime-seconds.xml diff --git a/tests/networkxml2xmlout/metadata.xml b/tests/networkxmlconfdata/metadata.expect.xml similarity index 100% rename from tests/networkxml2xmlout/metadata.xml rename to tests/networkxmlconfdata/metadata.expect.xml diff --git a/tests/networkxml2xmlin/metadata.xml b/tests/networkxmlconfdata/metadata.xml similarity index 100% rename from tests/networkxml2xmlin/metadata.xml rename to tests/networkxmlconfdata/metadata.xml diff --git a/tests/networkxml2confdata/nat-network-dns-forward-plain.conf b/tests/networkxmlconfdata/nat-network-dns-forward-plain.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-forward-plain.conf rename to tests/networkxmlconfdata/nat-network-dns-forward-plain.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-forward-plain.xml b/tests/networkxmlconfdata/nat-network-dns-forward-plain.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-forward-plain.xml rename to tests/networkxmlconfdata/nat-network-dns-forward-plain.expect.xml diff --git a/tests/networkxml2confdata/nat-network-dns-forward-plain.xml b/tests/networkxmlconfdata/nat-network-dns-forward-plain.xml similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-forward-plain.xml rename to tests/networkxmlconfdata/nat-network-dns-forward-plain.xml diff --git a/tests/networkxml2confdata/nat-network-dns-forwarder-no-resolv.conf b/tests/networkxmlconfdata/nat-network-dns-forwarder-no-resolv.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-forwarder-no-resolv.conf rename to tests/networkxmlconfdata/nat-network-dns-forwarder-no-resolv.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml b/tests/networkxmlconfdata/nat-network-dns-forwarder-no-resolv.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-forwarder-no-resolv.xml rename to tests/networkxmlconfdata/nat-network-dns-forwarder-no-resolv.expect.xml diff --git a/tests/networkxml2confdata/nat-network-dns-forwarder-no-resolv.xml b/tests/networkxmlconfdata/nat-network-dns-forwarder-no-resolv.xml similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-forwarder-no-resolv.xml rename to tests/networkxmlconfdata/nat-network-dns-forwarder-no-resolv.xml diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.conf b/tests/networkxmlconfdata/nat-network-dns-forwarders.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-forwarders.conf rename to tests/networkxmlconfdata/nat-network-dns-forwarders.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-forwarders.xml b/tests/networkxmlconfdata/nat-network-dns-forwarders.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-forwarders.xml rename to tests/networkxmlconfdata/nat-network-dns-forwarders.expect.xml diff --git a/tests/networkxml2xmlin/nat-network-dns-forwarders.xml b/tests/networkxmlconfdata/nat-network-dns-forwarders.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-dns-forwarders.xml rename to tests/networkxmlconfdata/nat-network-dns-forwarders.xml diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.conf b/tests/networkxmlconfdata/nat-network-dns-hosts.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-hosts.conf rename to tests/networkxmlconfdata/nat-network-dns-hosts.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-hosts.xml b/tests/networkxmlconfdata/nat-network-dns-hosts.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-hosts.xml rename to tests/networkxmlconfdata/nat-network-dns-hosts.expect.xml diff --git a/tests/networkxml2xmlin/nat-network-dns-hosts.xml b/tests/networkxmlconfdata/nat-network-dns-hosts.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-dns-hosts.xml rename to tests/networkxmlconfdata/nat-network-dns-hosts.xml diff --git a/tests/networkxml2confdata/nat-network-dns-local-domain.conf b/tests/networkxmlconfdata/nat-network-dns-local-domain.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-local-domain.conf rename to tests/networkxmlconfdata/nat-network-dns-local-domain.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-local-domain.xml b/tests/networkxmlconfdata/nat-network-dns-local-domain.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-local-domain.xml rename to tests/networkxmlconfdata/nat-network-dns-local-domain.expect.xml diff --git a/tests/networkxml2confdata/nat-network-dns-local-domain.xml b/tests/networkxmlconfdata/nat-network-dns-local-domain.xml similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-local-domain.xml rename to tests/networkxmlconfdata/nat-network-dns-local-domain.xml diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf b/tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf rename to tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml b/tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-srv-record-minimal.xml rename to tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.expect.xml diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.hostsfile b/tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-record-minimal.hostsfile rename to tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.hostsfile diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml b/tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.xml similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-record-minimal.xml rename to tests/networkxmlconfdata/nat-network-dns-srv-record-minimal.xml diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.conf b/tests/networkxmlconfdata/nat-network-dns-srv-record.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-record.conf rename to tests/networkxmlconfdata/nat-network-dns-srv-record.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-record.xml b/tests/networkxmlconfdata/nat-network-dns-srv-record.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-srv-record.xml rename to tests/networkxmlconfdata/nat-network-dns-srv-record.expect.xml diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.hostsfile b/tests/networkxmlconfdata/nat-network-dns-srv-record.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-record.hostsfile rename to tests/networkxmlconfdata/nat-network-dns-srv-record.hostsfile diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.xml b/tests/networkxmlconfdata/nat-network-dns-srv-record.xml similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-record.xml rename to tests/networkxmlconfdata/nat-network-dns-srv-record.xml diff --git a/tests/networkxml2confdata/nat-network-dns-srv-records.conf b/tests/networkxmlconfdata/nat-network-dns-srv-records.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-records.conf rename to tests/networkxmlconfdata/nat-network-dns-srv-records.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-srv-records.xml b/tests/networkxmlconfdata/nat-network-dns-srv-records.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-srv-records.xml rename to tests/networkxmlconfdata/nat-network-dns-srv-records.expect.xml diff --git a/tests/networkxml2confdata/nat-network-dns-srv-records.hostsfile b/tests/networkxmlconfdata/nat-network-dns-srv-records.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-srv-records.hostsfile rename to tests/networkxmlconfdata/nat-network-dns-srv-records.hostsfile diff --git a/tests/networkxml2xmlin/nat-network-dns-srv-records.xml b/tests/networkxmlconfdata/nat-network-dns-srv-records.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-dns-srv-records.xml rename to tests/networkxmlconfdata/nat-network-dns-srv-records.xml diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.conf b/tests/networkxmlconfdata/nat-network-dns-txt-record.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-txt-record.conf rename to tests/networkxmlconfdata/nat-network-dns-txt-record.conf diff --git a/tests/networkxml2xmlout/nat-network-dns-txt-record.xml b/tests/networkxmlconfdata/nat-network-dns-txt-record.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-dns-txt-record.xml rename to tests/networkxmlconfdata/nat-network-dns-txt-record.expect.xml diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.hostsfile b/tests/networkxmlconfdata/nat-network-dns-txt-record.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-txt-record.hostsfile rename to tests/networkxmlconfdata/nat-network-dns-txt-record.hostsfile diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.xml b/tests/networkxmlconfdata/nat-network-dns-txt-record.xml similarity index 100% rename from tests/networkxml2confdata/nat-network-dns-txt-record.xml rename to tests/networkxmlconfdata/nat-network-dns-txt-record.xml diff --git a/tests/networkxml2confdata/nat-network-explicit-flood.conf b/tests/networkxmlconfdata/nat-network-explicit-flood.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-explicit-flood.conf rename to tests/networkxmlconfdata/nat-network-explicit-flood.conf diff --git a/tests/networkxml2xmlout/nat-network-explicit-flood.xml b/tests/networkxmlconfdata/nat-network-explicit-flood.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-explicit-flood.xml rename to tests/networkxmlconfdata/nat-network-explicit-flood.expect.xml diff --git a/tests/networkxml2confdata/nat-network-explicit-flood.hostsfile b/tests/networkxmlconfdata/nat-network-explicit-flood.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-explicit-flood.hostsfile rename to tests/networkxmlconfdata/nat-network-explicit-flood.hostsfile diff --git a/tests/networkxml2xmlin/nat-network-explicit-flood.xml b/tests/networkxmlconfdata/nat-network-explicit-flood.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-explicit-flood.xml rename to tests/networkxmlconfdata/nat-network-explicit-flood.xml diff --git a/tests/networkxml2confdata/nat-network-forward-nat-address.conf b/tests/networkxmlconfdata/nat-network-forward-nat-address.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-forward-nat-address.conf rename to tests/networkxmlconfdata/nat-network-forward-nat-address.conf diff --git a/tests/networkxml2xmlout/nat-network-forward-nat-address.xml b/tests/networkxmlconfdata/nat-network-forward-nat-address.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-forward-nat-address.xml rename to tests/networkxmlconfdata/nat-network-forward-nat-address.expect.xml diff --git a/tests/networkxml2confdata/nat-network-forward-nat-address.hostsfile b/tests/networkxmlconfdata/nat-network-forward-nat-address.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-forward-nat-address.hostsfile rename to tests/networkxmlconfdata/nat-network-forward-nat-address.hostsfile diff --git a/tests/networkxml2xmlin/nat-network-forward-nat-address.xml b/tests/networkxmlconfdata/nat-network-forward-nat-address.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-forward-nat-address.xml rename to tests/networkxmlconfdata/nat-network-forward-nat-address.xml diff --git a/tests/networkxml2confdata/nat-network-forward-nat-ipv6.conf b/tests/networkxmlconfdata/nat-network-forward-nat-ipv6.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-forward-nat-ipv6.conf rename to tests/networkxmlconfdata/nat-network-forward-nat-ipv6.conf diff --git a/tests/networkxml2xmlout/nat-network-forward-nat-ipv6.xml b/tests/networkxmlconfdata/nat-network-forward-nat-ipv6.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-forward-nat-ipv6.xml rename to tests/networkxmlconfdata/nat-network-forward-nat-ipv6.expect.xml diff --git a/tests/networkxml2xmlin/nat-network-forward-nat-ipv6.xml b/tests/networkxmlconfdata/nat-network-forward-nat-ipv6.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-forward-nat-ipv6.xml rename to tests/networkxmlconfdata/nat-network-forward-nat-ipv6.xml diff --git a/tests/networkxml2confdata/nat-network-forward-nat-no-address.conf b/tests/networkxmlconfdata/nat-network-forward-nat-no-address.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-forward-nat-no-address.conf rename to tests/networkxmlconfdata/nat-network-forward-nat-no-address.conf diff --git a/tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml b/tests/networkxmlconfdata/nat-network-forward-nat-no-address.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-forward-nat-no-address.xml rename to tests/networkxmlconfdata/nat-network-forward-nat-no-address.expect.xml diff --git a/tests/networkxml2confdata/nat-network-forward-nat-no-address.hostsfile b/tests/networkxmlconfdata/nat-network-forward-nat-no-address.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-forward-nat-no-address.hostsfile rename to tests/networkxmlconfdata/nat-network-forward-nat-no-address.hostsfile diff --git a/tests/networkxml2xmlin/nat-network-forward-nat-no-address.xml b/tests/networkxmlconfdata/nat-network-forward-nat-no-address.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-forward-nat-no-address.xml rename to tests/networkxmlconfdata/nat-network-forward-nat-no-address.xml diff --git a/tests/networkxml2confdata/nat-network-mtu.conf b/tests/networkxmlconfdata/nat-network-mtu.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-mtu.conf rename to tests/networkxmlconfdata/nat-network-mtu.conf diff --git a/tests/networkxml2xmlout/nat-network-mtu.xml b/tests/networkxmlconfdata/nat-network-mtu.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-mtu.xml rename to tests/networkxmlconfdata/nat-network-mtu.expect.xml diff --git a/tests/networkxml2confdata/nat-network-mtu.hostsfile b/tests/networkxmlconfdata/nat-network-mtu.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-mtu.hostsfile rename to tests/networkxmlconfdata/nat-network-mtu.hostsfile diff --git a/tests/networkxml2xmlin/nat-network-mtu.xml b/tests/networkxmlconfdata/nat-network-mtu.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network-mtu.xml rename to tests/networkxmlconfdata/nat-network-mtu.xml diff --git a/tests/networkxml2confdata/nat-network-name-with-quotes.conf b/tests/networkxmlconfdata/nat-network-name-with-quotes.conf similarity index 100% rename from tests/networkxml2confdata/nat-network-name-with-quotes.conf rename to tests/networkxmlconfdata/nat-network-name-with-quotes.conf diff --git a/tests/networkxml2xmlout/nat-network-name-with-quotes.xml b/tests/networkxmlconfdata/nat-network-name-with-quotes.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network-name-with-quotes.xml rename to tests/networkxmlconfdata/nat-network-name-with-quotes.expect.xml diff --git a/tests/networkxml2confdata/nat-network-name-with-quotes.hostsfile b/tests/networkxmlconfdata/nat-network-name-with-quotes.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network-name-with-quotes.hostsfile rename to tests/networkxmlconfdata/nat-network-name-with-quotes.hostsfile diff --git a/tests/networkxml2confdata/nat-network-name-with-quotes.xml b/tests/networkxmlconfdata/nat-network-name-with-quotes.xml similarity index 100% rename from tests/networkxml2confdata/nat-network-name-with-quotes.xml rename to tests/networkxmlconfdata/nat-network-name-with-quotes.xml diff --git a/tests/networkxml2confdata/nat-network.conf b/tests/networkxmlconfdata/nat-network.conf similarity index 100% rename from tests/networkxml2confdata/nat-network.conf rename to tests/networkxmlconfdata/nat-network.conf diff --git a/tests/networkxml2xmlout/nat-network.xml b/tests/networkxmlconfdata/nat-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/nat-network.xml rename to tests/networkxmlconfdata/nat-network.expect.xml diff --git a/tests/networkxml2confdata/nat-network.hostsfile b/tests/networkxmlconfdata/nat-network.hostsfile similarity index 100% rename from tests/networkxml2confdata/nat-network.hostsfile rename to tests/networkxmlconfdata/nat-network.hostsfile diff --git a/tests/networkxml2xmlin/nat-network.xml b/tests/networkxmlconfdata/nat-network.xml similarity index 100% rename from tests/networkxml2xmlin/nat-network.xml rename to tests/networkxmlconfdata/nat-network.xml diff --git a/tests/networkxml2confdata/netboot-network.conf b/tests/networkxmlconfdata/netboot-network.conf similarity index 100% rename from tests/networkxml2confdata/netboot-network.conf rename to tests/networkxmlconfdata/netboot-network.conf diff --git a/tests/networkxml2xmlout/netboot-network.xml b/tests/networkxmlconfdata/netboot-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/netboot-network.xml rename to tests/networkxmlconfdata/netboot-network.expect.xml diff --git a/tests/networkxml2xmlin/netboot-network.xml b/tests/networkxmlconfdata/netboot-network.xml similarity index 100% rename from tests/networkxml2xmlin/netboot-network.xml rename to tests/networkxmlconfdata/netboot-network.xml diff --git a/tests/networkxml2confdata/netboot-proxy-network.conf b/tests/networkxmlconfdata/netboot-proxy-network.conf similarity index 100% rename from tests/networkxml2confdata/netboot-proxy-network.conf rename to tests/networkxmlconfdata/netboot-proxy-network.conf diff --git a/tests/networkxml2xmlout/netboot-proxy-network.xml b/tests/networkxmlconfdata/netboot-proxy-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/netboot-proxy-network.xml rename to tests/networkxmlconfdata/netboot-proxy-network.expect.xml diff --git a/tests/networkxml2xmlin/netboot-proxy-network.xml b/tests/networkxmlconfdata/netboot-proxy-network.xml similarity index 100% rename from tests/networkxml2xmlin/netboot-proxy-network.xml rename to tests/networkxmlconfdata/netboot-proxy-network.xml diff --git a/tests/networkxml2confdata/netboot-tftp.conf b/tests/networkxmlconfdata/netboot-tftp.conf similarity index 100% rename from tests/networkxml2confdata/netboot-tftp.conf rename to tests/networkxmlconfdata/netboot-tftp.conf diff --git a/tests/networkxmlconfdata/netboot-tftp.expect.xml b/tests/networkxmlconfdata/netboot-tftp.expect.xml new file mode 120000 index 0000000000..eb3b28de25 --- /dev/null +++ b/tests/networkxmlconfdata/netboot-tftp.expect.xml @@ -0,0 +1 @@ +netboot-tftp.xml \ No newline at end of file diff --git a/tests/networkxml2confdata/netboot-tftp.xml b/tests/networkxmlconfdata/netboot-tftp.xml similarity index 100% rename from tests/networkxml2confdata/netboot-tftp.xml rename to tests/networkxmlconfdata/netboot-tftp.xml diff --git a/tests/networkxml2xmlin/open-network-with-forward-dev.xml b/tests/networkxmlconfdata/open-network-with-forward-dev.xml similarity index 100% rename from tests/networkxml2xmlin/open-network-with-forward-dev.xml rename to tests/networkxmlconfdata/open-network-with-forward-dev.xml diff --git a/tests/networkxml2confdata/open-network.conf b/tests/networkxmlconfdata/open-network.conf similarity index 100% rename from tests/networkxml2confdata/open-network.conf rename to tests/networkxmlconfdata/open-network.conf diff --git a/tests/networkxml2xmlout/open-network.xml b/tests/networkxmlconfdata/open-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/open-network.xml rename to tests/networkxmlconfdata/open-network.expect.xml diff --git a/tests/networkxml2xmlin/open-network.xml b/tests/networkxmlconfdata/open-network.xml similarity index 100% rename from tests/networkxml2xmlin/open-network.xml rename to tests/networkxmlconfdata/open-network.xml diff --git a/tests/networkxml2xmlin/openvswitch-net.xml b/tests/networkxmlconfdata/openvswitch-net.expect.xml similarity index 100% rename from tests/networkxml2xmlin/openvswitch-net.xml rename to tests/networkxmlconfdata/openvswitch-net.expect.xml diff --git a/tests/networkxml2xmlout/openvswitch-net.xml b/tests/networkxmlconfdata/openvswitch-net.xml similarity index 100% rename from tests/networkxml2xmlout/openvswitch-net.xml rename to tests/networkxmlconfdata/openvswitch-net.xml diff --git a/tests/networkxml2xmlin/passthrough-address-crash.xml b/tests/networkxmlconfdata/passthrough-address-crash.xml similarity index 100% rename from tests/networkxml2xmlin/passthrough-address-crash.xml rename to tests/networkxmlconfdata/passthrough-address-crash.xml diff --git a/tests/networkxml2xmlin/passthrough-duplicate.xml b/tests/networkxmlconfdata/passthrough-duplicate.xml similarity index 100% rename from tests/networkxml2xmlin/passthrough-duplicate.xml rename to tests/networkxmlconfdata/passthrough-duplicate.xml diff --git a/tests/networkxml2confdata/passthrough-pf.conf b/tests/networkxmlconfdata/passthrough-pf.conf similarity index 100% rename from tests/networkxml2confdata/passthrough-pf.conf rename to tests/networkxmlconfdata/passthrough-pf.conf diff --git a/tests/networkxml2xmlin/passthrough-pf.xml b/tests/networkxmlconfdata/passthrough-pf.xml similarity index 100% rename from tests/networkxml2xmlin/passthrough-pf.xml rename to tests/networkxmlconfdata/passthrough-pf.xml diff --git a/tests/networkxml2confdata/ptr-domains-auto.conf b/tests/networkxmlconfdata/ptr-domains-auto.conf similarity index 100% rename from tests/networkxml2confdata/ptr-domains-auto.conf rename to tests/networkxmlconfdata/ptr-domains-auto.conf diff --git a/tests/networkxml2xmlout/ptr-domains-auto.xml b/tests/networkxmlconfdata/ptr-domains-auto.expect.xml similarity index 100% rename from tests/networkxml2xmlout/ptr-domains-auto.xml rename to tests/networkxmlconfdata/ptr-domains-auto.expect.xml diff --git a/tests/networkxml2confdata/ptr-domains-auto.hostsfile b/tests/networkxmlconfdata/ptr-domains-auto.hostsfile similarity index 100% rename from tests/networkxml2confdata/ptr-domains-auto.hostsfile rename to tests/networkxmlconfdata/ptr-domains-auto.hostsfile diff --git a/tests/networkxml2confdata/ptr-domains-auto.xml b/tests/networkxmlconfdata/ptr-domains-auto.xml similarity index 100% rename from tests/networkxml2confdata/ptr-domains-auto.xml rename to tests/networkxmlconfdata/ptr-domains-auto.xml diff --git a/tests/networkxml2xmlin/routed-network-no-dns-extra-elements.xml b/tests/networkxmlconfdata/routed-network-no-dns-extra-elements.xml similarity index 100% rename from tests/networkxml2xmlin/routed-network-no-dns-extra-elements.xml rename to tests/networkxmlconfdata/routed-network-no-dns-extra-elements.xml diff --git a/tests/networkxml2xmlout/routed-network-no-dns.xml b/tests/networkxmlconfdata/routed-network-no-dns.expect.xml similarity index 100% rename from tests/networkxml2xmlout/routed-network-no-dns.xml rename to tests/networkxmlconfdata/routed-network-no-dns.expect.xml diff --git a/tests/networkxml2xmlin/routed-network-no-dns.xml b/tests/networkxmlconfdata/routed-network-no-dns.xml similarity index 100% rename from tests/networkxml2xmlin/routed-network-no-dns.xml rename to tests/networkxmlconfdata/routed-network-no-dns.xml diff --git a/tests/networkxml2confdata/routed-network.conf b/tests/networkxmlconfdata/routed-network.conf similarity index 100% rename from tests/networkxml2confdata/routed-network.conf rename to tests/networkxmlconfdata/routed-network.conf diff --git a/tests/networkxml2xmlout/routed-network.xml b/tests/networkxmlconfdata/routed-network.expect.xml similarity index 100% rename from tests/networkxml2xmlout/routed-network.xml rename to tests/networkxmlconfdata/routed-network.expect.xml diff --git a/tests/networkxml2xmlin/routed-network.xml b/tests/networkxmlconfdata/routed-network.xml similarity index 100% rename from tests/networkxml2xmlin/routed-network.xml rename to tests/networkxmlconfdata/routed-network.xml diff --git a/tests/networkxml2confdata/set-mtu.conf b/tests/networkxmlconfdata/set-mtu.conf similarity index 100% rename from tests/networkxml2confdata/set-mtu.conf rename to tests/networkxmlconfdata/set-mtu.conf diff --git a/tests/networkxml2xmlout/set-mtu.xml b/tests/networkxmlconfdata/set-mtu.expect.xml similarity index 100% rename from tests/networkxml2xmlout/set-mtu.xml rename to tests/networkxmlconfdata/set-mtu.expect.xml diff --git a/tests/networkxml2xmlin/set-mtu.xml b/tests/networkxmlconfdata/set-mtu.xml similarity index 100% rename from tests/networkxml2xmlin/set-mtu.xml rename to tests/networkxmlconfdata/set-mtu.xml diff --git a/tests/networkxml2xmlout/vepa-net.xml b/tests/networkxmlconfdata/vepa-net.expect.xml similarity index 100% rename from tests/networkxml2xmlout/vepa-net.xml rename to tests/networkxmlconfdata/vepa-net.expect.xml diff --git a/tests/networkxml2xmlin/vepa-net.xml b/tests/networkxmlconfdata/vepa-net.xml similarity index 100% rename from tests/networkxml2xmlin/vepa-net.xml rename to tests/networkxmlconfdata/vepa-net.xml diff --git a/tests/networkxml2xmltest.c b/tests/networkxmlconftest.c similarity index 96% rename from tests/networkxml2xmltest.c rename to tests/networkxmlconftest.c index 1d897c1fe4..69a060c57d 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxmlconftest.c @@ -241,11 +241,10 @@ testRun(const char *name, info->expectResult = expectResult; info->xmlopt = xmlopt; info->caps = caps; - info->inxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", abs_srcdir, name); - info->outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, name); - /* Temporarily use conf files from networkxml2confdata/ */ - info->outconf = g_strdup_printf("%s/networkxml2confdata/%s.conf", abs_srcdir, name); - info->outhostsfile = g_strdup_printf("%s/networkxml2confdata/%s.hostsfile", abs_srcdir, name); + info->inxml = g_strdup_printf("%s/networkxmlconfdata/%s.xml", abs_srcdir, name); + info->outxml = g_strdup_printf("%s/networkxmlconfdata/%s.expect.xml", abs_srcdir, name); + info->outconf = g_strdup_printf("%s/networkxmlconfdata/%s.conf", abs_srcdir, name); + info->outhostsfile = g_strdup_printf("%s/networkxmlconfdata/%s.hostsfile", abs_srcdir, name); virTestRunLog(ret, name_xml2xml, testCompareXMLToXMLFiles, info); diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 6f1f816cba..486d3d47ec 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -263,7 +263,7 @@ static virNWFilterDriver fakeNWFilterDriver = { /* name of the fake network shall be constructed as: * NETWORKXMLNAME;NETWORKPORTXMLNAME * where: - * NETWORKXMLNAME resolves to abs_srcdir/networkxml2xmlin/NETWORKXMLNAME.xml + * NETWORKXMLNAME resolves to abs_srcdir/networkxmlconfdata/NETWORKXMLNAME.xml * NETWORKPORTXMLNAME resolves to abs_srcdir/virnetworkportxml2xmldata/NETWORKPORTXMLNAME.xml */ static virNetworkPtr @@ -286,7 +286,7 @@ fakeNetworkLookupByName(virConnectPtr conn, return NULL; } - path = g_strdup_printf(abs_srcdir "/networkxml2xmlin/%s.xml", netname); + path = g_strdup_printf(abs_srcdir "/networkxmlconfdata/%s.xml", netname); if (!virFileExists(path)) { virReportError(VIR_ERR_NO_NETWORK, "fake network '%s' not found", path); @@ -307,7 +307,7 @@ fakeNetworkGetXMLDesc(virNetworkPtr network, *(strchr(netname, ';')) = '\0'; - path = g_strdup_printf(abs_srcdir "/networkxml2xmlin/%s.xml", netname); + path = g_strdup_printf(abs_srcdir "/networkxmlconfdata/%s.xml", netname); if (virFileReadAll(path, 4 * 1024, &xml) < 0) return NULL; diff --git a/tests/virschematest.c b/tests/virschematest.c index 57a49c270c..4faac8d976 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -303,9 +303,7 @@ static const struct testSchemaEntry schemaInterface[] = { static const struct testSchemaEntry schemaNetwork[] = { { .dir = "src/network" }, - { .dir = "tests/networkxml2xmlin" }, - { .dir = "tests/networkxml2xmlout" }, - { .dir = "tests/networkxml2confdata" }, + { .dir = "tests/networkxmlconfdata" }, { .dir = "examples/xml/test/", .dirRegex = "testnet.*" }, { .dir = "tests/networkxml2xmlupdateout" }, -- 2.52.0
On a Wednesday in 2026, Michal Privoznik via Devel wrote:
This was inspired by seemingly unrelated patches I've sent a month ago:
https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/WVTYK...
I was adding one attribute to an element and had to change three different test XMLs. Anyway, this is also available here:
https://gitlab.com/MichalPrivoznik/libvirt/-/tree/network_tests?ref_type=hea...
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko -
Michal Privoznik