From d0cd00de6f8c5f1166062a4814f8863268c48d3f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 14 Mar 2015 10:06:06 +0200 Subject: [PATCH] tests: Verify wpa_supplicant AP mode events Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_ap.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/hwsim/test_wpas_ap.py b/tests/hwsim/test_wpas_ap.py index 5af07b178..53de3992f 100644 --- a/tests/hwsim/test_wpas_ap.py +++ b/tests/hwsim/test_wpas_ap.py @@ -315,3 +315,22 @@ def _test_wpas_ap_dfs(dev): raise Exception("AP failed to start") dev[1].connect("wpas-ap-dfs", key_mgmt="NONE") + +def test_wpas_ap_disable(dev): + """wpa_supplicant AP mode - DISABLE_NETWORK""" + id = dev[0].add_network() + dev[0].set_network(id, "mode", "2") + dev[0].set_network_quoted(id, "ssid", "wpas-ap-open") + dev[0].set_network(id, "key_mgmt", "NONE") + dev[0].set_network(id, "scan_freq", "2412") + dev[0].select_network(id) + + ev = dev[0].wait_event(["AP-ENABLED"]) + if ev is None: + raise Exception("AP-ENABLED event not seen") + wait_ap_ready(dev[0]) + dev[0].request("DISABLE_NETWORK %d" % id) + ev = dev[0].wait_event(["AP-DISABLED"]) + if ev is None: + raise Exception("AP-DISABLED event not seen") + dev[0].wait_disconnected()