From a74a1e4eab352477e97ce168f409e34729000e34 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 26 Nov 2015 17:56:45 +0200 Subject: [PATCH] tests: Open mesh network on VHT 80+80 MHz channel Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_mesh.py | 52 ++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py index 71fa3a170..3b56df36a 100644 --- a/tests/hwsim/test_wpas_mesh.py +++ b/tests/hwsim/test_wpas_mesh.py @@ -103,12 +103,14 @@ def test_wpas_add_set_remove_support(dev): dev[0].remove_network(id) def add_open_mesh_network(dev, freq="2412", start=True, beacon_int=0, - basic_rates=None): + basic_rates=None, chwidth=0): id = dev.add_network() dev.set_network(id, "mode", "5") dev.set_network_quoted(id, "ssid", "wpas-mesh-open") dev.set_network(id, "key_mgmt", "NONE") dev.set_network(id, "frequency", freq) + if chwidth > 0: + dev.set_network(id, "max_oper_chwidth", str(chwidth)) if beacon_int: dev.set_network(id, "beacon_int", str(beacon_int)) if basic_rates: @@ -511,6 +513,54 @@ def _test_wpas_mesh_open_5ghz(dev, apdev): # Test connectivity 0->1 and 1->0 hwsim_utils.test_connectivity(dev[0], dev[1]) +def test_wpas_mesh_open_vht_80p80(dev, apdev): + """wpa_supplicant open MESH network on VHT 80+80 MHz channel""" + try: + _test_wpas_mesh_open_vht_80p80(dev, apdev) + finally: + subprocess.call(['iw', 'reg', 'set', '00']) + dev[0].flush_scan_cache() + dev[1].flush_scan_cache() + +def _test_wpas_mesh_open_vht_80p80(dev, apdev): + check_mesh_support(dev[0]) + subprocess.call(['iw', 'reg', 'set', 'US']) + 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=US" in ev: + break + add_open_mesh_network(dev[i], freq="5180", chwidth=3) + + # 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=80+80 MHz" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig)) + if "CENTER_FRQ1=5210" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(3): " + str(sig)) + if "CENTER_FRQ2=5775" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(4): " + str(sig)) + + sig = dev[1].request("SIGNAL_POLL").splitlines() + if "WIDTH=80+80 MHz" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(2b): " + str(sig)) + if "CENTER_FRQ1=5210" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(3b): " + str(sig)) + if "CENTER_FRQ2=5775" not in sig: + raise Exception("Unexpected SIGNAL_POLL value(4b): " + 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)