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 | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/autotests/testSAE/autoconnect_test.py
index a45fd09d..2eb73b7f 100644
@@ -23,20 +23,15 @@ class Test(unittest.TestCase):
- 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'
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)
@@ -44,7 +39,7 @@ class Test(unittest.TestCase):
- wd = IWD(True)
+ wd = IWD()