[tests] initialize mesh-local prefix instead of extended pan id (#7668)

This commit is contained in:
Jonathan Hui
2022-05-09 09:15:11 -07:00
committed by GitHub
parent 8907cb8495
commit 85382902ac
2 changed files with 9 additions and 2 deletions
-1
View File
@@ -45,7 +45,6 @@ import sniffer
from tlvs_parsing import SubTlvsFactory
# This extended address will generate the MESH_LOCAL_PREFIX
EXTENDED_PANID = '000db80000000000'
MESH_LOCAL_PREFIX = 'fd00:db8::/64'
MESH_LOCAL_PREFIX_REGEX_PATTERN = '^fd00:0?db8:0{0,4}:0{0,4}'
ROUTING_LOCATOR = '64/:0:ff:fe00:/16'
+9 -1
View File
@@ -614,7 +614,7 @@ class NodeImpl:
super().__init__(nodeid, **kwargs)
self.set_extpanid(config.EXTENDED_PANID)
self.set_mesh_local_prefix(config.MESH_LOCAL_PREFIX)
self.set_addr64('%016x' % (thread_cert.EXTENDED_ADDRESS_BASE + nodeid))
def _expect(self, pattern, timeout=-1, *args, **kwargs):
@@ -1417,6 +1417,14 @@ class NodeImpl:
self.send_command('extpanid')
return self._expect_result('[0-9a-fA-F]{16}')
def get_mesh_local_prefix(self):
self.send_command('prefix meshlocal')
return self._expect_command_output()[0]
def set_mesh_local_prefix(self, mesh_local_prefix):
self.send_command('prefix meshlocal %s' % mesh_local_prefix)
self._expect_done()
def get_joiner_id(self):
self.send_command('joiner id')
return self._expect_result('[0-9a-fA-F]{16}')