auto-t: use wait_for_event in testSAE-roam

Depending on timing hostapd may not show a station with list_sta().
Instead use wait_for_event.
This commit is contained in:
James Prestwood 2022-03-28 10:28:36 -07:00 committed by Denis Kenzior
parent 2ee4e95193
commit c852892426
1 changed files with 7 additions and 4 deletions

View File

@ -35,7 +35,8 @@ class Test(unittest.TestCase):
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
self.assertTrue(self.bss_hostapd[0].list_sta())
self.bss_hostapd[0].wait_for_event('AP-STA-CONNECTED %s' % device.address)
self.assertFalse(self.bss_hostapd[1].list_sta())
testutil.test_iface_operstate(device.name)
@ -54,7 +55,7 @@ class Test(unittest.TestCase):
to_condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_change(device, from_condition, to_condition)
self.assertTrue(self.bss_hostapd[1].list_sta())
self.bss_hostapd[1].wait_for_event('AP-STA-CONNECTED %s' % device.address)
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[1].ifname, device.name)
@ -72,8 +73,10 @@ class Test(unittest.TestCase):
condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[2].list_sta())
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
self.bss_hostapd[2].wait_for_event('AP-STA-CONNECTED %s' % device.address)
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[2].ifname, device.name)