mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
auto-t: add EAP-GTC autotest
This commit is contained in:
parent
c0739c1965
commit
7c77bf33c7
4
autotests/testEAP-GTC/eap-user-peap-gtc.text
Normal file
4
autotests/testEAP-GTC/eap-user-peap-gtc.text
Normal file
@ -0,0 +1,4 @@
|
||||
# Phase 1 users
|
||||
* PEAP [ver=1]
|
||||
# Phase 2
|
||||
"secure@identity.com" GTC "testpasswd" [2]
|
8
autotests/testEAP-GTC/hw.conf
Normal file
8
autotests/testEAP-GTC/hw.conf
Normal file
@ -0,0 +1,8 @@
|
||||
[SETUP]
|
||||
num_radios=3
|
||||
start_iwd=1
|
||||
max_test_exec_interval_sec=60
|
||||
tmpfs_extra_stuff=../misc/certs:eap-user-peap-gtc.text
|
||||
|
||||
[HOSTAPD]
|
||||
rad0=ssidEAP-PEAPv1-GTC.conf
|
69
autotests/testEAP-GTC/peap_gtc_test.py
Normal file
69
autotests/testEAP-GTC/peap_gtc_test.py
Normal file
@ -0,0 +1,69 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import unittest
|
||||
import sys
|
||||
import time
|
||||
|
||||
sys.path.append('../util')
|
||||
import iwd
|
||||
from iwd import IWD
|
||||
from iwd import NetworkType
|
||||
|
||||
class Test(unittest.TestCase):
|
||||
|
||||
def test_connection_success(self):
|
||||
ssid_to_connect = 'ssidEAP-PEAPv1-GTC'
|
||||
|
||||
wd = IWD(True)
|
||||
wd.wait(1)
|
||||
|
||||
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 = None
|
||||
|
||||
for o_n in ordered_networks:
|
||||
if o_n.name == ssid_to_connect:
|
||||
ordered_network = o_n
|
||||
break
|
||||
|
||||
self.assertEqual(ordered_network.name, ssid_to_connect)
|
||||
|
||||
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)
|
||||
|
||||
del wd
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
IWD.copy_to_storage('ssidEAP-PEAPv1-GTC.8021x')
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
IWD.clear_storage()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(exit=True)
|
12
autotests/testEAP-GTC/ssidEAP-PEAPv1-GTC.8021x
Normal file
12
autotests/testEAP-GTC/ssidEAP-PEAPv1-GTC.8021x
Normal file
@ -0,0 +1,12 @@
|
||||
[Security]
|
||||
EAP-Method=PEAP
|
||||
EAP-Identity=open@identity.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=GTC
|
||||
EAP-PEAP-Phase2-Identity=secure@identity.com
|
||||
EAP-PEAP-Phase2-GTC-Secret=testpasswd
|
||||
|
||||
[Settings]
|
||||
Autoconnect=false
|
12
autotests/testEAP-GTC/ssidEAP-PEAPv1-GTC.conf
Normal file
12
autotests/testEAP-GTC/ssidEAP-PEAPv1-GTC.conf
Normal file
@ -0,0 +1,12 @@
|
||||
hw_mode=g
|
||||
channel=1
|
||||
ssid=ssidEAP-PEAPv1-GTC
|
||||
|
||||
wpa=3
|
||||
wpa_key_mgmt=WPA-EAP
|
||||
ieee8021x=1
|
||||
eap_server=1
|
||||
eap_user_file=/tmp/eap-user-peap-gtc.text
|
||||
ca_cert=/tmp/certs/cert-ca.pem
|
||||
server_cert=/tmp/certs/cert-server.pem
|
||||
private_key=/tmp/certs/cert-server-key.pem
|
Loading…
Reference in New Issue
Block a user