aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-06-03 21:40:38 (GMT)
committerJouni Malinen <j@w1.fi>2016-06-03 21:40:38 (GMT)
commita64476403daa029a01e51eaca989f70c538472bc (patch)
tree92988848d024740fe8ae74278a72e94bfa65346e /tests
parentb0ec3d772af1a9d68b215e32be556b8cd11512df (diff)
downloadhostap-a64476403daa029a01e51eaca989f70c538472bc.zip
hostap-a64476403daa029a01e51eaca989f70c538472bc.tar.gz
hostap-a64476403daa029a01e51eaca989f70c538472bc.tar.bz2
tests: Mesh and local failures
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_wpas_mesh.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py
index d14fad0..3944fb1 100644
--- a/tests/hwsim/test_wpas_mesh.py
+++ b/tests/hwsim/test_wpas_mesh.py
@@ -1112,3 +1112,46 @@ def test_mesh_sae_failure(dev, apdev):
dev[1].mesh_group_remove()
check_mesh_group_removed(dev[0])
check_mesh_group_removed(dev[1])
+
+def test_mesh_failure(dev, apdev):
+ """Mesh and local failures"""
+ check_mesh_support(dev[0])
+
+ funcs = [ (1, "ap_sta_add;mesh_mpm_add_peer", True),
+ (1, "wpabuf_alloc;mesh_mpm_send_plink_action", True) ]
+ for count, func, success in funcs:
+ add_open_mesh_network(dev[0])
+
+ with alloc_fail(dev[1], count, func):
+ add_open_mesh_network(dev[1])
+ check_mesh_group_added(dev[0])
+ check_mesh_group_added(dev[1])
+ if success:
+ # retry is expected to work
+ check_mesh_peer_connected(dev[0])
+ check_mesh_peer_connected(dev[1])
+ else:
+ wait_fail_trigger(dev[1], "GET_ALLOC_FAIL")
+ dev[0].mesh_group_remove()
+ dev[1].mesh_group_remove()
+ check_mesh_group_removed(dev[0])
+ check_mesh_group_removed(dev[1])
+
+ funcs = [ (1, "mesh_mpm_init_link", True) ]
+ for count, func, success in funcs:
+ add_open_mesh_network(dev[0])
+
+ with fail_test(dev[1], count, func):
+ add_open_mesh_network(dev[1])
+ check_mesh_group_added(dev[0])
+ check_mesh_group_added(dev[1])
+ if success:
+ # retry is expected to work
+ check_mesh_peer_connected(dev[0])
+ check_mesh_peer_connected(dev[1])
+ else:
+ wait_fail_trigger(dev[1], "GET_FAIL")
+ dev[0].mesh_group_remove()
+ dev[1].mesh_group_remove()
+ check_mesh_group_removed(dev[0])
+ check_mesh_group_removed(dev[1])