mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-04 11:42:33 +01:00
auto-t: Add WPS test
This commit is contained in:
parent
95079dabab
commit
7c8c2dbb3b
5
autotests/testWPS/hw.conf
Normal file
5
autotests/testWPS/hw.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[SETUP]
|
||||||
|
num_radios=2
|
||||||
|
|
||||||
|
[HOSTAPD]
|
||||||
|
rad0=ssidWPS.conf
|
16
autotests/testWPS/ssidWPS.conf
Normal file
16
autotests/testWPS/ssidWPS.conf
Normal 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
|
42
autotests/testWPS/wps_test.py
Normal file
42
autotests/testWPS/wps_test.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user