3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-26 01:02:35 +01:00

auto-t: add tests for Protected EAP - type 25

This commit is contained in:
Tim Kourt 2018-02-23 16:04:11 -08:00 committed by Denis Kenzior
parent 9783e236a1
commit 2dd84f0114
13 changed files with 301 additions and 0 deletions

View File

@ -0,0 +1,4 @@
# Phase 1 users
* PEAP [ver=0]
# Phase 2
"secure@identity.com" MD5 "testpasswd" [2]

View File

@ -0,0 +1,4 @@
# Phase 1 users
* PEAP [ver=1]
# Phase 2
"secure@identity.com" MD5 "testpasswd" [2]

View File

@ -0,0 +1,2 @@
[EAP]
mtu=100

View File

@ -0,0 +1,10 @@
[SETUP]
num_radios=4
start_iwd=0
max_test_exec_interval_sec=60
tmpfs_extra_stuff=../misc/certs:../misc/secrets:IWD-Frag
[HOSTAPD]
rad0=ssidEAP-PEAPv1.conf
rad1=ssidEAP-PEAPv0.conf
rad2=ssidEAP-PEAP-frag.conf

View 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-PEAP-frag'
wd = IWD(True, '/tmp/IWD-Frag')
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-PEAP-frag.8021x')
@classmethod
def tearDownClass(cls):
IWD.clear_storage()
if __name__ == '__main__':
unittest.main(exit=True)

View 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-PEAPv0'
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-PEAPv0.8021x')
@classmethod
def tearDownClass(cls):
IWD.clear_storage()
if __name__ == '__main__':
unittest.main(exit=True)

View 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'
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.8021x')
@classmethod
def tearDownClass(cls):
IWD.clear_storage()
if __name__ == '__main__':
unittest.main(exit=True)

View 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=MD5
EAP-PEAP-Phase2-Identity=secure@identity.com
EAP-PEAP-Phase2-MD5-Secret=testpasswd
[Settings]
Autoconnect=false

View File

@ -0,0 +1,14 @@
hw_mode=g
channel=1
ssid=ssidEAP-PEAP-frag
fragment_size=256
wpa=3
wpa_key_mgmt=WPA-EAP
ieee8021x=1
eap_server=1
eap_user_file=/tmp/secrets/eap-user-peap-v1.text
ca_cert=/tmp/certs/cert-ca.pem
server_cert=/tmp/certs/cert-server.pem
private_key=/tmp/certs/cert-server-key.pem

View 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=MD5
EAP-PEAP-Phase2-Identity=secure@identity.com
EAP-PEAP-Phase2-MD5-Secret=testpasswd
[Settings]
Autoconnect=false

View File

@ -0,0 +1,12 @@
hw_mode=g
channel=1
ssid=ssidEAP-PEAPv0
wpa=3
wpa_key_mgmt=WPA-EAP
ieee8021x=1
eap_server=1
eap_user_file=/tmp/secrets/eap-user-peap-v0.text
ca_cert=/tmp/certs/cert-ca.pem
server_cert=/tmp/certs/cert-server.pem
private_key=/tmp/certs/cert-server-key.pem

View 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=MD5
EAP-PEAP-Phase2-Identity=secure@identity.com
EAP-PEAP-Phase2-MD5-Secret=testpasswd
[Settings]
Autoconnect=false

View File

@ -0,0 +1,12 @@
hw_mode=g
channel=1
ssid=ssidEAP-PEAPv1
wpa=3
wpa_key_mgmt=WPA-EAP
ieee8021x=1
eap_server=1
eap_user_file=/tmp/secrets/eap-user-peap-v1.text
ca_cert=/tmp/certs/cert-ca.pem
server_cert=/tmp/certs/cert-server.pem
private_key=/tmp/certs/cert-server-key.pem