2 # Copyright (c) 2014, Qualcomm Atheros, Inc.
4 # This software may be distributed under the terms of the BSD license.
5 # See README for more details.
10 def test_ap_open(dev, apdev):
11 """AP with open mode (no security) configuration"""
12 hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" })
13 dev[0].connect("open", key_mgmt="NONE", scan_freq="2412")
14 hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
15 ev = hapd.wait_event([ "AP-STA-CONNECTED" ], timeout=5)
17 raise Exception("No connection event received from hostapd")
18 dev[0].request("DISCONNECT")
19 ev = hapd.wait_event([ "AP-STA-DISCONNECTED" ], timeout=5)
21 raise Exception("No disconnection event received from hostapd")
23 def test_ap_open_packet_loss(dev, apdev):
24 """AP with open mode configuration and large packet loss"""
25 params = { "ssid": "open",
26 "ignore_probe_probability": "0.5",
27 "ignore_auth_probability": "0.5",
28 "ignore_assoc_probability": "0.5",
29 "ignore_reassoc_probability": "0.5" }
30 hapd = hostapd.add_ap(apdev[0]['ifname'], params)
32 dev[i].connect("open", key_mgmt="NONE", scan_freq="2412",
35 ev = dev[i].wait_event(["CTRL-EVENT-CONNECTED"], timeout=20)
37 raise Exception("Association with the AP timed out")