3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 05:39:24 +01:00

auto-t: added reauth to connection test

Both EAP-SIM and EAP-AKA will now attempt a reauth after the
connection to exercise reset_state.
This commit is contained in:
James Prestwood 2018-06-11 11:25:28 -07:00 committed by Denis Kenzior
parent 96374f47e5
commit e2ac29b492
2 changed files with 38 additions and 0 deletions

View File

@ -9,9 +9,22 @@ from iwd import IWD
from iwd import NetworkType
from hlrauc import AuthCenter
from hostapd import HostapdCLI
from hostapd import hostapd_map
class Test(unittest.TestCase):
def test_connection_success(self):
hostapd = None
for hostapd_if in list(hostapd_map.values()):
hpd = HostapdCLI(hostapd_if)
if hpd.get_config_value('ssid') == 'ssidEAP-AKA':
hostapd = hpd
break
self.assertIsNotNone(hostapd)
auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
wd = IWD()
@ -46,6 +59,13 @@ class Test(unittest.TestCase):
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
hostapd.eapol_reauth(device.address)
wd.wait(10)
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
device.disconnect()
condition = 'not obj.connected'

View File

@ -9,9 +9,20 @@ from iwd import IWD
from iwd import NetworkType
from hlrauc import AuthCenter
from hostapd import HostapdCLI
from hostapd import hostapd_map
class Test(unittest.TestCase):
def test_connection_success(self):
hostapd = None
for hostapd_if in list(hostapd_map.values()):
hpd = HostapdCLI(hostapd_if)
if hpd.get_config_value('ssid') == 'ssidEAP-SIM':
hostapd = hpd
break
auth = AuthCenter('/tmp/hlrauc.sock', '/tmp/sim.db')
wd = IWD()
@ -46,6 +57,13 @@ class Test(unittest.TestCase):
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
hostapd.eapol_reauth(device.address)
wd.wait(10)
condition = 'obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
device.disconnect()
condition = 'not obj.connected'