From 1f404e32a6320beb257c975066349f8c10be15c5 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 10 Sep 2020 16:12:30 -0700 Subject: [PATCH] auto-t: fix testSAE autoconnect_test.py This test was unreliable since it was assuming a periodic scan would happen at just the right time. Instead since we are expecting autoconnect we can just wait for DeviceState.connected then after we are connected verify the network was correct. --- autotests/testSAE/autoconnect_test.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/autotests/testSAE/autoconnect_test.py b/autotests/testSAE/autoconnect_test.py index a45fd09d..0613d91e 100644 --- a/autotests/testSAE/autoconnect_test.py +++ b/autotests/testSAE/autoconnect_test.py @@ -23,20 +23,15 @@ class Test(unittest.TestCase): devices[2].disconnect() devices[3].disconnect() - condition = 'obj.scanning' - wd.wait_for_object_condition(device, condition) + condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_condition(device, condition, 30) - condition = 'not obj.scanning' + condition = 'obj.connected_network is not None' wd.wait_for_object_condition(device, condition) ordered_network = device.get_ordered_network('ssidSAE') - self.assertEqual(ordered_network.type, NetworkType.psk) - - condition = 'obj.connected' - wd.wait_for_object_condition(ordered_network.network_object, condition) - - device.wait_for_connected() + self.assertTrue(ordered_network.network_object.connected) device.disconnect()