mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 18:59:22 +01:00
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.
This commit is contained in:
parent
332d4f8e61
commit
2527f79670
@ -1,5 +1,6 @@
|
|||||||
[SETUP]
|
[SETUP]
|
||||||
num_radios=2
|
num_radios=2
|
||||||
|
max_test_exec_interval_sec=40
|
||||||
|
|
||||||
[HOSTAPD]
|
[HOSTAPD]
|
||||||
rad0=ssidWPS.conf
|
rad0=ssidWPS.conf
|
||||||
|
@ -14,6 +14,8 @@ from hostapd import hostapd_map
|
|||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_push_button_success(self):
|
def test_push_button_success(self):
|
||||||
|
self.hostapd.wps_push_button()
|
||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices(1);
|
devices = wd.list_devices(1);
|
||||||
@ -29,14 +31,47 @@ class Test(unittest.TestCase):
|
|||||||
condition = 'obj.state == DeviceState.disconnected'
|
condition = 'obj.state == DeviceState.disconnected'
|
||||||
wd.wait_for_object_condition(device, condition)
|
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
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.hostapd_if = list(hostapd_map.values())[0]
|
cls.hostapd_if = list(hostapd_map.values())[0]
|
||||||
cls.hostapd = HostapdCLI(cls.hostapd_if)
|
cls.hostapd = HostapdCLI(cls.hostapd_if)
|
||||||
|
|
||||||
cls.hostapd.wps_push_button()
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
IWD.clear_storage()
|
IWD.clear_storage()
|
||||||
|
Loading…
Reference in New Issue
Block a user