diff --git a/autotests/testSAQuery-spoofing/connection_test.py b/autotests/testSAQuery-spoofing/connection_test.py index f64a93f7..0ff0615f 100644 --- a/autotests/testSAQuery-spoofing/connection_test.py +++ b/autotests/testSAQuery-spoofing/connection_test.py @@ -51,8 +51,10 @@ class Test(unittest.TestCase): # Spoof a disassociate frame. This will kick off SA Query procedure. hwsim.spoof_disassociate(radio, hostapd.frequency, device.address) - # sleep to ensure hostapd responds and SA Query does not timeout - sleep(4) + # ensure hostapd responds and SA Query does not timeout + with self.assertRaises(TimeoutError): + condition = 'obj.state == DeviceState.disconnected' + wd.wait_for_object_condition(device, condition, 4) # Since disassociate was spoofed we should still be connected condition = 'obj.state == DeviceState.connected'