mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-05-07 18:57:27 +02:00
autotest: Added autotest for EAP-AKA'
This commit is contained in:
parent
1c34452a7b
commit
a0cde90814
61
autotests/testEAP-AKA-prime/connection_test.py
Normal file
61
autotests/testEAP-AKA-prime/connection_test.py
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.path.append('../util')
|
||||||
|
import iwd
|
||||||
|
from iwd import IWD
|
||||||
|
from iwd import PSKAgent
|
||||||
|
from iwd import NetworkType
|
||||||
|
from hlrauc import AuthCenter
|
||||||
|
|
||||||
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_connection_success(self):
|
||||||
|
auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
|
||||||
|
|
||||||
|
wd = IWD()
|
||||||
|
|
||||||
|
devices = wd.list_devices();
|
||||||
|
self.assertIsNotNone(devices)
|
||||||
|
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_networks = device.get_ordered_networks()
|
||||||
|
ordered_network = ordered_networks[0]
|
||||||
|
|
||||||
|
self.assertEqual(ordered_network.name, "ssidEAP-AKA")
|
||||||
|
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)
|
||||||
|
|
||||||
|
device.disconnect()
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
auth.stop()
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
IWD.copy_to_storage('ssidEAP-AKA.8021x')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
IWD.clear_storage()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(exit=True)
|
7
autotests/testEAP-AKA-prime/hw.conf
Normal file
7
autotests/testEAP-AKA-prime/hw.conf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[SETUP]
|
||||||
|
num_radios=2
|
||||||
|
max_test_exec_interval_sec=40
|
||||||
|
tmpfs_extra_stuff=sim.eap_user:sim.db
|
||||||
|
|
||||||
|
[HOSTAPD]
|
||||||
|
rad0=ssidEAP-AKA.conf
|
1
autotests/testEAP-AKA-prime/sim.db
Normal file
1
autotests/testEAP-AKA-prime/sim.db
Normal file
@ -0,0 +1 @@
|
|||||||
|
32010000000000:90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82581:61df:000000000021
|
1
autotests/testEAP-AKA-prime/sim.eap_user
Normal file
1
autotests/testEAP-AKA-prime/sim.eap_user
Normal file
@ -0,0 +1 @@
|
|||||||
|
"abc@example.com" AKA'
|
8
autotests/testEAP-AKA-prime/ssidEAP-AKA.8021x
Normal file
8
autotests/testEAP-AKA-prime/ssidEAP-AKA.8021x
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[Security]
|
||||||
|
EAP-Method=AKA'
|
||||||
|
EAP-Identity=abc@example.com
|
||||||
|
EAP-AKA-IMSI=632010000000000@example.com
|
||||||
|
EAP-AKA-KI=90dca4eda45b53cf0f12d7c9c3bc6a89
|
||||||
|
EAP-AKA-OPC=cb9cccc4b9258e6dca4760379fb82581
|
||||||
|
EAP-AKA-AMF=61df
|
||||||
|
EAP-AKA-SQN=000000000021
|
16
autotests/testEAP-AKA-prime/ssidEAP-AKA.conf
Normal file
16
autotests/testEAP-AKA-prime/ssidEAP-AKA.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
hw_mode=g
|
||||||
|
channel=1
|
||||||
|
|
||||||
|
driver=nl80211
|
||||||
|
ieee8021x=1
|
||||||
|
eap_server=1
|
||||||
|
ssid=ssidEAP-AKA
|
||||||
|
eap_user_file=/tmp/sim.eap_user
|
||||||
|
eap_sim_db=unix:/tmp/hlrauc.sock
|
||||||
|
wpa=2
|
||||||
|
wpa_key_mgmt=WPA-EAP
|
||||||
|
wpa_pairwise=TKIP CCMP
|
||||||
|
rsn_pairwise=CCMP TKIP
|
||||||
|
wpa_passphrase=secret123
|
||||||
|
channel=1
|
||||||
|
eap_sim_aka_result_ind=1
|
Loading…
x
Reference in New Issue
Block a user