diff --git a/autotests/testEAP-WPS-Frag/hw.conf b/autotests/testEAP-WPS-Frag/hw.conf new file mode 100644 index 00000000..53bd3ac9 --- /dev/null +++ b/autotests/testEAP-WPS-Frag/hw.conf @@ -0,0 +1,7 @@ +[SETUP] +num_radios=2 +tmpfs_extra_stuff=iwd.conf +iwd_config_dir=/tmp + +[HOSTAPD] +rad0=ssid-wps-small-mtu.conf diff --git a/autotests/testEAP-WPS-Frag/iwd.conf b/autotests/testEAP-WPS-Frag/iwd.conf new file mode 100644 index 00000000..bdc86869 --- /dev/null +++ b/autotests/testEAP-WPS-Frag/iwd.conf @@ -0,0 +1,2 @@ +[EAP] +mtu=100 diff --git a/autotests/testEAP-WPS-Frag/ssid-wps-small-mtu.conf b/autotests/testEAP-WPS-Frag/ssid-wps-small-mtu.conf new file mode 100644 index 00000000..da503095 --- /dev/null +++ b/autotests/testEAP-WPS-Frag/ssid-wps-small-mtu.conf @@ -0,0 +1,17 @@ +hw_mode=g +channel=1 +ssid=ssidWPS-Frag + +eap_server=1 + +wps_state=2 +ap_setup_locked=1 +config_methods=virtual_push_button +fragment_size=100 + +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=CCMP +wpa_passphrase=secret123 + +ctrl_interface=/var/run/hostapd diff --git a/autotests/testEAP-WPS-Frag/wps_frag_test.py b/autotests/testEAP-WPS-Frag/wps_frag_test.py new file mode 100644 index 00000000..889d745e --- /dev/null +++ b/autotests/testEAP-WPS-Frag/wps_frag_test.py @@ -0,0 +1,42 @@ +#!/usr/bin/python3 + +import unittest +import sys + +sys.path.append('../util') +import iwd +from iwd import IWD +from iwd import DeviceState + +from hostapd import HostapdCLI + +class Test(unittest.TestCase): + + def test_push_button_success(self): + wd = IWD() + + devices = wd.list_devices(); + self.assertIsNotNone(devices) + device = devices[0] + + device.wps_push_button() + + condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_condition(device, condition) + + device.disconnect() + + condition = 'obj.state == DeviceState.disconnected' + wd.wait_for_object_condition(device, condition) + + + @classmethod + def setUpClass(cls): + HostapdCLI.wps_push_button() + + @classmethod + def tearDownClass(cls): + IWD.clear_storage() + +if __name__ == '__main__': + unittest.main(exit=True)