diff mbox series

[3/3] tests: Add a mesh DFS test

Message ID 1523608716-5947-3-git-send-email-masashi.honma@gmail.com
State Deferred
Headers show
Series [1/3] mesh: Fix some compiler warnings | expand

Commit Message

Masashi Honma April 13, 2018, 8:38 a.m. UTC
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
 tests/hwsim/test_wpas_mesh.py | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

Comments

Peter Oh April 13, 2018, 6:47 p.m. UTC | #1
On 04/13/2018 01:38 AM, Masashi Honma wrote:

> +        add_open_mesh_network(dev[i], freq="5260", basic_rates="60 120 240",
> +                              disable_ht40=True)
Is disable_ht40 in mesh effective?
Configuring operation bandwidth to wpa_supplicant in 11ac mode including 
mesh is supposed to use the combination of max_oper_chwidth, 
disable_vht, disable_ht40, and disable_ht which doesn't work well and 
require extra patch for it.
I'm not clearly remember if disable_ht40 by itself is effective or not.

Thanks,
Peter
diff mbox series

Patch

diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py
index c3cfb7b..94bf544 100644
--- a/tests/hwsim/test_wpas_mesh.py
+++ b/tests/hwsim/test_wpas_mesh.py
@@ -18,6 +18,8 @@  from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger
 from tshark import run_tshark
 from test_ap_ht import set_world_reg
 from hwsim_utils import set_group_map
+from test_dfs import wait_dfs_event
+from test_p2p_channel import set_country
 
 def check_mesh_support(dev, secure=False):
     if "MESH" not in dev.get_capability("modes"):
@@ -1061,6 +1063,47 @@  def _test_mesh_open_vht_160(dev, apdev):
     dev[0].dump_monitor()
     dev[1].dump_monitor()
 
+def test_wpas_mesh_open_dfs(dev, apdev):
+    """wpa_supplicant open MESH network with DFS"""
+    try:
+        _test_wpas_mesh_open_dfs(dev, apdev)
+    finally:
+        for i in range(0, 2):
+            dev[i].mesh_group_remove()
+            check_mesh_group_removed(dev[i])
+            dev[i].flush_scan_cache()
+            dev[i].dump_monitor()
+        set_country("00")
+
+def _test_wpas_mesh_open_dfs(dev, apdev):
+    set_country("US")
+    for i in range(0, 2):
+        dev[i].request("SET country US")
+        check_mesh_support(dev[i])
+        add_open_mesh_network(dev[i], freq="5260", basic_rates="60 120 240",
+                              disable_ht40=True)
+
+        ev = wait_dfs_event(dev[i], "DFS-CAC-START", 5)
+        if "DFS-CAC-START" not in ev:
+            # For now, assume DFS is not supported by all kernel builds.
+            raise HwsimSkip("CAC did not start - assume not supported")
+
+        ev = wait_dfs_event(dev[i], "DFS-CAC-COMPLETED", 70)
+        if "success=1" not in ev:
+            raise Exception("CAC failed")
+        if "freq=5260" not in ev:
+            raise Exception("Unexpected DFS freq result")
+
+        # Check for mesh joined
+        check_mesh_group_added(dev[i])
+
+    # Check for peer connected
+    for i in range(0, 2):
+        check_mesh_peer_connected(dev[i])
+
+    # Test connectivity 0->1 and 1->0
+    hwsim_utils.test_connectivity(dev[0], dev[1])
+
 def test_wpas_mesh_password_mismatch(dev, apdev):
     """Mesh network and one device with mismatching password"""
     check_mesh_support(dev[0], secure=True)