mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 17:59:25 +01:00
auto-t: add OWE autotest
This commit is contained in:
parent
53db703773
commit
373d78dacb
59
autotests/testOWE/connection_test.py
Normal file
59
autotests/testOWE/connection_test.py
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.path.append('../util')
|
||||||
|
import iwd
|
||||||
|
from iwd import IWD
|
||||||
|
from iwd import NetworkType
|
||||||
|
import testutil
|
||||||
|
|
||||||
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_connection_success(self):
|
||||||
|
wd = IWD()
|
||||||
|
|
||||||
|
devices = wd.list_devices(1)
|
||||||
|
device = devices[0]
|
||||||
|
|
||||||
|
condition = 'not obj.scanning'
|
||||||
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
|
device.scan()
|
||||||
|
|
||||||
|
condition = 'not obj.scanning'
|
||||||
|
wd.wait_for_object_condition(device, condition)
|
||||||
|
|
||||||
|
ordered_networks = device.get_ordered_networks()
|
||||||
|
ordered_network = ordered_networks[0]
|
||||||
|
|
||||||
|
self.assertEqual(ordered_network.name, "ssidOWE")
|
||||||
|
self.assertEqual(ordered_network.type, NetworkType.open)
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
ordered_network.network_object.connect()
|
||||||
|
|
||||||
|
condition = 'obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
testutil.test_iface_operstate()
|
||||||
|
testutil.test_ifaces_connected()
|
||||||
|
|
||||||
|
device.disconnect()
|
||||||
|
|
||||||
|
condition = 'not obj.connected'
|
||||||
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
IWD.clear_storage()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(exit=True)
|
5
autotests/testOWE/hw.conf
Normal file
5
autotests/testOWE/hw.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[SETUP]
|
||||||
|
num_radios=2
|
||||||
|
|
||||||
|
[HOSTAPD]
|
||||||
|
rad0=ssidOWE.conf
|
6
autotests/testOWE/ssidOWE.conf
Normal file
6
autotests/testOWE/ssidOWE.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
hw_mode=g
|
||||||
|
channel=1
|
||||||
|
ssid=ssidOWE
|
||||||
|
wpa=2
|
||||||
|
wpa_key_mgmt=OWE
|
||||||
|
rsn_pairwise=CCMP
|
Loading…
Reference in New Issue
Block a user