mirror of
https://github.com/espressif/openthread.git
synced 2026-08-11 13:17:48 +00:00
[thread-cert] add case 5.8.4 SecurityPolicyTLV using pktverify (#5967)
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user