diff --git a/tests/integration/base.py b/tests/integration/base.py index 550e32010..c7df3023e 100644 --- a/tests/integration/base.py +++ b/tests/integration/base.py @@ -199,6 +199,7 @@ def setup_eth(self, ipv6_mode, start_dnsmasq=True): subprocess.check_call(['ip', 'link', 'set', self.dev_e2_ap, 'up']) if start_dnsmasq: self.start_dnsmasq(ipv6_mode, self.dev_e_ap) + self.start_dnsmasq(ipv6_mode, self.dev_e2_ap) # # Internal implementation details diff --git a/tests/integration/bonds.py b/tests/integration/bonds.py index 693b8256a..fe84f7e0b 100644 --- a/tests/integration/bonds.py +++ b/tests/integration/bonds.py @@ -354,6 +354,7 @@ def test_bond_mac(self): match: name: %(ec)s macaddress: %(ec_mac)s + %(e2c)s: {} bonds: mybond: interfaces: [ethbn] @@ -428,7 +429,6 @@ def test_bond_up_delay(self): def test_bond_arp_interval(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -458,7 +458,6 @@ def test_bond_arp_interval(self): def test_bond_arp_targets(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -488,7 +487,6 @@ def test_bond_arp_targets(self): def test_bond_arp_targets_many_lp1829264(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -520,7 +518,6 @@ def test_bond_arp_targets_many_lp1829264(self): def test_bond_arp_all_targets(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -552,7 +549,6 @@ def test_bond_arp_all_targets(self): def test_bond_arp_validate(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -651,7 +647,6 @@ def test_bond_up_delay(self): def test_bond_arp_interval(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -681,7 +676,6 @@ def test_bond_arp_interval(self): def test_bond_arp_targets(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -711,7 +705,6 @@ def test_bond_arp_targets(self): def test_bond_arp_all_targets(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: diff --git a/tests/integration/bridges.py b/tests/integration/bridges.py index 4c66b2838..f18ea7da6 100644 --- a/tests/integration/bridges.py +++ b/tests/integration/bridges.py @@ -32,7 +32,6 @@ class _CommonTests(): def test_eth_and_bridge(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: @@ -69,7 +68,6 @@ def test_eth_and_bridge(self): def test_bridge_path_cost(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -103,7 +101,6 @@ def test_bridge_path_cost(self): def test_bridge_ageing_time(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -136,7 +133,6 @@ def test_bridge_ageing_time(self): def test_bridge_max_age(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -169,7 +165,6 @@ def test_bridge_max_age(self): def test_bridge_hello_time(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -202,7 +197,6 @@ def test_bridge_hello_time(self): def test_bridge_forward_delay(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -235,7 +229,6 @@ def test_bridge_forward_delay(self): def test_bridge_stp_false(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -275,7 +268,6 @@ class TestNetworkd(IntegrationTestsBase, _CommonTests): def test_bridge_mac(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'br0'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -284,6 +276,7 @@ def test_bridge_mac(self): match: name: %(ec)s macaddress: %(ec_mac)s + %(e2c)s: {} bridges: br0: interfaces: [ethbr] @@ -301,7 +294,6 @@ def test_bridge_mac(self): def test_bridge_anonymous(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -329,7 +321,6 @@ def test_bridge_anonymous(self): def test_bridge_isolated(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -349,7 +340,6 @@ def test_bridge_isolated(self): def test_bridge_port_priority(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -393,7 +383,6 @@ def test_bridge_mac(self): def test_bridge_priority(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -426,7 +415,6 @@ def test_bridge_priority(self): def test_bridge_port_priority(self): self.setup_eth(None) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybr'], stderr=subprocess.DEVNULL) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s diff --git a/tests/integration/ethernets.py b/tests/integration/ethernets.py index 66b228c84..776008a8d 100644 --- a/tests/integration/ethernets.py +++ b/tests/integration/ethernets.py @@ -32,7 +32,6 @@ class _CommonTests(): def test_eth_mtu(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -55,7 +54,6 @@ def test_eth_mtu(self): def test_eth_mac(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -81,7 +79,6 @@ def test_eth_glob(self): Interface globbing was introduced as of NM 1.14+''' self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -175,7 +172,6 @@ def test_manual_addresses(self): addresses: ["172.16.7.2/30", "4321:AAAA::99/80"] dhcp4: yes ''' % {'r': self.backend, 'ec': self.dev_e_client, 'e2c': self.dev_e2_client}) - self.start_dnsmasq(None, self.dev_e2_ap) self.generate_and_settle() if self.backend == 'NetworkManager': self.nm_online_full(self.dev_e2_client) diff --git a/tests/integration/ovs.py b/tests/integration/ovs.py index 5ace7fe33..46be86539 100644 --- a/tests/integration/ovs.py +++ b/tests/integration/ovs.py @@ -78,12 +78,13 @@ def test_cleanup_interfaces(self): # If we have just OVS interfaces/ports networkd/networkctl will not be # aware that our network is ready. %(ec)s: {addresses: [10.10.10.20/24]} + %(e2c)s: {addresses: [10.10.10.30/24]} openvswitch: ports: - [patch0-1, patch1-0] bridges: ovs0: {interfaces: [patch0-1]} - ovs1: {interfaces: [patch1-0]}''' % {'ec': self.dev_e_client}) + ovs1: {interfaces: [patch1-0]}''' % {'ec': self.dev_e_client, 'e2c': self.dev_e2_client}) self.generate_and_settle() # Basic verification that the bridges/ports/interfaces are there in OVS out = subprocess.check_output(['ovs-vsctl', 'show']) @@ -119,12 +120,13 @@ def test_cleanup_patch_ports(self): f.write('''network: ethernets: %(ec)s: {addresses: [10.10.10.20/24]} + %(e2c)s: {addresses: [10.10.10.30/24]} openvswitch: ports: [[patch0-1, patch1-0]] bonds: bond0: {interfaces: [patch1-0, %(ec)s]} bridges: - ovs0: {interfaces: [patch0-1, bond0]}''' % {'ec': self.dev_e_client}) + ovs0: {interfaces: [patch0-1, bond0]}''' % {'ec': self.dev_e_client, 'e2c': self.dev_e2_client}) self.generate_and_settle() # Basic verification that the bridges/ports/interfaces are there in OVS out = subprocess.check_output(['ovs-vsctl', 'show']) @@ -137,6 +139,7 @@ def test_cleanup_patch_ports(self): f.write('''network: ethernets: %(ec)s: {addresses: [10.10.10.20/24]} + %(ec)s: {addresses: [10.10.10.30/24]} openvswitch: ports: [[patchx, patchy]] bonds: @@ -283,7 +286,7 @@ def test_bond_base(self): self.assert_iface('ovsbr', ['inet 192.170.1.1/24']) def test_bridge_patch_ports(self): - self.setup_eth(None, False) + self.setup_eth(None) self.addCleanup(subprocess.call, ['ovs-vsctl', '--if-exists', 'del-br', 'br0']) self.addCleanup(subprocess.call, ['ovs-vsctl', '--if-exists', 'del-br', 'br1']) self.addCleanup(subprocess.call, ['ovs-vsctl', '--if-exists', 'del-port', 'patch0-1']) @@ -374,11 +377,12 @@ def test_vlan_maas(self): nameservers: addresses: [10.5.32.99] search: [maas] + %(e2c)s: {} vlans: %(ec)s.21: id: 21 link: %(ec)s - mtu: 1500''' % {'ec': self.dev_e_client}) + mtu: 1500''' % {'ec': self.dev_e_client, 'e2c': self.dev_e2_client}) self.generate_and_settle() # Basic verification that the interfaces/ports are set up in OVS out = subprocess.check_output(['ovs-vsctl', 'show'], universal_newlines=True) diff --git a/tests/integration/regressions.py b/tests/integration/regressions.py index 10ef8dc87..7ac715e8f 100644 --- a/tests/integration/regressions.py +++ b/tests/integration/regressions.py @@ -42,7 +42,6 @@ class TestNetworkd(IntegrationTestsBase, _CommonTests): def test_lp1802322_bond_mac_rename(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) self.addCleanup(subprocess.call, ['ip', 'link', 'delete', 'mybond'], stderr=subprocess.DEVNULL) with open(self.config, 'w') as f: f.write('''network: diff --git a/tests/integration/routing.py b/tests/integration/routing.py index 244b6f2ec..95c619f74 100644 --- a/tests/integration/routing.py +++ b/tests/integration/routing.py @@ -35,7 +35,6 @@ def test_route_on_link(self): The on-link option was introduced as of NM 1.12+ (for IPv4) The on-link option was introduced as of NM 1.18+ (for IPv6)''' self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -59,7 +58,6 @@ def test_route_from(self): The from option was introduced as of NM 1.8+''' self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -82,7 +80,6 @@ def test_route_table(self): The table option was introduced as of NM 1.10+''' self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) table_id = '255' # This is the 'local' FIB of /etc/iproute2/rt_tables with open(self.config, 'w') as f: f.write('''network: @@ -263,7 +260,6 @@ def test_link_route_v4(self): @unittest.skip("networkd does not handle non-unicast routes correctly yet (Invalid argument)") def test_route_type_blackhole(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s @@ -283,7 +279,6 @@ def test_route_type_blackhole(self): def test_route_with_policy(self): self.setup_eth(None) - self.start_dnsmasq(None, self.dev_e2_ap) with open(self.config, 'w') as f: f.write('''network: renderer: %(r)s