aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-01-11 08:44:07 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-13 13:05:26 (GMT)
commitf5a270b5dcde5c0f25ac7a5a24955b57a562d645 (patch)
tree774513e061e9c4c554bc91b7fa16b10bba84942a /tests
parentf09095d57bc1198c033c558e9b56fd72721022ec (diff)
downloadhostap-f5a270b5dcde5c0f25ac7a5a24955b57a562d645.zip
hostap-f5a270b5dcde5c0f25ac7a5a24955b57a562d645.tar.gz
hostap-f5a270b5dcde5c0f25ac7a5a24955b57a562d645.tar.bz2
tests: Add a test for mesh forwarding
Add a new test that tests connectivity between two stations that can't reach each other directly in the mesh, but need forwarding on another station to talk to each other. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/hwsim_utils.py8
-rw-r--r--tests/hwsim/test_wpas_mesh.py23
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/hwsim/hwsim_utils.py b/tests/hwsim/hwsim_utils.py
index b2a5814..c74af2f 100644
--- a/tests/hwsim/hwsim_utils.py
+++ b/tests/hwsim/hwsim_utils.py
@@ -187,3 +187,11 @@ def set_powersave(dev, val):
(res, data) = dev.cmd_execute(["echo", data, ">", fname], shell=True)
if res != 0:
raise Exception("Failed to set power save for device")
+
+def set_group_map(dev, val):
+ phy = dev.get_driver_status_field("phyname")
+ fname = '/sys/kernel/debug/ieee80211/%s/hwsim/group' % phy
+ data = '%d' % val
+ (res, data) = dev.cmd_execute(["echo", data, ">", fname], shell=True)
+ if res != 0:
+ raise Exception("Failed to set group map for %s" % phy)
diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py
index 6ea79fc..9ff85a6 100644
--- a/tests/hwsim/test_wpas_mesh.py
+++ b/tests/hwsim/test_wpas_mesh.py
@@ -17,6 +17,7 @@ from wpasupplicant import WpaSupplicant
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
def check_mesh_support(dev, secure=False):
if "MESH" not in dev.get_capability("modes"):
@@ -2034,3 +2035,25 @@ def test_mesh_select_network(dev):
check_mesh_peer_connected(dev[0])
check_mesh_peer_connected(dev[1])
hwsim_utils.test_connectivity(dev[0], dev[1])
+
+def test_mesh_forwarding(dev):
+ """Mesh with two stations that can't reach each other directly"""
+ try:
+ set_group_map(dev[0], 1)
+ set_group_map(dev[1], 3)
+ set_group_map(dev[2], 2)
+ check_mesh_support(dev[0])
+ for i in range(3):
+ add_open_mesh_network(dev[i])
+ check_mesh_group_added(dev[i])
+ for i in range(3):
+ check_mesh_peer_connected(dev[i])
+
+ hwsim_utils.test_connectivity(dev[0], dev[1])
+ hwsim_utils.test_connectivity(dev[1], dev[2])
+ hwsim_utils.test_connectivity(dev[0], dev[2])
+ finally:
+ # reset groups
+ set_group_map(dev[0], 1)
+ set_group_map(dev[1], 1)
+ set_group_map(dev[2], 1)