# sufficient survey data from mac80211_hwsim.
hostapd.add_ap(ap, { "ssid": "open" })
time.sleep(0.1)
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.remove(ap['ifname'])
+ hostapd.remove_bss(ap)
def force_prev_ap_on_5g(ap):
# For now, make sure the last operating channel was on 5 GHz band to get
hostapd.add_ap(ap, { "ssid": "open", "hw_mode": "a",
"channel": "36", "country_code": "US" })
time.sleep(0.1)
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.remove(ap['ifname'])
+ hostapd.remove_bss(ap)
def wait_acs(hapd):
ev = hapd.wait_event(["ACS-STARTED", "ACS-COMPLETED", "ACS-FAILED",
def test_ap_config_errors(dev, apdev):
"""Various hostapd configuration errors"""
- hapd_global = hostapd.HostapdGlobal()
- ifname = apdev[0]['ifname']
# IEEE 802.11d without country code
params = { "ssid": "foo", "ieee80211d": "1" }
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (ieee80211d without country_code)")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
# IEEE 802.11h without IEEE 802.11d
params = { "ssid": "foo", "ieee80211h": "1" }
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (ieee80211h without ieee80211d")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
# Power Constraint without IEEE 802.11d
params = { "ssid": "foo", "local_pwr_constraint": "1" }
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (local_pwr_constraint without ieee80211d)")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
# Spectrum management without Power Constraint
params = { "ssid": "foo", "spectrum_mgmt_required": "1" }
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (spectrum_mgmt_required without local_pwr_constraint)")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
# IEEE 802.1X without authentication server
params = { "ssid": "foo", "ieee8021x": "1" }
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (ieee8021x)")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
# RADIUS-PSK without macaddr_acl=2
params = hostapd.wpa2_params(ssid="foo", passphrase="12345678")
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (wpa_psk_radius)")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
# FT without NAS-Identifier
params = { "wpa": "2",
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (FT without nas_identifier)")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
# Hotspot 2.0 without WPA2/CCMP
params = hostapd.wpa2_params(ssid="foo")
hapd = hostapd.add_ap(apdev[0], params, no_enable=True)
if "FAIL" not in hapd.request("ENABLE"):
raise Exception("Unexpected ENABLE success (HS 2.0 without WPA2/CCMP)")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
def _test_ap_bss_add_many(dev, apdev):
ifname = apdev[0]['ifname']
hostapd.add_bss(apdev[0], ifname, 'bss-1.conf')
- hapd = hostapd.HostapdGlobal()
fname = '/tmp/hwsim-bss.conf'
for i in range(16):
ifname2 = ifname + '-' + str(i)
dev[0].request("DISCONNECT")
dev[0].wait_disconnected(timeout=5)
ifname2 = ifname + '-' + str(i)
- hapd.remove(ifname2)
+ hostapd.remove_bss(apdev[0], ifname2)
def test_ap_bss_add_reuse_existing(dev, apdev):
"""Dynamic BSS add operation reusing existing interface"""
if "status=5" not in ev:
raise Exception("Unexpected status code in rejection: " + ev)
-def clear_pbc_overlap(dev, ifname):
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.remove(ifname)
+def clear_pbc_overlap(dev, ap):
+ hostapd.remove_bss(ap)
dev[0].request("P2P_CANCEL")
dev[1].request("P2P_CANCEL")
dev[0].p2p_stop_find()
if ev is None:
raise Exception("PBC overlap not reported")
- clear_pbc_overlap(dev, apdev[0]['ifname'])
+ clear_pbc_overlap(dev, apdev[0])
def test_grpform_pbc_overlap_group_iface(dev, apdev):
"""P2P group formation during PBC overlap using group interfaces"""
# the group interface.
logger.info("PBC overlap not reported")
- clear_pbc_overlap(dev, apdev[0]['ifname'])
+ clear_pbc_overlap(dev, apdev[0])
def test_grpform_goneg_fail_with_group_iface(dev):
"""P2P group formation fails while using group interface"""