From f41f04d04c4405d8b642419fb50814fa9a3b3a5e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 20 Sep 2017 15:37:58 +0300 Subject: [PATCH] tests: Make dbus_scan_abort more robust There was a race condition on the sequence where iface.AbortScan() is immediately followed by iface.Scan(). If the driver event (NL80211_CMD_SCAN_ABORTED) arrived after the following new scan request, the D-Bus operation failed. This is not what this test case is trying to check, so wait for an indication of the previous scan having terminated properly before issuing the next scan. Signed-off-by: Jouni Malinen --- tests/hwsim/test_dbus.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index ffc969455..03249cf03 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -1179,6 +1179,10 @@ def test_dbus_scan_abort(dev, apdev): raise Exception("Scan start timed out") iface.AbortScan() + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 15) + if ev is None: + raise Exception("Scan abort result timed out") + dev[0].dump_monitor() iface.Scan({'Type': 'active', 'AllowRoam': False}) iface.AbortScan()