3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

auto-t: Add testEAP-PEAP-SIM

This commit is contained in:
Tim Kourt 2018-05-15 11:43:14 -07:00 committed by Denis Kenzior
parent 541c207470
commit 2608dcae6f
8 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,4 @@
# Phase 1 users
* PEAP
# Phase 2
"132010000000000@example.com" SIM [2]

View File

@ -0,0 +1,70 @@
#!/usr/bin/python3
import unittest
import sys
import time
sys.path.append('../util')
import iwd
from iwd import IWD
from iwd import NetworkType
from hlrauc import AuthCenter
class Test(unittest.TestCase):
def validate_connection(self, wd):
devices = wd.list_devices(True);
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-PEAP-SIM")
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)
def test_connection_success(self):
auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
wd = IWD(True)
try:
self.validate_connection(wd)
except:
del wd
auth.stop()
raise
del wd
auth.stop()
@classmethod
def setUpClass(cls):
IWD.copy_to_storage('ssidEAP-PEAP-SIM.8021x')
@classmethod
def tearDownClass(cls):
IWD.clear_storage()
if __name__ == '__main__':
unittest.main(exit=True)

View File

@ -0,0 +1,9 @@
[SETUP]
num_radios=2
start_iwd=0
max_test_exec_interval_sec=60
tmpfs_extra_stuff=sim.eap_user:sim.db:sim_keys.conf:../misc/certs:../misc/secrets
sim_keys=/tmp/sim_keys.conf
[HOSTAPD]
rad0=ssidEAP-PEAP-SIM.conf

View File

@ -0,0 +1 @@
32010000000000:D0D1D2D3D4D5D6D7:E1E2E3E4:DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

View File

@ -0,0 +1 @@
"132010000000000@example.com" SIM

View File

@ -0,0 +1,4 @@
[SIM]
Identity=32010000000000@example.com
Kc=d0d1d2d3d4d5d6d7d0d1d2d3d4d5d6d7d0d1d2d3d4d5d6d7
SRES=e1e2e3e4e1e2e3e4e1e2e3e4

View File

@ -0,0 +1,10 @@
[Security]
EAP-Method=PEAP
EAP-Identity=open@example.com
EAP-PEAP-CACert=/tmp/certs/cert-ca.pem
EAP-PEAP-ClientCert=/tmp/certs/cert-client.pem
EAP-PEAP-ClientKey=/tmp/certs/cert-client-key-pkcs8.pem
EAP-PEAP-Phase2-Method=SIM
[Settings]
Autoconnect=false

View File

@ -0,0 +1,15 @@
hw_mode=g
channel=1
ssid=ssidEAP-PEAP-SIM
wpa=3
wpa_key_mgmt=WPA-EAP
ieee8021x=1
eap_server=1
eap_user_file=/tmp/secrets/eap-user-peap-sim.text
ca_cert=/tmp/certs/cert-ca.pem
server_cert=/tmp/certs/cert-server.pem
private_key=/tmp/certs/cert-server-key.pem
eap_sim_db=unix:/tmp/hlrauc.sock
eap_sim_aka_result_ind=1