mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 13:59:24 +01:00
auto-t: Add testEAP-PEAP-MSCHAPv2
This commit is contained in:
parent
102a455e00
commit
541c207470
4
autotests/misc/secrets/eap-user-peap-mschapv2.text
Normal file
4
autotests/misc/secrets/eap-user-peap-mschapv2.text
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Phase 1 users
|
||||||
|
* PEAP
|
||||||
|
# Phase 2
|
||||||
|
"domain\User" MSCHAPV2 "Password" [2]
|
69
autotests/testEAP-PEAP-MSCHAPv2/connection_test.py
Normal file
69
autotests/testEAP-PEAP-MSCHAPv2/connection_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
|
||||||
|
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-MSCHAPv2")
|
||||||
|
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):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.validate_connection(wd)
|
||||||
|
except:
|
||||||
|
del wd
|
||||||
|
raise
|
||||||
|
|
||||||
|
del wd
|
||||||
|
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
IWD.copy_to_storage('ssidEAP-PEAP-MSCHAPv2.8021x')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
IWD.clear_storage()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(exit=True)
|
8
autotests/testEAP-PEAP-MSCHAPv2/hw.conf
Normal file
8
autotests/testEAP-PEAP-MSCHAPv2/hw.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[SETUP]
|
||||||
|
num_radios=2
|
||||||
|
start_iwd=0
|
||||||
|
max_test_exec_interval_sec=60
|
||||||
|
tmpfs_extra_stuff=../misc/certs:../misc/secrets
|
||||||
|
|
||||||
|
[HOSTAPD]
|
||||||
|
rad0=ssidEAP-PEAP-MSCHAPv2.conf
|
12
autotests/testEAP-PEAP-MSCHAPv2/ssidEAP-PEAP-MSCHAPv2.8021x
Normal file
12
autotests/testEAP-PEAP-MSCHAPv2/ssidEAP-PEAP-MSCHAPv2.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=MSCHAPV2
|
||||||
|
EAP-PEAP-Phase2-Identity=domain\User
|
||||||
|
EAP-PEAP-Phase2-Password=Password
|
||||||
|
|
||||||
|
[Settings]
|
||||||
|
Autoconnect=false
|
12
autotests/testEAP-PEAP-MSCHAPv2/ssidEAP-PEAP-MSCHAPv2.conf
Normal file
12
autotests/testEAP-PEAP-MSCHAPv2/ssidEAP-PEAP-MSCHAPv2.conf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
hw_mode=g
|
||||||
|
channel=1
|
||||||
|
ssid=ssidEAP-PEAP-MSCHAPv2
|
||||||
|
|
||||||
|
wpa=3
|
||||||
|
wpa_key_mgmt=WPA-EAP
|
||||||
|
ieee8021x=1
|
||||||
|
eap_server=1
|
||||||
|
eap_user_file=/tmp/secrets/eap-user-peap-mschapv2.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