From: Jouni Malinen Date: Wed, 20 Sep 2017 12:37:58 +0000 (+0300) Subject: tests: Make dbus_scan_abort more robust X-Git-Tag: hostap_2_7~1096 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f41f04d04c4405d8b642419fb50814fa9a3b3a5e;p=thirdparty%2Fhostap.git 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 --- 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()