aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-06-12 21:04:47 (GMT)
committerJouni Malinen <j@w1.fi>2016-06-12 21:04:47 (GMT)
commit0b1b2044cc6c0edd016ab934270b5527ed9314bf (patch)
tree5947694e56c1b1e5b66638c3be7eb8c249b671b3 /tests
parent7a69fad7aded13fff654282134e9d98de7dafdfd (diff)
downloadhostap-0b1b2044cc6c0edd016ab934270b5527ed9314bf.zip
hostap-0b1b2044cc6c0edd016ab934270b5527ed9314bf.tar.gz
hostap-0b1b2044cc6c0edd016ab934270b5527ed9314bf.tar.bz2
tests: Add sniffer check to wpas_mesh_max_peering
This verifies that the Accepting Additional Mesh Peerings field is being cleared properly when the maximum peer links count is reached. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_wpas_mesh.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py
index fc0abca..69762ab 100644
--- a/tests/hwsim/test_wpas_mesh.py
+++ b/tests/hwsim/test_wpas_mesh.py
@@ -515,7 +515,7 @@ def test_wpas_mesh_dynamic_interface(dev):
if mesh1:
dev[1].request("MESH_GROUP_REMOVE " + mesh1)
-def test_wpas_mesh_max_peering(dev, apdev):
+def test_wpas_mesh_max_peering(dev, apdev, params):
"""Mesh max peering limit"""
check_mesh_support(dev[0])
try:
@@ -551,6 +551,40 @@ def test_wpas_mesh_max_peering(dev, apdev):
finally:
dev[0].request("SET max_peer_links 99")
+ addr0 = dev[0].own_addr()
+ addr1 = dev[1].own_addr()
+ addr2 = dev[2].own_addr()
+
+ capfile = os.path.join(params['logdir'], "hwsim0.pcapng")
+ filt = "wlan.fc.type_subtype == 8"
+ out = run_tshark(capfile, filt, [ "wlan.sa", "wlan.mesh.config.cap" ])
+ pkts = out.splitlines()
+ one = [ 0, 0, 0 ]
+ zero = [ 0, 0, 0 ]
+ for pkt in pkts:
+ addr, cap = pkt.split('\t')
+ cap = int(cap, 16)
+ if addr == addr0:
+ idx = 0
+ elif addr == addr1:
+ idx = 1
+ elif addr == addr2:
+ idx = 2
+ else:
+ continue
+ if cap & 0x01:
+ one[idx] += 1
+ else:
+ zero[idx] += 1
+ logger.info("one: " + str(one))
+ logger.info("zero: " + str(zero))
+ if zero[0] == 0:
+ raise Exception("Accepting Additional Mesh Peerings not cleared")
+ if one[0] == 0:
+ raise Exception("Accepting Additional Mesh Peerings was not set in the first Beacon frame")
+ if zero[1] > 0 or zero[2] > 0 or one[1] == 0 or one[2] == 0:
+ raise Exception("Unexpected value in Accepting Additional Mesh Peerings from other STAs")
+
def test_wpas_mesh_open_5ghz(dev, apdev):
"""wpa_supplicant open MESH network on 5 GHz band"""
try: