aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-10-25 08:29:28 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-25 08:29:28 (GMT)
commitd4792c0cb7419f10b666fe71e847abb19b4cd59d (patch)
tree44c6d696af066b834ec804eb02e0d024e4a64585 /tests
parentaed8d4d1ff545a74f0683f592c5d11f72b3e22d6 (diff)
downloadhostap-d4792c0cb7419f10b666fe71e847abb19b4cd59d.zip
hostap-d4792c0cb7419f10b666fe71e847abb19b4cd59d.tar.gz
hostap-d4792c0cb7419f10b666fe71e847abb19b4cd59d.tar.bz2
tests: Channel switch with VHT80
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_ap_vht.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py
index 9e6f148..d4c3e4c 100644
--- a/tests/hwsim/test_ap_vht.py
+++ b/tests/hwsim/test_ap_vht.py
@@ -13,6 +13,7 @@ import subprocess, time
import hwsim_utils
import hostapd
from test_dfs import wait_dfs_event
+from test_ap_csa import csa_supported
def vht_supported():
cmd = subprocess.Popen(["iw", "reg", "get"], stdout=subprocess.PIPE)
@@ -275,3 +276,53 @@ def test_ap_vht80plus80(dev, apdev):
raise
finally:
subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])
+
+def test_ap_vht80_csa(dev, apdev):
+ """VHT with 80 MHz channel width and CSA"""
+ if not csa_supported(dev[0]):
+ return "skip"
+ try:
+ params = { "ssid": "vht",
+ "country_code": "US",
+ "hw_mode": "a",
+ "channel": "149",
+ "ht_capab": "[HT40+]",
+ "ieee80211n": "1",
+ "ieee80211ac": "1",
+ "vht_oper_chwidth": "1",
+ "vht_oper_centr_freq_seg0_idx": "155" }
+ hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+
+ dev[0].connect("vht", key_mgmt="NONE", scan_freq="5745")
+ hwsim_utils.test_connectivity(dev[0], hapd)
+
+ hapd.request("CHAN_SWITCH 5 5180 ht vht blocktx center_freq1=5210 sec_channel_offset=1 bandwidth=80")
+ ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=10)
+ if ev is None:
+ raise Exception("CSA finished event timed out")
+ if "freq=5180" not in ev:
+ raise Exception("Unexpected channel in CSA finished event")
+ time.sleep(0.5)
+ hwsim_utils.test_connectivity(dev[0], hapd)
+
+ hapd.request("CHAN_SWITCH 5 5745")
+ ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=10)
+ if ev is None:
+ raise Exception("CSA finished event timed out")
+ if "freq=5745" not in ev:
+ raise Exception("Unexpected channel in CSA finished event")
+ time.sleep(0.5)
+ hwsim_utils.test_connectivity(dev[0], hapd)
+
+ # This CSA to same channel will fail in kernel, so use this only for
+ # extra code coverage.
+ hapd.request("CHAN_SWITCH 5 5745")
+ hapd.wait_event(["AP-CSA-FINISHED"], timeout=1)
+ except Exception, e:
+ if isinstance(e, Exception) and str(e) == "AP startup failed":
+ if not vht_supported():
+ logger.info("80 MHz channel not supported in regulatory information")
+ return "skip"
+ raise
+ finally:
+ subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])