mirror of
https://github.com/espressif/openthread.git
synced 2026-09-12 04:00:10 +00:00
[tests] add traffic analysis for Cert_5_3_10 as TestPlan (#2502)
This commit is contained in:
committed by
Jonathan Hui
parent
d7edaae158
commit
9d4f367e6d
@@ -207,3 +207,22 @@ def check_child_id_response(command_msg, route64 = CheckType.OPTIONAL, network_d
|
||||
check_mle_optional_tlv(command_msg, pending_timestamp, mle.PendingTimestamp)
|
||||
check_mle_optional_tlv(command_msg, active_operational_dataset, mle.ActiveOperationalDataset)
|
||||
check_mle_optional_tlv(command_msg, pending_operational_dataset, mle.PendingOperationalDataset)
|
||||
|
||||
def check_coap_optional_tlv(coap_msg, type, tlv):
|
||||
if (type == CheckType.CONTAIN):
|
||||
coap_msg.assertCoapMessageContainsTlv(tlv)
|
||||
elif (type == CheckType.NOT_CONTAIN):
|
||||
coap_msg.assertCoapMessageDoesNotContainTlv(tlv)
|
||||
elif (type == CheckType.OPTIONAL):
|
||||
coap_msg.assertCoapMessageContainsOptionalTlv(tlv)
|
||||
else:
|
||||
raise ValueError("Invalid check type")
|
||||
|
||||
def check_router_id_cached(node, router_id, cached = True):
|
||||
"""Verify if the node has cached any entries based on the router ID
|
||||
"""
|
||||
eidcaches = node.get_eidcaches()
|
||||
if cached:
|
||||
assert any(router_id == (int(rloc, 16) >> 10) for (_, rloc) in eidcaches)
|
||||
else:
|
||||
assert any(router_id == (int(rloc, 16) >> 10) for (_, rloc) in eidcaches) is False
|
||||
|
||||
Reference in New Issue
Block a user