mirror of
https://github.com/espressif/openthread.git
synced 2026-08-10 20:57:47 +00:00
[tests] dd traffic analysis for Cert_5_2_06_RouterDowngrade.py (#2192)
Also add a method in command.py to verify a properly formatted address release command message.
This commit is contained in:
@@ -11,9 +11,18 @@ def check_address_notification(command_msg, source_node, destination_node):
|
||||
command_msg.assertCoapMessageContainsTlv(network_layer.Rloc16)
|
||||
command_msg.assertCoapMessageContainsTlv(network_layer.MlEid)
|
||||
|
||||
#pdb.set_trace()
|
||||
source_rloc = source_node.get_ip6_address(config.ADDRESS_TYPE.RLOC)
|
||||
assert ipv6.ip_address(source_rloc) == command_msg.ipv6_packet.ipv6_header.source_address, "Error: The IPv6 Source address is not the RLOC of the originator."
|
||||
|
||||
destination_rloc = destination_node.get_ip6_address(config.ADDRESS_TYPE.RLOC)
|
||||
assert ipv6.ip_address(destination_rloc) == command_msg.ipv6_packet.ipv6_header.destination_address, "Error: The IPv6 Destination address is not the RLOC of the destination."
|
||||
|
||||
def check_address_release(command_msg, destination_node):
|
||||
"""Verify the message is a properly formatted address release destined to the given node.
|
||||
"""
|
||||
command_msg.assertCoapMessageRequestUriPath('/a/ar')
|
||||
command_msg.assertCoapMessageContainsTlv(network_layer.Rloc16)
|
||||
command_msg.assertCoapMessageContainsTlv(network_layer.MacExtendedAddress)
|
||||
|
||||
destination_rloc = destination_node.get_ip6_address(config.ADDRESS_TYPE.RLOC)
|
||||
assert ipv6.ip_address(destination_rloc) == command_msg.ipv6_packet.ipv6_header.destination_address, "Error: The Destination is not RLOC address"
|
||||
|
||||
Reference in New Issue
Block a user