From 20b7540201c105362c1f24c7d4a414e02d4e471c Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 10 Sep 2020 16:12:46 -0700 Subject: [PATCH] auto-t: fix testPreauth-roam Changed to wait for DeviceState instead of network object as well as moved hwsim rules ahead of the IWD initializer to avoid IWD scanning before the rules are fully in place. --- autotests/testPreauth-roam/connection_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/autotests/testPreauth-roam/connection_test.py b/autotests/testPreauth-roam/connection_test.py index 839e04b0..5eee3078 100644 --- a/autotests/testPreauth-roam/connection_test.py +++ b/autotests/testPreauth-roam/connection_test.py @@ -44,14 +44,14 @@ class Test(unittest.TestCase): bss_hostapd[1].set_neighbor(bss_radio[0].addresses[0], 'TestPreauth', bss0_nr) - wd = IWD() - - device = wd.list_devices(1)[0] - # Check that iwd selects BSS 0 first rule0.signal = -2500 rule1.signal = -3500 + wd = IWD() + + device = wd.list_devices(1)[0] + condition = 'not obj.scanning' wd.wait_for_object_condition(device, condition) @@ -76,8 +76,8 @@ class Test(unittest.TestCase): ordered_network.network_object.connect() - 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) self.assertTrue(bss_hostapd[0].list_sta()) self.assertFalse(bss_hostapd[1].list_sta())