From: Jouni Malinen Date: Thu, 19 Nov 2015 22:48:25 +0000 (+0200) Subject: tests: AP with open mode and select network twice X-Git-Tag: hostap_2_6~1374 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fb8b4bf84da1ced436db4658e052ddfe3718f47;p=thirdparty%2Fhostap.git tests: AP with open mode and select network twice This verifies that the second SELECT_NETWORK for the same network starts a new scan immediately if the previous connection attempt is waiting for the next scan iteration to start. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_open.py b/tests/hwsim/test_ap_open.py index 139756e06..69ceca09a 100644 --- a/tests/hwsim/test_ap_open.py +++ b/tests/hwsim/test_ap_open.py @@ -482,3 +482,17 @@ def test_ap_open_sta_enable_disable(dev, apdev): wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') wpas.interface_add("wlan5", drv_params="force_connect_cmd=1") sta_enable_disable(wpas, bssid) + +def test_ap_open_select_twice(dev, apdev): + """AP with open mode and select network twice""" + id = dev[0].connect("open", key_mgmt="NONE", scan_freq="2412", + only_add_network=True) + dev[0].select_network(id) + ev = dev[0].wait_event(["CTRL-EVENT-NETWORK-NOT-FOUND"], timeout=5) + if ev is None: + raise Exception("No result reported") + hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" }) + # Verify that the second SELECT_NETWORK starts a new scan immediately by + # waiting less than the default scan period. + dev[0].select_network(id) + dev[0].wait_connected(timeout=3)