예제 #1
0
    def EnableIpv6(self, interfaces, logger, dhclient_script=None):
        """Configure the network interfaces for IPv6 using dhclient.

    Args:
      interface: string, the output device names for enabling IPv6.
      logger: logger object, used to write to SysLog and serial port.
      dhclient_script: string, the path to a dhclient script used by dhclient.
    """
        helpers.CallEnableRouteAdvertisements(interfaces, logger)
        helpers.CallDhclientIpv6(interfaces, logger)
 def testEnableRouteAdvertisements(self, mock_call):
     mock_logger = mock.Mock()
     interfaces = ['foo', 'bar', 'baz']
     helpers.CallEnableRouteAdvertisements(interfaces, mock_logger)
     mock_call.assert_has_calls([
         mock.call([
             'sysctl',
             '-w',
             'net.ipv6.conf.%s.accept_ra_rt_info_max_plen=128' % interface,
         ]) for interface in interfaces
     ])