mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[tests] add traffic analysis for Cert_5_2_05_AddressQuery.py (#2173)
Add a fuction in node.py node_cli.py to node's address. Add a module command to verify commands. Spinel-cli.py doesn't request address for dhcp prefix now, so put Cert_5_2_05_AddressQuery.py in XFAIL on ncp.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import ipv6
|
||||
|
||||
import network_layer
|
||||
import config
|
||||
|
||||
def check_address_notification(command_msg, source_node, destination_node):
|
||||
"""Verify source_node sent a properly formatted Address Notification command message to destination_node.
|
||||
"""
|
||||
command_msg.assertCoapMessageRequestUriPath('/a/an')
|
||||
command_msg.assertCoapMessageContainsTlv(network_layer.TargetEid)
|
||||
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."
|
||||
Reference in New Issue
Block a user