Skip to content

Commit

Permalink
tests: add integration test for wifi/psk-sha256
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloegea authored and slyon committed Feb 4, 2025
1 parent 0965bc9 commit 53636f1
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/integration/wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,43 @@ def test_wifi_ipv4_wpa2(self):
text=True)
self.assertRegex(out, 'DNS.*192.168.5.1')

def test_wifi_ipv4_wpa2_psk_sha256_only(self):
self.setup_ap('''hw_mode=g
channel=1
ssid=fake net
wpa=2
wpa_key_mgmt=WPA-PSK-SHA256
wpa_pairwise=CCMP
ieee80211w=2
wpa_passphrase=12345678
''', None)

with open(self.config, 'w') as f:
f.write('''network:
renderer: %(r)s
wifis:
%(wc)s:
dhcp4: yes
access-points:
"fake net":
auth:
key-management: psk-sha256
password: 12345678
decoy: {}''' % {'r': self.backend, 'wc': self.dev_w_client})
self.generate_and_settle([self.state_dhcp4(self.dev_w_client)])
self.assert_iface_up(self.dev_w_client, ['inet 192.168.5.[0-9]+/24'])
self.assertIn(b'default via 192.168.5.1', # from DHCP
subprocess.check_output(['ip', 'route', 'show', 'dev', self.dev_w_client]))
if self.backend == 'NetworkManager':
out = subprocess.check_output(['nmcli', 'dev', 'show', self.dev_w_client],
text=True)
self.assertRegex(out, 'GENERAL.CONNECTION.*netplan-%s-fake net' % self.dev_w_client)
self.assertRegex(out, 'IP4.DNS.*192.168.5.1')
else:
out = subprocess.check_output(['networkctl', 'status', self.dev_w_client],
text=True)
self.assertRegex(out, 'DNS.*192.168.5.1')

def test_wifi_regdom(self):
self.setup_ap('''hw_mode=g
channel=1
Expand Down

0 comments on commit 53636f1

Please sign in to comment.