Pass the full apdev to the add_ap() function instead of just ifname.
This allows us to handle also remote hosts while we can check
apdev['hostname'], apdev['port'].
This step (7) converts the cases where a local variable is used to store
apdev[#]['ifname'] before passing it as the argument to hostapd.add_ap().
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
# IEEE 802.11d without country code
params = { "ssid": "foo", "ieee80211d": "1" }
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
# IEEE 802.11h without IEEE 802.11d
params = { "ssid": "foo", "ieee80211h": "1" }
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
# Power Constraint without IEEE 802.11d
params = { "ssid": "foo", "local_pwr_constraint": "1" }
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
# Spectrum management without Power Constraint
params = { "ssid": "foo", "spectrum_mgmt_required": "1" }
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
# IEEE 802.1X without authentication server
params = { "ssid": "foo", "ieee8021x": "1" }
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
# RADIUS-PSK without macaddr_acl=2
params = hostapd.wpa2_params(ssid="foo", passphrase="12345678")
params["wpa_psk_radius"] = "1"
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
"wpa_key_mgmt": "FT-PSK",
"rsn_pairwise": "CCMP",
"wpa_passphrase": "12345678" }
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
params['interworking'] = "1"
params['hs20'] = "1"
params['wpa'] = "1"
- hapd = hostapd.add_ap(ifname, params, no_enable=True)
+ 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)
params['channel'] = '0'
ifname = apdev[0]['ifname']
hapd = hostapd.HostapdGlobal()
- hostapd.add_ap(ifname, params)
+ hostapd.add_ap(apdev[0], params)
hapd.remove(ifname)
def test_ap_remove_during_acs2(dev, apdev):
params['ht_capab'] = "[HT40+]"
ifname = apdev[0]['ifname']
hapd = hostapd.HostapdGlobal()
- hostapd.add_ap(ifname, params)
+ hostapd.add_ap(apdev[0], params)
hapd.remove(ifname)
def test_ap_remove_during_ht_coex_scan2(dev, apdev):
subprocess.call(['iw', ifname, 'set', 'type', '__ap'])
subprocess.call(['brctl', 'addif', br_ifname, ifname])
params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
- hapd = hostapd.add_ap(ifname, params)
+ hapd = hostapd.add_ap(apdev[0], params)
if hapd.get_driver_status_field('brname') != br_ifname:
raise Exception("Bridge name not identified correctly")
dev[0].connect(ssid, psk=passphrase, scan_freq="2412")
time.sleep(0.5)
params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
params['bridge'] = 'ap-br0'
- hapd = hostapd.add_ap(ifname, params)
+ hapd = hostapd.add_ap(apdev[0], params)
subprocess.call(['brctl', 'setfd', 'ap-br0', '0'])
subprocess.call(['ip', 'link', 'set', 'dev', 'ap-br0', 'up'])
brname = hapd.get_driver_status_field('brname')
ssid = "test-wpa2-psk"
passphrase = "12345678"
params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase)
- hapd = hostapd.add_ap(ifname, params)
+ hapd = hostapd.add_ap(apdev[0], params)
subprocess.call(['brctl', 'addbr', br_ifname])
subprocess.call(['brctl', 'setfd', br_ifname, '0'])
ssid = "hapd-ctrl"
params = { "ssid": ssid }
ifname = apdev[0]['ifname']
- hapd = hostapd.add_ap(ifname, params)
+ hapd = hostapd.add_ap(apdev[0], params)
hapd_global = hostapd.HostapdGlobal()
res = hapd_global.request("IFNAME=" + ifname + " PING")
if "PONG" not in res:
src_params = hostapd.wpa2_params(ssid=src_ssid, passphrase=passphrase)
src_ifname = apdev[0]['ifname']
- src_hapd = hostapd.add_ap(src_ifname, src_params)
+ src_hapd = hostapd.add_ap(apdev[0], src_params)
dst_params = { "ssid": dst_ssid }
dst_ifname = apdev[1]['ifname']
- dst_hapd = hostapd.add_ap(dst_ifname, dst_params, no_enable=True)
+ dst_hapd = hostapd.add_ap(apdev[1], dst_params, no_enable=True)
hapd_global = hostapd.HostapdGlobal()
src_params = hostapd.wpa_params(ssid=src_ssid)
src_params['wpa_psk'] = psk
src_ifname = apdev[0]['ifname']
- src_hapd = hostapd.add_ap(src_ifname, src_params)
+ src_hapd = hostapd.add_ap(apdev[0], src_params)
dst_params = { "ssid": dst_ssid }
dst_ifname = apdev[1]['ifname']
- dst_hapd = hostapd.add_ap(dst_ifname, dst_params, no_enable=True)
+ dst_hapd = hostapd.add_ap(apdev[1], dst_params, no_enable=True)
hapd_global = hostapd.HostapdGlobal()