commit 00bbc62dfb8ee7a59bc4ba2f4274f2b148f97db5
parent 0a1f6a1d7c6a900862ce8e86a92fedc14a9bfa94
Author: James Prestwood <james.prestwood@linux.intel.com>
Date: Mon, 22 Apr 2019 13:32:02 -0700
auto-t: FILS autotest
Diffstat:
8 files changed, 246 insertions(+), 0 deletions(-)
diff --git a/autotests/testFILS/fils_256_test.py b/autotests/testFILS/fils_256_test.py
@@ -0,0 +1,90 @@
+#!/usr/bin/python3
+
+import unittest
+import sys
+import os
+
+from time import sleep
+
+sys.path.append('../util')
+import iwd
+from iwd import IWD
+from iwd import PSKAgent
+from iwd import NetworkType
+import testutil
+
+class Test(unittest.TestCase):
+ def test_connection_success(self):
+ wd = IWD(True)
+
+ psk_agent = PSKAgent('user@example.com', ('user@example.com',
+ 'secret123'))
+ wd.register_psk_agent(psk_agent)
+
+ devices = wd.list_devices(1)
+ 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_network = device.get_ordered_network('ssidFILS-256')
+
+ 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)
+
+ testutil.test_iface_operstate()
+ testutil.test_ifaces_connected()
+
+ device.disconnect()
+
+ condition = 'not obj.connected'
+ wd.wait_for_object_condition(ordered_network.network_object, condition)
+
+ ordered_network = device.get_ordered_network('ssidFILS-256')
+
+ 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)
+
+ testutil.test_iface_operstate()
+ testutil.test_ifaces_connected()
+
+ sleep(5)
+
+ testutil.test_iface_operstate()
+ testutil.test_ifaces_connected()
+
+ device.disconnect()
+
+ wd.unregister_psk_agent(psk_agent)
+
+ @classmethod
+ def setUpClass(cls):
+ IWD.copy_to_storage('ssidFILS-256.8021x')
+ os.system('ifconfig lo up')
+ pass
+
+ @classmethod
+ def tearDownClass(cls):
+ IWD.clear_storage()
+
+if __name__ == '__main__':
+ unittest.main(exit=True)
diff --git a/autotests/testFILS/fils_384_test.py b/autotests/testFILS/fils_384_test.py
@@ -0,0 +1,90 @@
+#!/usr/bin/python3
+
+import unittest
+import sys
+import os
+
+from time import sleep
+
+sys.path.append('../util')
+import iwd
+from iwd import IWD
+from iwd import PSKAgent
+from iwd import NetworkType
+import testutil
+
+class Test(unittest.TestCase):
+ def test_connection_success(self):
+ wd = IWD(True)
+
+ psk_agent = PSKAgent('user@example.com', ('user@example.com',
+ 'secret123'))
+ wd.register_psk_agent(psk_agent)
+
+ devices = wd.list_devices(1)
+ 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_network = device.get_ordered_network('ssidFILS-384')
+
+ 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)
+
+ testutil.test_iface_operstate()
+ testutil.test_ifaces_connected()
+
+ device.disconnect()
+
+ condition = 'not obj.connected'
+ wd.wait_for_object_condition(ordered_network.network_object, condition)
+
+ ordered_network = device.get_ordered_network('ssidFILS-384')
+
+ 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)
+
+ testutil.test_iface_operstate()
+ testutil.test_ifaces_connected()
+
+ sleep(5)
+
+ testutil.test_iface_operstate()
+ testutil.test_ifaces_connected()
+
+ device.disconnect()
+
+ wd.unregister_psk_agent(psk_agent)
+
+ @classmethod
+ def setUpClass(cls):
+ IWD.copy_to_storage('ssidFILS-384.8021x')
+ os.system('ifconfig lo up')
+ pass
+
+ @classmethod
+ def tearDownClass(cls):
+ IWD.clear_storage()
+
+if __name__ == '__main__':
+ unittest.main(exit=True)
diff --git a/autotests/testFILS/hw.conf b/autotests/testFILS/hw.conf
@@ -0,0 +1,9 @@
+[SETUP]
+num_radios=3
+max_test_exec_interval_sec=45
+tmpfs_extra_stuff=../misc/secrets:pwd.eap_user:../misc/certs
+start_iwd=0
+
+[HOSTAPD]
+rad0=ssidFILS-256.conf
+rad1=ssidFILS-384.conf
diff --git a/autotests/testFILS/pwd.eap_user b/autotests/testFILS/pwd.eap_user
@@ -0,0 +1 @@
+"user@example.com" PWD "secret123"
diff --git a/autotests/testFILS/ssidFILS-256.8021x b/autotests/testFILS/ssidFILS-256.8021x
@@ -0,0 +1,2 @@
+[Security]
+EAP-Method=PWD
diff --git a/autotests/testFILS/ssidFILS-256.conf b/autotests/testFILS/ssidFILS-256.conf
@@ -0,0 +1,27 @@
+hw_mode=g
+channel=1
+ssid=ssidFILS-256
+wpa=2
+wpa_key_mgmt=FILS-SHA256 WPA-EAP
+rsn_pairwise=CCMP
+group_cipher=CCMP
+ieee8021x=1
+ieee80211w=2
+
+auth_server_addr=127.0.0.1
+auth_server_port=1812
+auth_server_shared_secret=secret
+nas_identifier=nas.w1.fi
+
+erp_send_reauth_start=1
+erp_domain=example.com
+fils_realm=example.com
+disable_pmksa_caching=1
+
+radius_server_clients=/tmp/certs/radius-clients.text
+radius_server_auth_port=1812
+eap_server=0
+eap_user_file=/tmp/pwd.eap_user
+eap_server_erp=1
+pwd_group=19
+wpa_group_rekey=5
diff --git a/autotests/testFILS/ssidFILS-384.8021x b/autotests/testFILS/ssidFILS-384.8021x
@@ -0,0 +1,2 @@
+[Security]
+EAP-Method=PWD
diff --git a/autotests/testFILS/ssidFILS-384.conf b/autotests/testFILS/ssidFILS-384.conf
@@ -0,0 +1,25 @@
+hw_mode=g
+channel=1
+ssid=ssidFILS-384
+wpa=2
+wpa_key_mgmt=FILS-SHA384 WPA-EAP
+rsn_pairwise=CCMP
+group_cipher=CCMP
+ieee8021x=1
+ieee80211w=2
+
+auth_server_addr=127.0.0.1
+auth_server_port=1812
+auth_server_shared_secret=secret
+nas_identifier=nas.w1.fi
+
+erp_send_reauth_start=1
+erp_domain=example.com
+fils_realm=example.com
+disable_pmksa_caching=1
+
+eap_server=0
+eap_user_file=/tmp/pwd.eap_user
+eap_server_erp=1
+pwd_group=19
+wpa_group_rekey=5