From ac0fb9853593d2136fdd6b2b055ac62022c82e11 Mon Sep 17 00:00:00 2001 From: Danilo Egea Gondolfo Date: Mon, 30 Sep 2024 17:12:04 +0100 Subject: [PATCH] tests: adapt tests to new passthrough format --- tests/cli/test_get_set.py | 12 +- tests/generator/test_modems.py | 38 ++-- tests/generator/test_passthrough.py | 177 ++++++++++++++- tests/parser/test_keyfile.py | 336 +++++++++++++++++----------- 4 files changed, 401 insertions(+), 162 deletions(-) diff --git a/tests/cli/test_get_set.py b/tests/cli/test_get_set.py index 6d8b93ae3..79b01c657 100644 --- a/tests/cli/test_get_set.py +++ b/tests/cli/test_get_set.py @@ -479,15 +479,17 @@ def test_set_delete_nm_passthrough(self): networkmanager: name: "myid with spaces" passthrough: - connection.permissions: "" - ipv4.dns-search: ""''') + connection: + permissions: "" + ipv4: + dns-search: ""''') ap_key = 'network.wifis.wlan0.access-points.SOME-SSID' - self._set([ap_key+'.networkmanager.passthrough.connection\\.permissions=null']) + self._set([ap_key+'.networkmanager.passthrough.connection.permissions=null']) with open(self.path, 'r') as f: out = yaml.safe_load(f) ap = out['network']['wifis']['wlan0']['access-points']['SOME-SSID'] - self.assertNotIn('connection.permissions', ap['networkmanager']['passthrough']) - self.assertEqual('', ap['networkmanager']['passthrough']['ipv4.dns-search']) + self.assertNotIn('permissions', ap['networkmanager']['passthrough']['connection']) + self.assertEqual('', ap['networkmanager']['passthrough']['ipv4']['dns-search']) def test_set_delete_bridge_subparams(self): with open(self.path, 'w') as f: diff --git a/tests/generator/test_modems.py b/tests/generator/test_modems.py index b66144efc..867b14c49 100644 --- a/tests/generator/test_modems.py +++ b/tests/generator/test_modems.py @@ -380,17 +380,21 @@ def test_modem_nm_integration_gsm_cdma(self): uuid: a08c5805-7cf5-43f7-afb9-12cb30f6eca3 name: "T-Mobile Funkadelic 2" passthrough: - connection.type: "bluetooth" - gsm.apn: "internet2.voicestream.com" - gsm.device-id: "da812de91eec16620b06cd0ca5cbc7ea25245222" - gsm.username: "george.clinton.again" - gsm.sim-operator-id: "310260" - gsm.pin: "123456" - gsm.sim-id: "89148000000060671234" - gsm.password: "parliament2" - gsm.network-id: "254098" - ipv4.method: "auto" - ipv6.method: "auto"''') + connection: + type: bluetooth + gsm: + apn: internet2.voicestream.com + device-id: da812de91eec16620b06cd0ca5cbc7ea25245222 + username: george.clinton.again + sim-operator-id: 310260 + pin: 123456 + sim-id: 89148000000060671234 + password: parliament2 + network-id: 254098 + ipv4: + method: auto + ipv6: + method: auto''') self.assert_nm({'NM-a08c5805-7cf5-43f7-afb9-12cb30f6eca3': '''[connection] id=T-Mobile Funkadelic 2 #Netplan: passthrough override @@ -400,19 +404,19 @@ def test_modem_nm_integration_gsm_cdma(self): [gsm] apn=internet2.voicestream.com #Netplan: passthrough setting -device-id=da812de91eec16620b06cd0ca5cbc7ea25245222 +password=parliament2 #Netplan: passthrough setting -username=george.clinton.again +network-id=254098 #Netplan: passthrough setting -sim-operator-id=310260 +sim-id=89148000000060671234 #Netplan: passthrough setting pin=123456 #Netplan: passthrough setting -sim-id=89148000000060671234 +username=george.clinton.again #Netplan: passthrough setting -password=parliament2 +sim-operator-id=310260 #Netplan: passthrough setting -network-id=254098 +device-id=da812de91eec16620b06cd0ca5cbc7ea25245222 [ipv4] #Netplan: passthrough override diff --git a/tests/generator/test_passthrough.py b/tests/generator/test_passthrough.py index 8e99af473..e300270fd 100644 --- a/tests/generator/test_passthrough.py +++ b/tests/generator/test_passthrough.py @@ -39,7 +39,42 @@ def test_passthrough_basic(self): passthrough: connection.uuid: 87749f1d-334f-40b2-98d4-55db58965f5f connection.type: ethernet - connection.permissions: ""''') + connection.permissions: ""''', skip_generated_yaml_validation=True) + + self.assert_nm({'NM-87749f1d-334f-40b2-98d4-55db58965f5f': '''[connection] +id=some NM id +type=ethernet +uuid=87749f1d-334f-40b2-98d4-55db58965f5f +#Netplan: passthrough setting +permissions= + +[ethernet] +wake-on-lan=0 + +[ipv4] +method=link-local + +[ipv6] +method=ignore +'''}, '''[device-netplan.ethernets.NM-87749f1d-334f-40b2-98d4-55db58965f5f] +match-device=type:ethernet +managed=1\n\n''') + + def test_passthrough_basic_new_format(self): + self.generate('''network: + version: 2 + ethernets: + NM-87749f1d-334f-40b2-98d4-55db58965f5f: + renderer: NetworkManager + match: {} + networkmanager: + uuid: 87749f1d-334f-40b2-98d4-55db58965f5f + name: some NM id + passthrough: + connection: + uuid: 87749f1d-334f-40b2-98d4-55db58965f5f + type: ethernet + permissions: ""''') self.assert_nm({'NM-87749f1d-334f-40b2-98d4-55db58965f5f': '''[connection] id=some NM id @@ -75,6 +110,61 @@ def test_passthrough_wifi(self): passthrough: connection.permissions: "" wifi.ssid: SOME-SSID + "OTHER-SSID": + hidden: true''', skip_generated_yaml_validation=True) + + self.assert_nm({'NM-87749f1d-334f-40b2-98d4-55db58965f5f-SOME-SSID': '''[connection] +id=myid with spaces +type=wifi +uuid=87749f1d-334f-40b2-98d4-55db58965f5f +#Netplan: passthrough setting +permissions= + +[ipv4] +method=link-local + +[ipv6] +method=ignore + +[wifi] +ssid=SOME-SSID +mode=infrastructure +''', + 'NM-87749f1d-334f-40b2-98d4-55db58965f5f-OTHER-SSID': '''[connection] +id=netplan-NM-87749f1d-334f-40b2-98d4-55db58965f5f-OTHER-SSID +type=wifi + +[ipv4] +method=link-local + +[ipv6] +method=ignore + +[wifi] +ssid=OTHER-SSID +mode=infrastructure +hidden=true +'''}, '''[device-netplan.wifis.NM-87749f1d-334f-40b2-98d4-55db58965f5f] +match-device=type:wifi +managed=1\n\n''') + + def test_passthrough_wifi_new_format(self): + self.generate('''network: + version: 2 + wifis: + NM-87749f1d-334f-40b2-98d4-55db58965f5f: + renderer: NetworkManager + match: {} + access-points: + "SOME-SSID": + networkmanager: + uuid: 87749f1d-334f-40b2-98d4-55db58965f5f + name: myid with spaces + passthrough: + connection: + permissions: "" + wifi: + ssid: SOME-SSID "OTHER-SSID": hidden: true''') @@ -121,8 +211,9 @@ def test_passthrough_type_nm_devices(self): match: {} networkmanager: passthrough: - connection.uuid: 87749f1d-334f-40b2-98d4-55db58965f5f - connection.type: dummy''') # wokeignore:rule=dummy + connection: + uuid: 87749f1d-334f-40b2-98d4-55db58965f5f + type: dummy''') # wokeignore:rule=dummy self.assert_nm({'NM-87749f1d-334f-40b2-98d4-55db58965f5f': '''[connection] id=netplan-NM-87749f1d-334f-40b2-98d4-55db58965f5f @@ -149,7 +240,38 @@ def test_passthrough_dotted_group(self): networkmanager: passthrough: connection.type: "wireguard" - wireguard-peer.some-key.endpoint: 1.2.3.4''') + wireguard-peer.some-key.endpoint: 1.2.3.4''', skip_generated_yaml_validation=True) + + self.assert_nm({'dotted-group-test': '''[connection] +id=netplan-dotted-group-test +#Netplan: passthrough setting +type=wireguard + +[ipv4] +method=link-local + +[ipv6] +method=ignore + +[wireguard-peer.some-key] +#Netplan: passthrough setting +endpoint=1.2.3.4 +'''}, '''[device-netplan.nm-devices.dotted-group-test] +match-device=type:wireguard +managed=1\n\n''') + + def test_passthrough_dotted_group_new_format(self): + self.generate('''network: + nm-devices: + dotted-group-test: + renderer: NetworkManager + match: {} + networkmanager: + passthrough: + connection: + type: "wireguard" + wireguard-peer.some-key: + endpoint: 1.2.3.4''') self.assert_nm({'dotted-group-test': '''[connection] id=netplan-dotted-group-test @@ -179,7 +301,7 @@ def test_passthrough_dotted_key(self): passthrough: tc.qdisc.root: something tc.qdisc.fff1: ":abc" - tc.filters.test: "test"''') + tc.filters.test: "test"''', skip_generated_yaml_validation=True) self.assert_nm({'dotted-key-test': '''[connection] id=netplan-dotted-key-test @@ -198,9 +320,46 @@ def test_passthrough_dotted_key(self): #Netplan: passthrough setting qdisc.root=something #Netplan: passthrough setting +filters.test=test +#Netplan: passthrough setting qdisc.fff1=:abc +'''}, '''[device-netplan.ethernets.dotted-key-test] +match-device=type:ethernet +managed=1\n\n''') + + def test_passthrough_dotted_key_new_format(self): + self.generate('''network: + ethernets: + dotted-key-test: + renderer: NetworkManager + match: {} + networkmanager: + passthrough: + tc: + qdisc.root: something + qdisc.fff1: ":abc" + filters.test: "test"''') + + self.assert_nm({'dotted-key-test': '''[connection] +id=netplan-dotted-key-test +type=ethernet + +[ethernet] +wake-on-lan=0 + +[ipv4] +method=link-local + +[ipv6] +method=ignore + +[tc] +#Netplan: passthrough setting +qdisc.root=something #Netplan: passthrough setting filters.test=test +#Netplan: passthrough setting +qdisc.fff1=:abc '''}, '''[device-netplan.ethernets.dotted-key-test] match-device=type:ethernet managed=1\n\n''') @@ -215,7 +374,8 @@ def test_passthrough_unsupported_setting(self): "SOME-SSID": # implicit "mode: infrasturcutre" networkmanager: passthrough: - wifi.mode: "mesh"''') + wifi: + mode: "mesh"''') self.assert_nm({'test-SOME-SSID': '''[connection] id=netplan-test-SOME-SSID @@ -243,7 +403,7 @@ def test_passthrough_empty_group(self): match: {} networkmanager: passthrough: - proxy._: ""''') + proxy: {}''') self.assert_nm({'test': '''[connection] id=netplan-test @@ -311,7 +471,8 @@ def test_passthrough_ip6_privacy_default(self): uuid: 626dd384-8b3d-3690-9511-192b2c79b3fd name: "netplan-eth0" passthrough: - "ipv6.ip6-privacy": "-1" + ipv6: + ip6-privacy: -1 ''') self.assert_nm({'eth0': '''[connection] diff --git a/tests/parser/test_keyfile.py b/tests/parser/test_keyfile.py index e178f7729..14e4f89da 100644 --- a/tests/parser/test_keyfile.py +++ b/tests/parser/test_keyfile.py @@ -91,9 +91,12 @@ def test_keyfile_gsm(self): uuid: "{}" name: "T-Mobile Funkadelic 2" passthrough: - gsm.home-only: "true" - ipv4.dns-search: "" - ipv6.dns-search: "" + gsm: + home-only: "true" + ipv4: + dns-search: "" + ipv6: + dns-search: "" '''.format(UUID, UUID)}) def test_keyfile_cdma(self): @@ -165,21 +168,25 @@ def test_keyfile_gsm_via_bluetooth(self): uuid: "{}" name: "T-Mobile Funkadelic 2" passthrough: - connection.type: "bluetooth" - gsm.apn: "internet2.voicestream.com" - gsm.device-id: "da812de91eec16620b06cd0ca5cbc7ea25245222" - gsm.home-only: "true" - gsm.network-id: "254098" - gsm.password: "parliament2" - gsm.pin: "123456" - gsm.sim-id: "89148000000060671234" - gsm.sim-operator-id: "310260" - gsm.username: "george.clinton.again" - ipv4.dns-search: "" - ipv4.method: "auto" - ipv6.dns-search: "" - ipv6.method: "auto" - proxy._: "" + connection: + type: "bluetooth" + proxy: {{}} + gsm: + password: "parliament2" + apn: "internet2.voicestream.com" + home-only: "true" + network-id: "254098" + sim-id: "89148000000060671234" + pin: "123456" + device-id: "da812de91eec16620b06cd0ca5cbc7ea25245222" + sim-operator-id: "310260" + username: "george.clinton.again" + ipv4: + method: "auto" + dns-search: "" + ipv6: + method: "auto" + dns-search: "" '''.format(UUID, UUID)}) def test_keyfile_method_auto(self): @@ -232,9 +239,11 @@ def test_keyfile_method_auto(self): uuid: "{}" name: "Test" passthrough: - ipv4.dns-search: "" - ipv6.dns-search: "" - proxy._: "" + proxy: {{}} + ipv4: + dns-search: "" + ipv6: + dns-search: "" '''.format(UUID, UUID)}) def test_keyfile_fail_validation(self): @@ -332,13 +341,15 @@ def test_keyfile_method_manual(self): uuid: "{}" name: "Test" passthrough: - ipv4.dns-search: "foo.local;bar.remote;" - ipv4.method: "manual" - ipv4.address1: "1.2.3.4/24,8.8.8.8" - ipv6.dns-search: "bar.local" - ipv6.route1: "dead:beef::1/128,2001:1234::2" - ipv6.route1_options: "unknown=invalid," - proxy._: "" + proxy: {{}} + ipv4: + method: "manual" + dns-search: "foo.local;bar.remote;" + address1: "1.2.3.4/24,8.8.8.8" + ipv6: + route1_options: "unknown=invalid," + dns-search: "bar.local" + route1: "dead:beef::1/128,2001:1234::2" '''.format(UUID, UUID)}) def test_keyfile_dummy(self): # wokeignore:rule=dummy @@ -456,8 +467,10 @@ def test_keyfile_type_wifi(self): uuid: "{}" name: "myid with spaces" passthrough: - connection.permissions: "" - ipv4.dns-search: "" + connection: + permissions: "" + ipv4: + dns-search: "" networkmanager: uuid: "{}" name: "myid with spaces" @@ -517,8 +530,10 @@ def _template_keyfile_type_wifi_eap(self, method): uuid: "{}" name: "testnet" passthrough: - connection.permissions: "" - ipv4.dns-search: "" + connection: + permissions: "" + ipv4: + dns-search: "" networkmanager: uuid: "{}" name: "testnet" @@ -580,7 +595,8 @@ def test_keyfile_wifi_eap_leap(self): uuid: "{}" name: "myid with spaces" passthrough: - connection.permissions: "" + connection: + permissions: "" networkmanager: uuid: "{}" name: "myid with spaces" @@ -627,7 +643,8 @@ def test_keyfile_wifi_eap_pwd(self): uuid: "{}" name: "myid with spaces" passthrough: - connection.permissions: "" + connection: + permissions: "" networkmanager: uuid: "{}" name: "myid with spaces" @@ -673,8 +690,10 @@ def test_keyfile_wifi_eap_md5_not_supported(self): uuid: "{}" name: "myid with spaces" passthrough: - connection.permissions: "" - 802-1x.eap: "md5" + connection: + permissions: "" + 802-1x: + eap: "md5" networkmanager: uuid: "{}" name: "myid with spaces" @@ -729,7 +748,8 @@ def test_keyfile_wifi_eap_psk_with_eap(self): uuid: "{}" name: "myid with spaces" passthrough: - connection.permissions: "" + connection: + permissions: "" networkmanager: uuid: "{}" name: "myid with spaces" @@ -754,7 +774,8 @@ def _template_keyfile_type_wifi(self, nd_mode, nm_mode): if nm_mode != nd_mode: wifi_mode = ''' passthrough: - wifi.mode: "{}"'''.format(nm_mode) + wifi: + mode: "{}"'''.format(nm_mode) if nd_mode != 'infrastructure': ap_mode = '\n mode: "%s"' % nd_mode self.assert_netplan({UUID: '''network: @@ -848,7 +869,8 @@ def test_keyfile_wake_on_lan(self): uuid: "{}" name: "myid with spaces" passthrough: - ethernet.wake-on-lan: "2" + ethernet: + wake-on-lan: "2" '''.format(UUID, UUID)}) def test_keyfile_wake_on_lan_nm_default(self): @@ -967,16 +989,21 @@ def test_keyfile_yaml_wifi_hotspot(self): uuid: "{}" name: "Hotspot-1" passthrough: - connection.autoconnect: "false" - connection.permissions: "" - ipv4.dns-search: "" - ipv6.addr-gen-mode: "1" - ipv6.dns-search: "" - wifi.mac-address-blacklist: "" # wokeignore:rule=blacklist - wifi-security.group: "ccmp;" - wifi-security.pairwise: "ccmp;" - wifi-security.proto: "rsn;" - proxy._: "" + connection: + permissions: "" + autoconnect: "false" + wifi: + mac-address-blacklist: "" # wokeignore:rule=blacklist + wifi-security: + proto: "rsn;" + group: "ccmp;" + pairwise: "ccmp;" + ipv4: + dns-search: "" + ipv6: + addr-gen-mode: "1" + dns-search: "" + proxy: {{}} networkmanager: uuid: "{}" name: "Hotspot-1" @@ -1041,7 +1068,8 @@ def test_keyfile_vlan(self): uuid: "{}" name: "netplan-enblue" passthrough: - connection.interface-name: "enblue" + connection: + interface-name: "enblue" '''.format(UUID, UUID)}) def test_keyfile_bridge(self): @@ -1262,10 +1290,12 @@ def test_keyfile_customer_A2(self): uuid: "{}" name: "gsm" passthrough: - ipv4.address1: "10.10.28.159/24" - ipv4.address2: "10.10.164.254/24" - ipv4.address3: "10.10.246.132/24" - ipv6.addr-gen-mode: "1" + ipv4: + address2: "10.10.164.254/24" + address1: "10.10.28.159/24" + address3: "10.10.246.132/24" + ipv6: + addr-gen-mode: "1" '''.format(UUID, UUID)}) def test_keyfile_netplan0103_compat(self): @@ -1359,18 +1389,22 @@ def test_keyfile_netplan0103_compat(self): uuid: "{}" name: "Work Wired" passthrough: - connection.autoconnect: "false" - connection.permissions: "" - connection.timestamp: "305419896" - ethernet.mac-address-blacklist: "" # wokeignore:rule=blacklist - ipv4.address1: "192.168.0.5/24,192.168.0.1" - ipv4.dns-search: "" - ipv4.method: "manual" - ipv4.route4: "3.3.3.3/6,0.0.0.0,4" - ipv4.route4_options: "cwnd=10,mtu=1492,src=1.2.3.4" - ipv6.dns-search: "wallaceandgromit.com;" - ipv6.ip6-privacy: "1" - proxy._: "" + connection: + permissions: "" + autoconnect: "false" + timestamp: "305419896" + proxy: {{}} + ipv4: + route4_options: "cwnd=10,mtu=1492,src=1.2.3.4" + method: "manual" + dns-search: "" + address1: "192.168.0.5/24,192.168.0.1" + route4: "3.3.3.3/6,0.0.0.0,4" + ethernet: + mac-address-blacklist: "" # wokeignore:rule=blacklist + ipv6: + dns-search: "wallaceandgromit.com;" + ip6-privacy: "1" '''.format(UUID, UUID)}) def test_keyfile_tunnel_regression_lp1952967(self): @@ -1413,13 +1447,16 @@ def test_keyfile_tunnel_regression_lp1952967(self): uuid: "{}" name: "IP tunnel connection 1" passthrough: - connection.autoconnect: "false" - connection.interface-name: "gre10" - connection.permissions: "" - ipv4.dns-search: "" - ipv6.dns-search: "" - ipv6.ip6-privacy: "-1" - proxy._: "" + connection: + permissions: "" + autoconnect: "false" + interface-name: "gre10" + proxy: {{}} + ipv4: + dns-search: "" + ipv6: + dns-search: "" + ip6-privacy: "-1" '''.format(UUID, UUID)}) def test_keyfile_ip6_privacy_default_netplan_0104_compat(self): @@ -1451,7 +1488,8 @@ def test_keyfile_ip6_privacy_default_netplan_0104_compat(self): uuid: "{}" name: "Test" passthrough: - ipv6.ip6-privacy: "-1" + ipv6: + ip6-privacy: "-1" '''.format(UUID, UUID)}) def test_keyfile_wpa3_sae(self): @@ -1498,8 +1536,9 @@ def test_keyfile_wpa3_sae(self): uuid: "ff9d6ebc-226d-4f82-a485-b7ff83b9607f" name: "test2" passthrough: - ipv6.ip6-privacy: "-1" - proxy._: "" + proxy: {{}} + ipv6: + ip6-privacy: "-1" networkmanager: uuid: "{}" name: "test2" @@ -1563,8 +1602,9 @@ def test_keyfile_wpa3_enterprise_eap_sha256(self): uuid: "ff9d6ebc-226d-4f82-a485-b7ff83b9607f" name: "test2" passthrough: - ipv6.ip6-privacy: "-1" - proxy._: "" + proxy: {{}} + ipv6: + ip6-privacy: "-1" networkmanager: uuid: "{}" name: "test2" @@ -1628,8 +1668,9 @@ def test_keyfile_wpa3_enterprise_eap_suite_b_192(self): uuid: "ff9d6ebc-226d-4f82-a485-b7ff83b9607f" name: "test2" passthrough: - ipv6.ip6-privacy: "-1" - proxy._: "" + proxy: {{}} + ipv6: + ip6-privacy: "-1" networkmanager: uuid: "{}" name: "test2" @@ -1687,15 +1728,19 @@ def test_keyfile_dns_search_ip4_ip6_conflict(self): uuid: "{}" name: "Work Wired" passthrough: - connection.autoconnect: "false" - connection.timestamp: "305419896" - ethernet.wake-on-lan: "1" - ipv4.method: "manual" - ipv4.address1: "192.168.0.5/24,192.168.0.1" - ipv6.addr-gen-mode: "1" - ipv6.dns-search: "wallaceandgromit.com;" - ipv6.ip6-privacy: "-1" - proxy._: "" + connection: + autoconnect: "false" + timestamp: "305419896" + proxy: {{}} + ipv4: + method: "manual" + address1: "192.168.0.5/24,192.168.0.1" + ethernet: + wake-on-lan: "1" + ipv6: + addr-gen-mode: "1" + dns-search: "wallaceandgromit.com;" + ip6-privacy: "-1" '''.format(UUID, UUID)}) def test_keyfile_nm_140_default_ethernet_group(self): @@ -1730,13 +1775,15 @@ def test_keyfile_nm_140_default_ethernet_group(self): uuid: "{}" name: "Test Write Bridge Main" passthrough: - ethernet._: "" - bridge._: "" - ipv4.address1: "1.2.3.4/24,1.1.1.1" - ipv4.method: "manual" - ipv6.addr-gen-mode: "default" - ipv6.ip6-privacy: "-1" - proxy._: "" + proxy: {{}} + ipv4: + method: "manual" + address1: "1.2.3.4/24,1.1.1.1" + ethernet: {{}} + bridge: {{}} + ipv6: + addr-gen-mode: "default" + ip6-privacy: "-1" '''.format(UUID)}) def test_multiple_eap_methods(self): @@ -1784,8 +1831,10 @@ def test_multiple_eap_methods(self): uuid: "{}" name: "MyWifi" passthrough: - wifi-security.auth-alg: "open" - 802-1x.eap: "peap;tls" + wifi-security: + auth-alg: "open" + 802-1x: + eap: "peap;tls" networkmanager: uuid: "{}" name: "MyWifi" @@ -1836,7 +1885,8 @@ def test_single_eap_method(self): uuid: "{}" name: "MyWifi" passthrough: - wifi-security.auth-alg: "open" + wifi-security: + auth-alg: "open" networkmanager: uuid: "{}" name: "MyWifi" @@ -1862,7 +1912,8 @@ def test_simple_wireguard(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_wireguard_with_key(self): @@ -1890,7 +1941,8 @@ def test_wireguard_with_key(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_wireguard_with_key_and_peer(self): @@ -1928,7 +1980,8 @@ def test_wireguard_with_key_and_peer(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_wireguard_with_empty_endpoint(self): @@ -1965,7 +2018,8 @@ def test_wireguard_with_empty_endpoint(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_wireguard_allowed_ips_without_prefix(self): @@ -2008,7 +2062,8 @@ def test_wireguard_allowed_ips_without_prefix(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_wireguard_with_key_flags(self): @@ -2049,7 +2104,8 @@ def test_wireguard_with_key_flags(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_wireguard_with_key_all_flags_enabled(self): @@ -2092,7 +2148,8 @@ def test_wireguard_with_key_all_flags_enabled(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_wireguard_with_key_and_peer_without_allowed_ips(self): @@ -2127,7 +2184,8 @@ def test_wireguard_with_key_and_peer_without_allowed_ips(self): uuid: "{}" name: "wg0" passthrough: - connection.interface-name: "wg0" + connection: + interface-name: "wg0" '''.format(UUID, UUID)}) def test_vxlan_with_local_and_remote(self): @@ -2158,7 +2216,8 @@ def test_vxlan_with_local_and_remote(self): uuid: "{}" name: "vxlan10" passthrough: - connection.interface-name: "vxlan10" + connection: + interface-name: "vxlan10" '''.format(UUID, UUID)}) def test_simple_vxlan(self): @@ -2185,7 +2244,8 @@ def test_simple_vxlan(self): uuid: "{}" name: "vxlan10" passthrough: - connection.interface-name: "vxlan10" + connection: + interface-name: "vxlan10" '''.format(UUID, UUID)}) def test_invalid_tunnel_mode(self): @@ -2238,7 +2298,8 @@ def test_keyfile_wifi_random_cloned_mac_address(self): uuid: "{}" name: "myid with spaces" passthrough: - ipv4.dns-search: "" + ipv4: + dns-search: "" networkmanager: uuid: "{}" name: "myid with spaces" @@ -2271,7 +2332,8 @@ def test_keyfile_ethernet_random_cloned_mac_address(self): uuid: "{}" name: "myid with spaces" passthrough: - ipv4.dns-search: "" + ipv4: + dns-search: "" '''.format(UUID, UUID)}) def test_veth_pair(self): @@ -2297,7 +2359,8 @@ def test_veth_pair(self): uuid: "{}" name: "veth-peer1" passthrough: - connection.interface-name: "veth-peer1" + connection: + interface-name: "veth-peer1" '''.format(UUID, UUID)}) def test_veth_without_peer(self): @@ -2337,7 +2400,8 @@ def test_vrf_basic(self): uuid: "{}" name: "vrf0" passthrough: - connection.interface-name: "vrf0" + connection: + interface-name: "vrf0" '''.format(UUID, UUID)}) def test_vrf_without_table_should_fail(self): @@ -2422,11 +2486,13 @@ def test_nameserver_with_DoT_lp2055148(self): uuid: "{}" name: "ethernet-eth123" passthrough: - ethernet._: "" - ipv4.dns: "8.8.8.8;1.1.1.1#lxd;192.168.0.1#domain.local;" - ipv6.addr-gen-mode: "default" - ipv6.ip6-privacy: "-1" - proxy._: "" + proxy: {{}} + ipv4: + dns: "8.8.8.8;1.1.1.1#lxd;192.168.0.1#domain.local;" + ethernet: {{}} + ipv6: + addr-gen-mode: "default" + ip6-privacy: "-1" '''.format(UUID, UUID)}) def test_ipv4_route_metric_is_overriden_when_dhcp4_is_disabled(self): @@ -2461,12 +2527,15 @@ def test_ipv4_route_metric_is_overriden_when_dhcp4_is_disabled(self): uuid: "{}" name: "dummy-123" passthrough: - connection.interface-name: "dummy123" - ipv4.method: "manual" - ipv4.address1: "100.85.0.1/24,100.85.0.1" - ipv6.addr-gen-mode: "default" - dummy._: "" - proxy._: "" + connection: + interface-name: "dummy123" + proxy: {{}} + ipv4: + method: "manual" + address1: "100.85.0.1/24,100.85.0.1" + ipv6: + addr-gen-mode: "default" + dummy: {{}} '''.format(UUID, UUID)}) def test_ipv6_route_metric_is_overriden_when_dhcp6_is_disabled(self): @@ -2501,12 +2570,15 @@ def test_ipv6_route_metric_is_overriden_when_dhcp6_is_disabled(self): uuid: "{}" name: "dummy-123" passthrough: - connection.interface-name: "dummy123" - ipv4.method: "disabled" - ipv6.method: "manual" - ipv6.address1: "fdeb:446c:912d:8da::/64,fdeb:446c:912d:8da::1" - ipv6.addr-gen-mode: "default" - ipv6.ip6-privacy: "-1" - dummy._: "" - proxy._: "" + connection: + interface-name: "dummy123" + proxy: {{}} + ipv4: + method: "disabled" + ipv6: + addr-gen-mode: "default" + method: "manual" + address1: "fdeb:446c:912d:8da::/64,fdeb:446c:912d:8da::1" + ip6-privacy: "-1" + dummy: {{}} '''.format(UUID, UUID)})