aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2016-03-04 09:20:41 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-05 15:44:51 (GMT)
commitc0ca24fc30c263024cfd1b282bc67a71ee2ddfca (patch)
tree6b5227c3820ee57dd2de34229205dd28a6b3feed
parente3b36d420e9f06a98f046662cece84ea1a480bab (diff)
downloadhostap-c0ca24fc30c263024cfd1b282bc67a71ee2ddfca.zip
hostap-c0ca24fc30c263024cfd1b282bc67a71ee2ddfca.tar.gz
hostap-c0ca24fc30c263024cfd1b282bc67a71ee2ddfca.tar.bz2
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>
-rw-r--r--tests/hwsim/hostapd.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py
index 1b6e23b..0a4ad72 100644
--- a/tests/hwsim/hostapd.py
+++ b/tests/hwsim/hostapd.py
@@ -442,3 +442,52 @@ def wpa2_eap_params(ssid=None):
if ssid:
params["ssid"] = ssid
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