diff --git a/autotests/testFT-8021x-roam/connection_test.py b/autotests/testFT-8021x-roam/connection_test.py index 6e905f0d..c50c90ee 100644 --- a/autotests/testFT-8021x-roam/connection_test.py +++ b/autotests/testFT-8021x-roam/connection_test.py @@ -79,11 +79,9 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) - - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) self.assertTrue(self.bss_hostapd[1].list_sta()) diff --git a/autotests/testFT-FILS-SHA256/connection_test.py b/autotests/testFT-FILS-SHA256/connection_test.py index 267639cd..81201e08 100644 --- a/autotests/testFT-FILS-SHA256/connection_test.py +++ b/autotests/testFT-FILS-SHA256/connection_test.py @@ -109,11 +109,9 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) - - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) self.assertTrue(self.bss_hostapd[1].list_sta()) diff --git a/autotests/testFT-FILS-SHA384/connection_test.py b/autotests/testFT-FILS-SHA384/connection_test.py index 12a85e3f..81201e08 100644 --- a/autotests/testFT-FILS-SHA384/connection_test.py +++ b/autotests/testFT-FILS-SHA384/connection_test.py @@ -109,10 +109,10 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) - self.assertEqual(device.state, iwd.DeviceState.connected) self.assertTrue(self.bss_hostapd[1].list_sta()) testutil.test_iface_operstate(device.name) diff --git a/autotests/testFT-PSK-over-DS/connection_test.py b/autotests/testFT-PSK-over-DS/connection_test.py index b6cad5a4..ad186d07 100644 --- a/autotests/testFT-PSK-over-DS/connection_test.py +++ b/autotests/testFT-PSK-over-DS/connection_test.py @@ -85,11 +85,9 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) - - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) self.assertTrue(self.bss_hostapd[1].list_sta()) diff --git a/autotests/testFT-PSK-roam/connection_test.py b/autotests/testFT-PSK-roam/connection_test.py index a7acf495..c0eec0ae 100644 --- a/autotests/testFT-PSK-roam/connection_test.py +++ b/autotests/testFT-PSK-roam/connection_test.py @@ -87,11 +87,10 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(device, condition) self.assertTrue(self.bss_hostapd[1].list_sta()) testutil.test_iface_operstate(device.name) diff --git a/autotests/testFT-SAE-roam/connection_test.py b/autotests/testFT-SAE-roam/connection_test.py index a8d1da6c..f2c694dd 100644 --- a/autotests/testFT-SAE-roam/connection_test.py +++ b/autotests/testFT-SAE-roam/connection_test.py @@ -91,15 +91,15 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) rule1.signal = -2000 # wait for IWD's signal levels to recover wd.wait(5) - self.assertEqual(device.state, iwd.DeviceState.connected) self.assertTrue(self.bss_hostapd[1].list_sta()) testutil.test_iface_operstate(device.name) diff --git a/autotests/testPreauth-roam/connection_test.py b/autotests/testPreauth-roam/connection_test.py index 5eee3078..8a50abb5 100644 --- a/autotests/testPreauth-roam/connection_test.py +++ b/autotests/testPreauth-roam/connection_test.py @@ -97,10 +97,10 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) - self.assertEqual(device.state, iwd.DeviceState.connected) self.assertTrue(bss_hostapd[1].list_sta()) testutil.test_iface_operstate(device.name) diff --git a/autotests/testRoamRetry/fast_retry_test.py b/autotests/testRoamRetry/fast_retry_test.py index 32d80002..ce2c5603 100644 --- a/autotests/testRoamRetry/fast_retry_test.py +++ b/autotests/testRoamRetry/fast_retry_test.py @@ -117,10 +117,10 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition, max_wait=5) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) - self.assertEqual(device.state, iwd.DeviceState.connected) self.assertTrue(bss_hostapd[1].list_sta()) device.disconnect() diff --git a/autotests/testRoamRetry/stop_retry_test.py b/autotests/testRoamRetry/stop_retry_test.py index a2729d6c..38f58398 100644 --- a/autotests/testRoamRetry/stop_retry_test.py +++ b/autotests/testRoamRetry/stop_retry_test.py @@ -92,10 +92,10 @@ class Test(unittest.TestCase): # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between - condition = 'obj.state != DeviceState.roaming' - wd.wait_for_object_condition(device, condition) + from_condition = 'obj.state == DeviceState.roaming' + to_condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_change(device, from_condition, to_condition) - self.assertEqual(device.state, iwd.DeviceState.connected) self.assertTrue(bss_hostapd[1].list_sta()) # Now make sure that we don't roam anymore. In order to catch this via