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")