From 56d62fc3dd78fa1df0a49daa10dbff828a68eafe Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 4 Jun 2016 21:31:51 +0300 Subject: [PATCH] tests: Open mesh network on VHT 160 MHz channel Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_mesh.py | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py index b199f5a21..e359472eb 100644 --- a/tests/hwsim/test_wpas_mesh.py +++ b/tests/hwsim/test_wpas_mesh.py @@ -629,6 +629,56 @@ def _test_wpas_mesh_open_vht_80p80(dev, apdev): if "CENTER_FRQ2=5775" not in sig: raise Exception("Unexpected SIGNAL_POLL value(4b): " + str(sig)) +def test_mesh_open_vht_160(dev, apdev): + """Open mesh network on VHT 160 MHz channel""" + try: + _test_mesh_open_vht_160(dev, apdev) + finally: + subprocess.call(['iw', 'reg', 'set', '00']) + dev[0].flush_scan_cache() + dev[1].flush_scan_cache() + +def _test_mesh_open_vht_160(dev, apdev): + check_mesh_support(dev[0]) + subprocess.call(['iw', 'reg', 'set', 'ZA']) + for i in range(2): + for j in range(5): + ev = dev[i].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=5) + if ev is None: + raise Exception("No regdom change event") + if "alpha2=ZA" in ev: + break + + cmd = subprocess.Popen(["iw", "reg", "get"], stdout=subprocess.PIPE) + reg = cmd.stdout.read() + if "@ 160)" not in reg: + raise HwsimSkip("160 MHz channel not supported in regulatory information") + + add_open_mesh_network(dev[i], freq="5520", chwidth=2) + + # Check for mesh joined + check_mesh_group_added(dev[0]) + check_mesh_group_added(dev[1]) + + # Check for peer connected + check_mesh_peer_connected(dev[0]) + check_mesh_peer_connected(dev[1]) + + # Test connectivity 0->1 and 1->0 + hwsim_utils.test_connectivity(dev[0], dev[1]) + + sig = dev[0].request("SIGNAL_POLL").splitlines() + if "WIDTH=160 MHz" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig)) + if "FREQUENCY=5520" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig)) + + sig = dev[1].request("SIGNAL_POLL").splitlines() + if "WIDTH=160 MHz" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(2b): " + str(sig)) + if "FREQUENCY=5520" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(3b): " + str(sig)) + def test_wpas_mesh_password_mismatch(dev, apdev): """Mesh network and one device with mismatching password""" check_mesh_support(dev[0], secure=True)