mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 15:20:42 +01:00
auto-t: update testEAP-TLS to use HostapdCLI
This test did not use the updated HostapdCLI where you can specify a config file rather than iterate hostapd list.
This commit is contained in:
parent
14df50a0ab
commit
4fcb6c3cc6
@ -9,23 +9,18 @@ from iwd import IWD
|
|||||||
from iwd import PSKAgent
|
from iwd import PSKAgent
|
||||||
from iwd import NetworkType
|
from iwd import NetworkType
|
||||||
import testutil
|
import testutil
|
||||||
import hostapd
|
from hostapd import HostapdCLI
|
||||||
|
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
|
|
||||||
def do_test_connection_success(self, ssid, passphrase=None):
|
def do_test_connection_success(self, ssid, passphrase=None):
|
||||||
|
hapd = HostapdCLI(config=ssid + '.conf')
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
if passphrase:
|
if passphrase:
|
||||||
psk_agent = PSKAgent(passphrase)
|
psk_agent = PSKAgent(passphrase)
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
hostapd_ifname = None
|
|
||||||
for ifname in hostapd.hostapd_map:
|
|
||||||
if ssid + '.conf' in hostapd.hostapd_map[ifname].config:
|
|
||||||
hostapd_ifname = ifname
|
|
||||||
break
|
|
||||||
|
|
||||||
devices = wd.list_devices(1)
|
devices = wd.list_devices(1)
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
@ -52,7 +47,7 @@ class Test(unittest.TestCase):
|
|||||||
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
wd.wait_for_object_condition(ordered_network.network_object, condition)
|
||||||
|
|
||||||
testutil.test_iface_operstate()
|
testutil.test_iface_operstate()
|
||||||
testutil.test_ifaces_connected(hostapd_ifname, device.name)
|
testutil.test_ifaces_connected(hapd.ifname, device.name)
|
||||||
|
|
||||||
device.disconnect()
|
device.disconnect()
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
ctrl_interface=/var/run/hostapd
|
||||||
hw_mode=g
|
hw_mode=g
|
||||||
channel=1
|
channel=1
|
||||||
ssid=ssidEAP-TLS
|
ssid=ssidEAP-TLS
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
ctrl_interface=/var/run/hostapd
|
||||||
hw_mode=g
|
hw_mode=g
|
||||||
channel=2
|
channel=2
|
||||||
ssid=ssidEAP-TLS2
|
ssid=ssidEAP-TLS2
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
ctrl_interface=/var/run/hostapd
|
||||||
hw_mode=g
|
hw_mode=g
|
||||||
channel=3
|
channel=3
|
||||||
ssid=ssidEAP-TLS3
|
ssid=ssidEAP-TLS3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user