mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-03 07:44:08 +01:00
auto-t: FILS autotest
This commit is contained in:
parent
0a1f6a1d7c
commit
00bbc62dfb
90
autotests/testFILS/fils_256_test.py
Normal file
90
autotests/testFILS/fils_256_test.py
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
sys.path.append('../util')
|
||||||
|
import iwd
|
||||||
|
from iwd import IWD
|
||||||
|
from iwd import PSKAgent
|
||||||
|
from iwd import NetworkType
|
||||||
|
import testutil
|
||||||
|
|
||||||
|
class Test(unittest.TestCase):
|
||||||
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
psk_agent = PSKAgent('user@example.com', ('user@example.com',
|
||||||
|
'secret123'))
|
||||||
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
|
devices = wd.list_devices(1)
|
||||||
|
device = devices[0]
|
||||||
|
|
||||||
|
condition = 'not obj.scanning'
|
||||||
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
|
device.scan()
|
||||||
|
|
||||||
|
condition = 'not obj.scanning'
|
||||||
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
|
ordered_network = device.get_ordered_network('ssidFILS-256')
|
||||||
|
|
||||||
|
self.assertEqual(ordered_network.type, NetworkType.eap)
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
ordered_network.network_object.connect()
|
||||||
|
|
||||||
|
condition = 'obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
testutil.test_iface_operstate()
|
||||||
|
testutil.test_ifaces_connected()
|
||||||
|
|
||||||
|
device.disconnect()
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
ordered_network = device.get_ordered_network('ssidFILS-256')
|
||||||
|
|
||||||
|
self.assertEqual(ordered_network.type, NetworkType.eap)
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
ordered_network.network_object.connect()
|
||||||
|
|
||||||
|
condition = 'obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
testutil.test_iface_operstate()
|
||||||
|
testutil.test_ifaces_connected()
|
||||||
|
|
||||||
|
sleep(5)
|
||||||
|
|
||||||
|
testutil.test_iface_operstate()
|
||||||
|
testutil.test_ifaces_connected()
|
||||||
|
|
||||||
|
device.disconnect()
|
||||||
|
|
||||||
|
wd.unregister_psk_agent(psk_agent)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
IWD.copy_to_storage('ssidFILS-256.8021x')
|
||||||
|
os.system('ifconfig lo up')
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
IWD.clear_storage()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(exit=True)
|
90
autotests/testFILS/fils_384_test.py
Normal file
90
autotests/testFILS/fils_384_test.py
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
sys.path.append('../util')
|
||||||
|
import iwd
|
||||||
|
from iwd import IWD
|
||||||
|
from iwd import PSKAgent
|
||||||
|
from iwd import NetworkType
|
||||||
|
import testutil
|
||||||
|
|
||||||
|
class Test(unittest.TestCase):
|
||||||
|
def test_connection_success(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
psk_agent = PSKAgent('user@example.com', ('user@example.com',
|
||||||
|
'secret123'))
|
||||||
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
|
devices = wd.list_devices(1)
|
||||||
|
device = devices[0]
|
||||||
|
|
||||||
|
condition = 'not obj.scanning'
|
||||||
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
|
device.scan()
|
||||||
|
|
||||||
|
condition = 'not obj.scanning'
|
||||||
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
|
ordered_network = device.get_ordered_network('ssidFILS-384')
|
||||||
|
|
||||||
|
self.assertEqual(ordered_network.type, NetworkType.eap)
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
ordered_network.network_object.connect()
|
||||||
|
|
||||||
|
condition = 'obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
testutil.test_iface_operstate()
|
||||||
|
testutil.test_ifaces_connected()
|
||||||
|
|
||||||
|
device.disconnect()
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
ordered_network = device.get_ordered_network('ssidFILS-384')
|
||||||
|
|
||||||
|
self.assertEqual(ordered_network.type, NetworkType.eap)
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
ordered_network.network_object.connect()
|
||||||
|
|
||||||
|
condition = 'obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
testutil.test_iface_operstate()
|
||||||
|
testutil.test_ifaces_connected()
|
||||||
|
|
||||||
|
sleep(5)
|
||||||
|
|
||||||
|
testutil.test_iface_operstate()
|
||||||
|
testutil.test_ifaces_connected()
|
||||||
|
|
||||||
|
device.disconnect()
|
||||||
|
|
||||||
|
wd.unregister_psk_agent(psk_agent)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
IWD.copy_to_storage('ssidFILS-384.8021x')
|
||||||
|
os.system('ifconfig lo up')
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
IWD.clear_storage()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(exit=True)
|
9
autotests/testFILS/hw.conf
Normal file
9
autotests/testFILS/hw.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[SETUP]
|
||||||
|
num_radios=3
|
||||||
|
max_test_exec_interval_sec=45
|
||||||
|
tmpfs_extra_stuff=../misc/secrets:pwd.eap_user:../misc/certs
|
||||||
|
start_iwd=0
|
||||||
|
|
||||||
|
[HOSTAPD]
|
||||||
|
rad0=ssidFILS-256.conf
|
||||||
|
rad1=ssidFILS-384.conf
|
1
autotests/testFILS/pwd.eap_user
Normal file
1
autotests/testFILS/pwd.eap_user
Normal file
@ -0,0 +1 @@
|
|||||||
|
"user@example.com" PWD "secret123"
|
2
autotests/testFILS/ssidFILS-256.8021x
Normal file
2
autotests/testFILS/ssidFILS-256.8021x
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Security]
|
||||||
|
EAP-Method=PWD
|
27
autotests/testFILS/ssidFILS-256.conf
Normal file
27
autotests/testFILS/ssidFILS-256.conf
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
hw_mode=g
|
||||||
|
channel=1
|
||||||
|
ssid=ssidFILS-256
|
||||||
|
wpa=2
|
||||||
|
wpa_key_mgmt=FILS-SHA256 WPA-EAP
|
||||||
|
rsn_pairwise=CCMP
|
||||||
|
group_cipher=CCMP
|
||||||
|
ieee8021x=1
|
||||||
|
ieee80211w=2
|
||||||
|
|
||||||
|
auth_server_addr=127.0.0.1
|
||||||
|
auth_server_port=1812
|
||||||
|
auth_server_shared_secret=secret
|
||||||
|
nas_identifier=nas.w1.fi
|
||||||
|
|
||||||
|
erp_send_reauth_start=1
|
||||||
|
erp_domain=example.com
|
||||||
|
fils_realm=example.com
|
||||||
|
disable_pmksa_caching=1
|
||||||
|
|
||||||
|
radius_server_clients=/tmp/certs/radius-clients.text
|
||||||
|
radius_server_auth_port=1812
|
||||||
|
eap_server=0
|
||||||
|
eap_user_file=/tmp/pwd.eap_user
|
||||||
|
eap_server_erp=1
|
||||||
|
pwd_group=19
|
||||||
|
wpa_group_rekey=5
|
2
autotests/testFILS/ssidFILS-384.8021x
Normal file
2
autotests/testFILS/ssidFILS-384.8021x
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Security]
|
||||||
|
EAP-Method=PWD
|
25
autotests/testFILS/ssidFILS-384.conf
Normal file
25
autotests/testFILS/ssidFILS-384.conf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
hw_mode=g
|
||||||
|
channel=1
|
||||||
|
ssid=ssidFILS-384
|
||||||
|
wpa=2
|
||||||
|
wpa_key_mgmt=FILS-SHA384 WPA-EAP
|
||||||
|
rsn_pairwise=CCMP
|
||||||
|
group_cipher=CCMP
|
||||||
|
ieee8021x=1
|
||||||
|
ieee80211w=2
|
||||||
|
|
||||||
|
auth_server_addr=127.0.0.1
|
||||||
|
auth_server_port=1812
|
||||||
|
auth_server_shared_secret=secret
|
||||||
|
nas_identifier=nas.w1.fi
|
||||||
|
|
||||||
|
erp_send_reauth_start=1
|
||||||
|
erp_domain=example.com
|
||||||
|
fils_realm=example.com
|
||||||
|
disable_pmksa_caching=1
|
||||||
|
|
||||||
|
eap_server=0
|
||||||
|
eap_user_file=/tmp/pwd.eap_user
|
||||||
|
eap_server_erp=1
|
||||||
|
pwd_group=19
|
||||||
|
wpa_group_rekey=5
|
Loading…
Reference in New Issue
Block a user