3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-26 01:02:35 +01:00

auto-t: Fix event order

In addition, use the conditional wait for the expected number
of known networks
This commit is contained in:
Tim Kourt 2020-04-13 18:16:45 -07:00 committed by Denis Kenzior
parent 000b533194
commit 57ce53f1ac

View File

@ -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)