]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: DFS CAC interrupted and restarted
authorJouni Malinen <j@w1.fi>
Mon, 7 Jan 2019 22:36:07 +0000 (00:36 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 7 Jan 2019 23:12:02 +0000 (01:12 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_dfs.py

index cce43807b8afca50191caf999ca2aae232013472..a153fae1a031788f042041a00aa5640d2e35e5bb 100644 (file)
@@ -485,3 +485,29 @@ def test_dfs_ht40_minus(dev, apdev, params):
         hwsim_utils.test_connectivity(dev[0], hapd)
     finally:
         clear_regdom(hapd, dev)
+
+def test_dfs_cac_restart_on_enable(dev, apdev):
+    """DFS CAC interrupted and restarted"""
+    try:
+        hapd = None
+        hapd = start_dfs_ap(apdev[0], allow_failure=True)
+        time.sleep(0.1)
+        subprocess.check_call(['ip', 'link', 'set', 'dev', hapd.ifname, 'down'])
+        ev = wait_dfs_event(hapd, "DFS-CAC-COMPLETED", 5)
+        if ev is None:
+            raise Exception("Timeout on DFS aborted event")
+        if "success=0 freq=5260" not in ev:
+            raise Exception("Unexpected DFS aborted event contents: " + ev)
+        time.sleep(0.1)
+        subprocess.check_call(['ip', 'link', 'set', 'dev', hapd.ifname, 'up'])
+
+        ev = wait_dfs_event(hapd, "DFS-CAC-START", 5)
+        if "DFS-CAC-START" not in ev:
+            raise Exception("Unexpected DFS event: " + ev)
+        hapd.disable()
+
+    finally:
+        if hapd:
+            hapd.request("DISABLE")
+        subprocess.call(['iw', 'reg', 'set', '00'])
+        time.sleep(0.1)