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:
James Prestwood 2019-10-28 12:52:01 -07:00 committed by Denis Kenzior
parent 14df50a0ab
commit 4fcb6c3cc6
4 changed files with 6 additions and 8 deletions

View File

@ -9,23 +9,18 @@ from iwd import IWD
from iwd import PSKAgent
from iwd import NetworkType
import testutil
import hostapd
from hostapd import HostapdCLI
class Test(unittest.TestCase):
def do_test_connection_success(self, ssid, passphrase=None):
hapd = HostapdCLI(config=ssid + '.conf')
wd = IWD()
if passphrase:
psk_agent = PSKAgent(passphrase)
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)
device = devices[0]
@ -52,7 +47,7 @@ class Test(unittest.TestCase):
wd.wait_for_object_condition(ordered_network.network_object, condition)
testutil.test_iface_operstate()
testutil.test_ifaces_connected(hostapd_ifname, device.name)
testutil.test_ifaces_connected(hapd.ifname, device.name)
device.disconnect()

View File

@ -1,3 +1,4 @@
ctrl_interface=/var/run/hostapd
hw_mode=g
channel=1
ssid=ssidEAP-TLS

View File

@ -1,3 +1,4 @@
ctrl_interface=/var/run/hostapd
hw_mode=g
channel=2
ssid=ssidEAP-TLS2

View File

@ -1,3 +1,4 @@
ctrl_interface=/var/run/hostapd
hw_mode=g
channel=3
ssid=ssidEAP-TLS3