mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 01:19:23 +01:00
auto-t: test AP mode using TKIP
This limits all supported ciphers to TKIP and verifies the AP starts and can authenticate clients.
This commit is contained in:
parent
81e48eaba5
commit
4af66b8cac
@ -5,17 +5,42 @@ import sys
|
|||||||
|
|
||||||
sys.path.append('../util')
|
sys.path.append('../util')
|
||||||
import iwd
|
import iwd
|
||||||
from iwd import IWD
|
from iwd import IWD, NetworkType, PSKAgent
|
||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
def test_connection_success(self):
|
def test_no_ap_mode(self):
|
||||||
wd = IWD()
|
wd = IWD(True)
|
||||||
|
|
||||||
dev = wd.list_devices(1)[0]
|
dev = wd.list_devices(1)[0]
|
||||||
|
|
||||||
with self.assertRaises(iwd.NotSupportedEx):
|
with self.assertRaises(iwd.NotSupportedEx):
|
||||||
dev.start_ap('TestAP2', 'Password2')
|
dev.start_ap('TestAP2', 'Password2')
|
||||||
|
|
||||||
|
def test_only_tkip_support(self):
|
||||||
|
wd = IWD(True)
|
||||||
|
|
||||||
|
devices = wd.list_devices(2)
|
||||||
|
|
||||||
|
dev_sta = devices[0]
|
||||||
|
dev_ap = devices[1]
|
||||||
|
|
||||||
|
dev_ap.start_ap('TestAP2', 'Password2')
|
||||||
|
|
||||||
|
ordered_network = dev_sta.get_ordered_network('TestAP2')
|
||||||
|
|
||||||
|
if ordered_network.type != NetworkType.psk:
|
||||||
|
raise Exception("Network type mismatch")
|
||||||
|
|
||||||
|
psk_agent = PSKAgent('Password2')
|
||||||
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
|
ordered_network.network_object.connect()
|
||||||
|
|
||||||
|
condition = 'obj.state == DeviceState.connected'
|
||||||
|
wd.wait_for_object_condition(dev_sta, condition)
|
||||||
|
|
||||||
|
wd.unregister_psk_agent(psk_agent)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
pass
|
pass
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
[SETUP]
|
[SETUP]
|
||||||
num_radios=1
|
num_radios=2
|
||||||
radio_confs=rad0
|
start_iwd=0
|
||||||
|
|
||||||
[rad0]
|
[rad0]
|
||||||
iftype_disable=ap
|
iftype_disable=ap
|
||||||
|
|
||||||
|
[rad1]
|
||||||
|
cipher_disable=ccmp,bip_cmac,gcmp,gcmp_256,ccmp_256,bip_gmac.bip_gmac_256,bip_cmac_256
|
||||||
|
Loading…
Reference in New Issue
Block a user