aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Kourt <tim.a.kourt@linux.intel.com>2020-04-13 18:16:45 -0700
committerDenis Kenzior <denkenz@gmail.com>2020-04-09 16:46:31 -0500
commit57ce53f1ac024eb2948e81f903928e46e60546e1 (patch)
tree54ea391a9d6563f35c5fb05eef132b5be2506f60
parent000b5331944a65416d030a1f8ecf84c466fb59ee (diff)
downloadiwd-57ce53f1ac024eb2948e81f903928e46e60546e1.tar.gz
auto-t: Fix event order
In addition, use the conditional wait for the expected number of known networks
-rw-r--r--autotests/testHotspot/autoconnect_test.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/autotests/testHotspot/autoconnect_test.py b/autotests/testHotspot/autoconnect_test.py
index edefb2966..252a4b924 100644
--- a/autotests/testHotspot/autoconnect_test.py
+++ b/autotests/testHotspot/autoconnect_test.py
@@ -52,7 +52,8 @@ class Test(unittest.TestCase):
condition = 'obj.state == DeviceState.disconnected'
wd.wait_for_object_condition(device, condition)
- self.assertEqual(len(wd.list_known_networks()), 1)
+ condition = 'len(obj.list_known_networks()) == 1'
+ wd.wait_for_object_condition(wd, condition)
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
@@ -74,9 +75,6 @@ class Test(unittest.TestCase):
testutil.test_ifaces_connected(device.name, hapd_hotspot.ifname)
os.remove('/var/lib/iwd/hotspot/autoconnect.conf')
- IWD.copy_to_storage('ssidWPA2-1.psk')
-
- self.assertEqual(len(wd.list_known_networks()), 1)
#
# make sure removal of hotspot conf file resulted in disconnect
@@ -84,6 +82,11 @@ class Test(unittest.TestCase):
condition = 'obj.state == DeviceState.disconnected'
wd.wait_for_object_condition(device, condition)
+ IWD.copy_to_storage('ssidWPA2-1.psk')
+
+ condition = 'len(obj.list_known_networks()) == 1'
+ wd.wait_for_object_condition(wd, condition)
+
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)