tests: Add hostapd.py helpers for various radio parameters
Add support for generating hostapd parameters for b_only/g_only/a_only/HT20/HT40/VHT80. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
parent
e3b36d420e
commit
c0ca24fc30
1 changed files with 49 additions and 0 deletions
|
@ -442,3 +442,52 @@ def wpa2_eap_params(ssid=None):
|
||||||
if ssid:
|
if ssid:
|
||||||
params["ssid"] = ssid
|
params["ssid"] = ssid
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
def b_only_params(channel="1", ssid=None, country=None):
|
||||||
|
params = { "hw_mode" : "b",
|
||||||
|
"channel" : channel }
|
||||||
|
if ssid:
|
||||||
|
params["ssid"] = ssid
|
||||||
|
if country:
|
||||||
|
params["country_code"] = country
|
||||||
|
return params
|
||||||
|
|
||||||
|
def g_only_params(channel="1", ssid=None, country=None):
|
||||||
|
params = { "hw_mode" : "g",
|
||||||
|
"channel" : channel }
|
||||||
|
if ssid:
|
||||||
|
params["ssid"] = ssid
|
||||||
|
if country:
|
||||||
|
params["country_code"] = country
|
||||||
|
return params
|
||||||
|
|
||||||
|
def a_only_params(channel="36", ssid=None, country=None):
|
||||||
|
params = { "hw_mode" : "a",
|
||||||
|
"channel" : channel }
|
||||||
|
if ssid:
|
||||||
|
params["ssid"] = ssid
|
||||||
|
if country:
|
||||||
|
params["country_code"] = country
|
||||||
|
return params
|
||||||
|
|
||||||
|
def ht20_params(channel="1", ssid=None, country=None):
|
||||||
|
params = { "ieee80211n" : "1",
|
||||||
|
"channel" : channel,
|
||||||
|
"hw_mode" : "g" }
|
||||||
|
if int(channel) > 14:
|
||||||
|
params["hw_mode"] = "a"
|
||||||
|
if ssid:
|
||||||
|
params["ssid"] = ssid
|
||||||
|
if country:
|
||||||
|
params["country_code"] = country
|
||||||
|
return params
|
||||||
|
|
||||||
|
def ht40_plus_params(channel="1", ssid=None, country=None):
|
||||||
|
params = ht20_params(channel, ssid, country)
|
||||||
|
params['ht_capab'] = "[HT40+]"
|
||||||
|
return params
|
||||||
|
|
||||||
|
def ht40_minus_params(channel="1", ssid=None, country=None):
|
||||||
|
params = ht20_params(channel, ssid, country)
|
||||||
|
params['ht_capab'] = "[HT40-]"
|
||||||
|
return params
|
||||||
|
|
Loading…
Reference in a new issue