[tests] add traffic analysis for Cert_5_2_01 as TestPlan (#2463)

This commit modifies the method assertSentToNode to confirm if the destination Mac address of
the message is the node's Mac address. Add method check_parent_request, check_parent_response,
check_child_id_request and check_child_id_request to command.py.
This commit is contained in:
Zhanglong Xia
2018-01-15 19:36:38 +00:00
committed by Jonathan Hui
parent 33065099e1
commit 836377093e
6 changed files with 238 additions and 84 deletions
+10
View File
@@ -270,6 +270,16 @@ class Message(object):
if dst_addr == ipaddress.ip_address(addr):
sent_to_node = True
if self.mac_header.dest_address.type == common.MacAddressType.SHORT:
mac_address = common.MacAddress.from_rloc16(node.get_addr16())
if self.mac_header.dest_address == mac_address:
sent_to_node = True
elif self.mac_header.dest_address.type == common.MacAddressType.LONG:
mac_address = common.MacAddress.from_eui64(bytearray(node.get_addr64(), encoding="utf-8"))
if self.mac_header.dest_address == mac_address:
sent_to_node = True
assert sent_to_node == True
def assertSentToDestinationAddress(self, ipv6_address):