From f85fcf2f21fa1961d33cdc59c065f9b40327d1d5 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 14 Jul 2020 11:49:08 -0700 Subject: [PATCH] auto-t: make testSAQuery more reliable First, looking for DeviceState.connected gives a much better indication if we are actually connected vs the connected property on the network object. Second, its good practice to also check that hostapd sees that the station is connected. --- autotests/testSAQuery/connection_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autotests/testSAQuery/connection_test.py b/autotests/testSAQuery/connection_test.py index 13c45ee9..de0fe2cd 100644 --- a/autotests/testSAQuery/connection_test.py +++ b/autotests/testSAQuery/connection_test.py @@ -13,7 +13,7 @@ from hostapd import HostapdCLI, hostapd_map class Test(unittest.TestCase): def test_connection_success(self): - hostapd = HostapdCLI(list(hostapd_map.values())[0]) + hostapd = HostapdCLI(config='ssidCCMP.conf') wd = IWD() @@ -53,8 +53,10 @@ class Test(unittest.TestCase): # IWD should now try and re-connect to the AP - condition = 'obj.connected' - wd.wait_for_object_condition(ordered_network.network_object, condition) + condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_condition(device, condition) + + hostapd.wait_for_event('AP-STA-CONNECTED') device.disconnect()