From 2527f79670acc92ed9e0edcd296303a568df2ff5 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 24 Sep 2018 12:03:12 -0500 Subject: [PATCH] auto-t: Add WPS tests for StartPin method This adds two additional test scenarios (using 4 digit and 8 digit PINs) for testing the StartPin method of the WiFiSimpleConfiguration interface. --- autotests/testEAP-WPS/hw.conf | 1 + autotests/testEAP-WPS/wps_test.py | 39 +++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/autotests/testEAP-WPS/hw.conf b/autotests/testEAP-WPS/hw.conf index fe4e1eb4..0c12f181 100644 --- a/autotests/testEAP-WPS/hw.conf +++ b/autotests/testEAP-WPS/hw.conf @@ -1,5 +1,6 @@ [SETUP] num_radios=2 +max_test_exec_interval_sec=40 [HOSTAPD] rad0=ssidWPS.conf diff --git a/autotests/testEAP-WPS/wps_test.py b/autotests/testEAP-WPS/wps_test.py index a285f340..16e41111 100644 --- a/autotests/testEAP-WPS/wps_test.py +++ b/autotests/testEAP-WPS/wps_test.py @@ -14,6 +14,8 @@ from hostapd import hostapd_map class Test(unittest.TestCase): def test_push_button_success(self): + self.hostapd.wps_push_button() + wd = IWD() devices = wd.list_devices(1); @@ -29,14 +31,47 @@ class Test(unittest.TestCase): condition = 'obj.state == DeviceState.disconnected' wd.wait_for_object_condition(device, condition) + def test_pin_success(self): + wd = IWD() + + devices = wd.list_devices(1); + device = devices[0] + pin = device.wps_generate_pin() + self.hostapd.wps_pin(pin) + + device.wps_start_pin(pin) + + 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) + + def test_4_digit_pin_success(self): + wd = IWD() + + devices = wd.list_devices(1); + device = devices[0] + pin = '1234' + self.hostapd.wps_pin(pin) + + device.wps_start_pin(pin) + + 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): cls.hostapd_if = list(hostapd_map.values())[0] cls.hostapd = HostapdCLI(cls.hostapd_if) - cls.hostapd.wps_push_button() - @classmethod def tearDownClass(cls): IWD.clear_storage()