]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Extend DFS testing to include channel switch
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 8 Oct 2014 22:23:21 +0000 (01:23 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 8 Oct 2014 22:23:21 +0000 (01:23 +0300)
Simulate a radar detection event to verify that hostapd switches
channels properly and the station follows the AP to the new channel.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_dfs.py

index f929d45450b9de2fe173ee6de63633889f940391..7bb2872a5d4a3018f4e3dfeb3ab8803ad967ec77 100644 (file)
@@ -83,6 +83,27 @@ def test_dfs(dev, apdev):
             raise Exception("Unexpected frequency")
 
         dev[0].connect("dfs", key_mgmt="NONE")
+        hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
+
+        hapd.request("RADAR DETECTED freq=5260 ht_enabled=1 chan_width=1")
+        ev = hapd.wait_event(["DFS-RADAR-DETECTED"], timeout=10)
+        if ev is None:
+            raise Exception("DFS-RADAR-DETECTED event not reported")
+        if "freq=5260" not in ev:
+            raise Exception("Incorrect frequency in radar detected event: " + ev);
+        ev = hapd.wait_event(["DFS-NEW-CHANNEL"], timeout=70)
+        if ev is None:
+            raise Exception("DFS-NEW-CHANNEL event not reported")
+        if "freq=5260" in ev:
+            raise Exception("Channel did not change after radar was detected");
+
+        ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=70)
+        if ev is None:
+            raise Exception("AP-CSA-FINISHED event not reported")
+        if "freq=5260" in ev:
+            raise Exception("Channel did not change after radar was detected(2)");
+        time.sleep(1)
+        hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
     finally:
         subprocess.call(['sudo', 'iw', 'reg', 'set', '00'])