3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-19 11:09:25 +01:00

auto-t: Add WPS test

This commit is contained in:
Tim Kourt 2016-10-04 16:44:28 -07:00 committed by Denis Kenzior
parent 95079dabab
commit 7c8c2dbb3b
3 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,5 @@
[SETUP]
num_radios=2
[HOSTAPD]
rad0=ssidWPS.conf

View File

@ -0,0 +1,16 @@
hw_mode=g
channel=1
ssid=ssidWPS
eap_server=1
wps_state=2
ap_setup_locked=1
config_methods=virtual_push_button
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_passphrase=secret123
ctrl_interface=/var/run/hostapd

View File

@ -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)