From df0b64f8d082efba1a2450e223827ec16d56a008 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 17 Sep 2020 14:32:47 -0700 Subject: [PATCH] auto-t: add EAD autotest --- autotests/testEAD/connection_test.py | 35 ++++++++++++++++++++++++++++ autotests/testEAD/default.8021x | 7 ++++++ autotests/testEAD/hw.conf | 6 +++++ autotests/testEAD/wired.conf | 17 ++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 autotests/testEAD/connection_test.py create mode 100644 autotests/testEAD/default.8021x create mode 100644 autotests/testEAD/hw.conf create mode 100644 autotests/testEAD/wired.conf diff --git a/autotests/testEAD/connection_test.py b/autotests/testEAD/connection_test.py new file mode 100644 index 00000000..c51d7237 --- /dev/null +++ b/autotests/testEAD/connection_test.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3 + +import unittest +import sys + +sys.path.append('../util') +from iwd import IWD +from config import ctx + +from ead import EAD + +class Test(unittest.TestCase): + def test_connection_success(self): + ctx.start_process(['ead', '-i', 'eth1', '-d']) + + ead = EAD() + + adapter = ead.list_adapters(1)[0] + + condition = 'obj.connected == True' + ead.wait_for_object_condition(adapter, condition) + + condition = 'obj.authenticated == True' + ead.wait_for_object_condition(adapter, condition) + + @classmethod + def setUpClass(cls): + IWD.copy_to_storage('default.8021x', storage_dir='/var/lib/ead') + + @classmethod + def tearDownClass(cls): + IWD.clear_storage() + +if __name__ == '__main__': + unittest.main(exit=True) diff --git a/autotests/testEAD/default.8021x b/autotests/testEAD/default.8021x new file mode 100644 index 00000000..55eb431d --- /dev/null +++ b/autotests/testEAD/default.8021x @@ -0,0 +1,7 @@ +[Security] +EAP-Method=MSCHAPV2 +EAP-Identity=domain\\User +EAP-Password=Password + +[Settings] +AutoConnect=false diff --git a/autotests/testEAD/hw.conf b/autotests/testEAD/hw.conf new file mode 100644 index 00000000..dee31f9e --- /dev/null +++ b/autotests/testEAD/hw.conf @@ -0,0 +1,6 @@ +[SETUP] +num_radios=0 +start_iwd=0 + +[HOSTAPD] +radius_server=wired.conf diff --git a/autotests/testEAD/wired.conf b/autotests/testEAD/wired.conf new file mode 100644 index 00000000..9e6ef638 --- /dev/null +++ b/autotests/testEAD/wired.conf @@ -0,0 +1,17 @@ +interface=eth0 +driver=wired +logger_stdout=-1 +logger_stdout_level=1 + +ieee8021x=1 +eap_reauth_period=3600 + +use_pae_group_addr=1 + +nas_identifier=ap.example.com + +radius_server_clients=/tmp/certs/radius-clients.text +radius_server_auth_port=1812 + +eap_user_file=/tmp/secrets/eap-user-mschapv2.text +eap_server=1