From 0238e8ba4cef3a8014fa3ad716ad60d1ba66002a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 7 May 2017 20:59:44 +0300 Subject: [PATCH] tests: D-Bus scan trigger and abort Signed-off-by: Jouni Malinen --- tests/hwsim/test_dbus.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index 994731537..b906f3d80 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -1166,6 +1166,24 @@ def test_dbus_scan_busy(dev, apdev): if ev is None: raise Exception("Scan timed out") +def test_dbus_scan_abort(dev, apdev): + """D-Bus scan trigger and abort""" + (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0]) + iface = dbus.Interface(if_obj, WPAS_DBUS_IFACE) + + iface.Scan({'Type': 'active', 'AllowRoam': False}) + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], 15) + if ev is None: + raise Exception("Scan start timed out") + + iface.AbortScan() + iface.Scan({'Type': 'active', 'AllowRoam': False}) + iface.AbortScan() + + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 15) + if ev is None: + raise Exception("Scan timed out") + def test_dbus_connect(dev, apdev): """D-Bus AddNetwork and connect""" (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])