diff --git a/tests/hwsim/test_ap_open.py b/tests/hwsim/test_ap_open.py index 74f6038dc..e3ae32f42 100644 --- a/tests/hwsim/test_ap_open.py +++ b/tests/hwsim/test_ap_open.py @@ -120,3 +120,20 @@ def test_ap_open_id_str(dev, apdev): raise Exception("CTRL-EVENT-CONNECT did not have matching id_str: " + ev) if dev[0].get_status_field("id_str") != "foo": raise Exception("id_str mismatch") + +def test_ap_open_select_any(dev, apdev): + """AP with open mode and select any network""" + hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" }) + id = dev[0].connect("unknown", key_mgmt="NONE", scan_freq="2412", + only_add_network=True) + 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-CONNECTED"], timeout=1) + if ev is not None: + raise Exception("Unexpected connection") + + dev[0].select_network("any") + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"]) + if ev is None: + raise Exception("Association with the AP timed out")