[tests] add traffic analysis for Cert_5_3_08 as TestPlan (#2484)

This commit adds the method set_lowpan_context to set the lowpan context of sniffer.
This commit is contained in:
Zhanglong Xia
2018-01-22 16:48:00 +00:00
committed by Jonathan Hui
parent 092021ad45
commit 2636df1952
8 changed files with 161 additions and 52 deletions
+12
View File
@@ -32,6 +32,7 @@ import sys
import time
import pexpect
import re
import ipaddress
import config
@@ -388,6 +389,17 @@ class otCli:
return addrs
def get_addr(self, prefix):
network = ipaddress.ip_network(unicode(prefix))
addrs = self.get_addrs()
for addr in addrs:
ipv6_address = ipaddress.ip_address(addr.decode("utf-8"))
if ipv6_address in network:
return ipv6_address.exploded.encode('utf-8')
return None
def add_service(self, enterpriseNumber, serviceData, serverData):
cmd = 'service add ' + enterpriseNumber + ' ' + serviceData+ ' ' + serverData
self.send_command(cmd)