[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:
hjian2017
2017-09-13 16:44:56 +08:00
committed by Jonathan Hui
parent 79f8a5a82b
commit d6a3519036
6 changed files with 191 additions and 75 deletions
+19
View File
@@ -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."