aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-11-26 10:57:27 (GMT)
committerJouni Malinen <j@w1.fi>2017-11-26 10:57:27 (GMT)
commit32452fd2aaa85f34cd11ece69fe5b422ebcbbc0d (patch)
treeee750961f09cdb2ffbbb6d61b69bf21ec3dca2d2
parent725a953aea6efd312148756c7c72acf63c33e724 (diff)
downloadhostap-32452fd2aaa85f34cd11ece69fe5b422ebcbbc0d.zip
hostap-32452fd2aaa85f34cd11ece69fe5b422ebcbbc0d.tar.gz
hostap-32452fd2aaa85f34cd11ece69fe5b422ebcbbc0d.tar.bz2
tests: Split dfs_radar into two test cases (dfs_radar1 and dfs_radar2)
These DFS radar detection cases were in a single test case to optimize test execution time with parallel wait for the 60 second CAC. However, this design has become difficult to support with the kernel changes that allow radar events to be shared between interfaces. To avoid need for more workarounds here just for testing purposes, split this into two test cases so that conflicting events from another interface do not cause the test case to fail. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_dfs.py33
1 files changed, 19 insertions, 14 deletions
diff --git a/tests/hwsim/test_dfs.py b/tests/hwsim/test_dfs.py
index 91c7808..bf9af8f 100644
--- a/tests/hwsim/test_dfs.py
+++ b/tests/hwsim/test_dfs.py
@@ -203,18 +203,15 @@ def test_dfs_etsi(dev, apdev, params):
subprocess.call(['iw', 'reg', 'set', '00'])
dev[0].flush_scan_cache()
-def test_dfs_radar(dev, apdev):
- """DFS CAC functionality with radar detected"""
+def test_dfs_radar1(dev, apdev):
+ """DFS CAC functionality with radar detected during initial CAC"""
try:
hapd = None
- hapd2 = None
hapd = start_dfs_ap(apdev[0], allow_failure=True)
time.sleep(1)
dfs_simulate_radar(hapd)
- hapd2 = start_dfs_ap(apdev[1], ssid="dfs2", ht40=True)
-
ev = wait_dfs_event(hapd, "DFS-CAC-COMPLETED", 5)
if ev is None:
raise Exception("Timeout on DFS aborted event")
@@ -258,30 +255,38 @@ def test_dfs_radar(dev, apdev):
raise Exception("Unexpected frequency: " + freq)
dev[0].connect("dfs", key_mgmt="NONE")
+ finally:
+ dev[0].request("DISCONNECT")
+ if hapd:
+ hapd.request("DISABLE")
+ subprocess.call(['iw', 'reg', 'set', '00'])
+ dev[0].flush_scan_cache()
- ev = hapd2.wait_event(["AP-ENABLED"], timeout=70)
+def test_dfs_radar2(dev, apdev):
+ """DFS CAC functionality with radar detected after initial CAC"""
+ try:
+ hapd = None
+ hapd = start_dfs_ap(apdev[0], ssid="dfs2", ht40=True)
+
+ ev = hapd.wait_event(["AP-ENABLED"], timeout=70)
if not ev:
raise Exception("AP2 setup timed out")
- dfs_simulate_radar(hapd2)
+ dfs_simulate_radar(hapd)
- ev = wait_dfs_event(hapd2, "DFS-RADAR-DETECTED", 5)
+ ev = wait_dfs_event(hapd, "DFS-RADAR-DETECTED", 5)
if "freq=5260 ht_enabled=1 chan_offset=1 chan_width=2" not in ev:
raise Exception("Unexpected DFS radar detection freq from AP2")
- ev = wait_dfs_event(hapd2, "DFS-NEW-CHANNEL", 5)
+ ev = wait_dfs_event(hapd, "DFS-NEW-CHANNEL", 5)
if "freq=5260" in ev:
raise Exception("Unexpected DFS new freq for AP2")
- wait_dfs_event(hapd2, None, 5)
+ wait_dfs_event(hapd, None, 5)
finally:
- dev[0].request("DISCONNECT")
if hapd:
hapd.request("DISABLE")
- if hapd2:
- hapd2.request("DISABLE")
subprocess.call(['iw', 'reg', 'set', '00'])
- dev[0].flush_scan_cache()
@remote_compatible
def test_dfs_radar_on_non_dfs_channel(dev, apdev):