diff --git a/tests/generator/test_auth.py b/tests/generator/test_auth.py index 9d64298f3..af8d95831 100644 --- a/tests/generator/test_auth.py +++ b/tests/generator/test_auth.py @@ -42,6 +42,10 @@ def test_auth_wifi_detailed(self): auth: key-management: psk password: "db3b0acf5653aeaddd5fe034fb9f07175b2864f847b005aaa2f09182d9411b04" + "Isaac's Home": + auth: + key-management: psk-sha256 + password: "d3cryptPr1v4t3K3y" workplace: auth: key-management: eap @@ -118,6 +122,14 @@ def test_auth_wifi_detailed(self): key_mgmt=WPA-PSK psk=db3b0acf5653aeaddd5fe034fb9f07175b2864f847b005aaa2f09182d9411b04 } +''', new_config) + self.assertIn(''' +network={ + ssid=P"Isaac's Home" + key_mgmt=WPA-PSK WPA-PSK-SHA256 + ieee80211w=1 + psk=d3cryptPr1v4t3K3y +} ''', new_config) self.assertIn(''' network={ @@ -246,6 +258,10 @@ def test_auth_wifi_detailed(self): auth: key-management: psk password: "4lsos3kr1t" + "Isaac's Home": + auth: + key-management: psk-sha256 + password: "d3cryptPr1v4t3K3y" workplace: auth: key-management: eap @@ -326,6 +342,26 @@ def test_auth_wifi_detailed(self): [wifi-security] key-mgmt=wpa-psk psk=4lsos3kr1t +''', + 'wl0-Isaac%27s%20Home': '''[connection] +id=netplan-wl0-Isaac's Home +type=wifi +interface-name=wl0 + +[ipv4] +method=auto + +[ipv6] +method=ignore + +[wifi] +ssid=Isaac's Home +mode=infrastructure + +[wifi-security] +key-mgmt=wpa-psk +pmf=1 +psk=d3cryptPr1v4t3K3y ''', 'wl0-workplace': '''[connection] id=netplan-wl0-workplace diff --git a/tests/parser/test_keyfile.py b/tests/parser/test_keyfile.py index e178f7729..4c26c8323 100644 --- a/tests/parser/test_keyfile.py +++ b/tests/parser/test_keyfile.py @@ -1505,6 +1505,56 @@ def test_keyfile_wpa3_sae(self): name: "test2" '''.format(UUID, UUID)}) + def test_keyfile_wpa2_sae(self): + self.generate_from_keyfile('''[connection] +id=test2 +uuid={} +type=wifi +interface-name=wlan0 + +[wifi] +mode=infrastructure +ssid=ubuntu-wpa2-only + +[wifi-security] +key-mgmt=wpa-psk +psk=test1234 + +[ipv4] +method=auto + +[ipv6] +addr-gen-mode=stable-privacy +method=auto + +[proxy] +'''.format(UUID)) + self.assert_netplan({UUID: '''network: + version: 2 + wifis: + NM-{}: + renderer: NetworkManager + match: + name: "wlan0" + dhcp4: true + dhcp6: true + ipv6-address-generation: "stable-privacy" + access-points: + "ubuntu-wpa2-only": + auth: + key-management: "wpa-psk-sha256" + password: "test1234" + networkmanager: + uuid: "ff9d6ebc-226d-4f82-a485-b7ff83b9607f" + name: "test2" + passthrough: + ipv6.ip6-privacy: "-1" + proxy._: "" + networkmanager: + uuid: "{}" + name: "test2" +'''.format(UUID, UUID)}) + def test_keyfile_wpa3_enterprise_eap_sha256(self): self.generate_from_keyfile('''[connection] id=test2