mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 02:39:52 +00:00
[thread-cert] support to get link-local address of the infra interface (#10603)
This commit targets to support getting infra link-local address of a OtbrNode in docker test, which is usefully for future test cases. The test_multi_ail.py is also updated to test the new method added.
This commit is contained in:
@@ -3804,6 +3804,8 @@ class LinuxHost():
|
||||
"""
|
||||
if address_type == config.ADDRESS_TYPE.BACKBONE_GUA:
|
||||
return self._getBackboneGua()
|
||||
elif address_type == config.ADDRESS_TYPE.BACKBONE_LINK_LOCAL:
|
||||
return self._getInfraLinkLocalAddress()
|
||||
elif address_type == config.ADDRESS_TYPE.ONLINK_ULA:
|
||||
return self._getInfraUla()
|
||||
elif address_type == config.ADDRESS_TYPE.ONLINK_GUA:
|
||||
@@ -3835,6 +3837,15 @@ class LinuxHost():
|
||||
gua_prefix = config.ONLINK_GUA_PREFIX.split('::/')[0]
|
||||
return [addr for addr in self.get_ether_addrs() if addr.startswith(gua_prefix)]
|
||||
|
||||
def _getInfraLinkLocalAddress(self) -> Optional[str]:
|
||||
""" Returns the link-local address autoconfigured on the infra link, which is started with "fe80".
|
||||
"""
|
||||
for addr in self.get_ether_addrs():
|
||||
if re.match(config.LINK_LOCAL_REGEX_PATTERN, addr, re.I):
|
||||
return addr
|
||||
|
||||
return None
|
||||
|
||||
def ping(self, *args, **kwargs):
|
||||
backbone = kwargs.pop('backbone', False)
|
||||
if backbone:
|
||||
|
||||
Reference in New Issue
Block a user