[thread-cert] add case 5.8.4 SecurityPolicyTLV using pktverify (#5967)

This commit is contained in:
Jing Ma
2020-12-18 08:05:08 -08:00
committed by GitHub
parent a8198d0aa0
commit 0e105524cb
8 changed files with 447 additions and 3 deletions
+13 -2
View File
@@ -1333,10 +1333,12 @@ class NodeImpl:
self._expect('Conflict:', timeout=timeout)
def scan(self):
def scan(self, result=1):
self.send_command('scan')
return self._expect_results(r'\|\s(\S+)\s+\|\s(\S+)\s+\|\s([0-9a-fA-F]{4})\s\|\s([0-9a-fA-F]{16})\s\|\s(\d+)')
if result == 1:
return self._expect_results(
r'\|\s(\S+)\s+\|\s(\S+)\s+\|\s([0-9a-fA-F]{4})\s\|\s([0-9a-fA-F]{16})\s\|\s(\d+)')
def ping(self, ipaddr, num_responses=1, size=None, timeout=5):
cmd = 'ping %s' % ipaddr
@@ -1387,6 +1389,7 @@ class NodeImpl:
channel=None,
channel_mask=None,
master_key=None,
security_policy=[],
):
self.send_command('dataset clear')
self._expect('Done')
@@ -1415,6 +1418,14 @@ class NodeImpl:
self.send_command(cmd)
self._expect('Done')
if security_policy and len(security_policy) == 2:
cmd = 'dataset securitypolicy %s %s' % (
str(security_policy[0]),
security_policy[1],
)
self.send_command(cmd)
self._expect('Done')
# Set the meshlocal prefix in config.py
self.send_command('dataset meshlocalprefix %s' % config.MESH_LOCAL_PREFIX.split('/')[0])
self._expect('Done')