[posix] handle dynamic infra if status (#6186)

This commit includes below changes:

- handles dynamic infrastructure interface status changes. The Routing
  Manager will be started if the infra interface status turns to be
  RUNNING and a valid link-local address is present. Otherwise, the
  Routing Manager will be stopped.

- changes the default status of the Routing Manager from enabled to
  disabled and it is initially enabled for the posix platform.

- the posix implementation now doesn't require the presence of the
  link-local address at initialization stage. In this case, the
  Routing Manager will not be started before a link-local address is
  added to the infra interface.

- add CI tests for the new behavior.
This commit is contained in:
kangping
2021-02-25 13:19:31 -08:00
committed by GitHub
parent b45f287629
commit da0d9f66b6
12 changed files with 432 additions and 106 deletions
+12
View File
@@ -2592,6 +2592,18 @@ class LinuxHost():
PING_RESPONSE_PATTERN = re.compile(r'\d+ bytes from .*:.*')
ETH_DEV = config.BACKBONE_IFNAME
def enable_ether(self):
"""Enable the ethernet interface.
"""
self.bash(f'ifconfig {self.ETH_DEV} up')
def disable_ether(self):
"""Disable the ethernet interface.
"""
self.bash(f'ifconfig {self.ETH_DEV} down')
def get_ether_addrs(self):
output = self.bash(f'ip -6 addr list dev {self.ETH_DEV}')