aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-03-27 17:30:40 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-27 17:30:40 (GMT)
commit803d01901bff47079d997bcae56bfc1862b2da01 (patch)
tree9ce659c1631999a4fe5ca252db835b800d7b76c9
parentdd73d9a8438a9c77faaf13fff20bc05c52844d6d (diff)
downloadhostap-803d01901bff47079d997bcae56bfc1862b2da01.zip
hostap-803d01901bff47079d997bcae56bfc1862b2da01.tar.gz
hostap-803d01901bff47079d997bcae56bfc1862b2da01.tar.bz2
tests: DFS CAC functionality on channel 104 HT40-
Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_dfs.py41
-rwxr-xr-xtests/hwsim/vm/parallel-vm.py1
2 files changed, 41 insertions, 1 deletions
diff --git a/tests/hwsim/test_dfs.py b/tests/hwsim/test_dfs.py
index 592736e..1c90bcd 100644
--- a/tests/hwsim/test_dfs.py
+++ b/tests/hwsim/test_dfs.py
@@ -26,7 +26,8 @@ def wait_dfs_event(hapd, event, timeout):
return ev
def start_dfs_ap(ap, allow_failure=False, ssid="dfs", ht=True, ht40=False,
- ht40minus=False, vht80=False, vht20=False, chanlist=None):
+ ht40minus=False, vht80=False, vht20=False, chanlist=None,
+ channel=None):
ifname = ap['ifname']
logger.info("Starting AP " + ifname + " on DFS channel")
hapd_global = hostapd.HostapdGlobal()
@@ -59,6 +60,8 @@ def start_dfs_ap(ap, allow_failure=False, ssid="dfs", ht=True, ht40=False,
hapd.set("vht_oper_centr_freq_seg0_idx", "0")
if chanlist:
hapd.set("chanlist", chanlist)
+ if channel:
+ hapd.set("channel", str(channel))
hapd.enable()
ev = wait_dfs_event(hapd, "DFS-CAC-START", 5)
@@ -400,3 +403,39 @@ def test_dfs_radar_ht40minus(dev, apdev):
hapd.request("DISABLE")
subprocess.call(['iw', 'reg', 'set', '00'])
dev[0].flush_scan_cache()
+
+def test_dfs_ht40_minus(dev, apdev, params):
+ """DFS CAC functionality on channel 104 HT40- [long]"""
+ if not params['long']:
+ raise HwsimSkip("Skip test case with long duration due to --long not specified")
+ try:
+ hapd = None
+ hapd = start_dfs_ap(apdev[0], allow_failure=True, ht40minus=True,
+ channel=104)
+
+ ev = wait_dfs_event(hapd, "DFS-CAC-COMPLETED", 70)
+ if "success=1" not in ev:
+ raise Exception("CAC failed")
+ if "freq=5520" not in ev:
+ raise Exception("Unexpected DFS freq result")
+
+ ev = hapd.wait_event(["AP-ENABLED"], timeout=5)
+ if not ev:
+ raise Exception("AP setup timed out")
+
+ state = hapd.get_status_field("state")
+ if state != "ENABLED":
+ raise Exception("Unexpected interface state")
+
+ freq = hapd.get_status_field("freq")
+ if freq != "5520":
+ raise Exception("Unexpected frequency")
+
+ dev[0].connect("dfs", key_mgmt="NONE", scan_freq="5520")
+ hwsim_utils.test_connectivity(dev[0], hapd)
+ finally:
+ dev[0].request("DISCONNECT")
+ if hapd:
+ hapd.request("DISABLE")
+ subprocess.call(['iw', 'reg', 'set', '00'])
+ dev[0].flush_scan_cache()
diff --git a/tests/hwsim/vm/parallel-vm.py b/tests/hwsim/vm/parallel-vm.py
index 0f175b1..40bbb76 100755
--- a/tests/hwsim/vm/parallel-vm.py
+++ b/tests/hwsim/vm/parallel-vm.py
@@ -50,6 +50,7 @@ long_tests = [ "ap_roam_open",
"ap_vht160",
"dfs_radar",
"dfs",
+ "dfs_ht40_minus",
"grpform_cred_ready_timeout",
"hostapd_oom_wpa2_eap_connect",
"wpas_ap_dfs",