Example #1
0
def log_ip_ns():
    if not CONF.debug.enable:
        return
    LOG.info("Host Addr:\n" + commands.ip_addr_raw())
    LOG.info("Host Route:\n" + commands.ip_route_raw())
    for table in TABLES:
        LOG.info('Host %s table:\n%s', table, commands.iptables_raw(table))
    ns_list = commands.ip_ns_list()
    LOG.info("Host ns list" + str(ns_list))
    for ns in ns_list:
        LOG.info("ns(%s) Addr:\n%s", ns, commands.ip_ns_addr(ns))
        LOG.info("ns(%s) Route:\n%s", ns, commands.ip_ns_route(ns))
        for table in TABLES:
            LOG.info('ns(%s) table(%s):\n%s', ns, table,
                     commands.iptables_ns(ns, table))
Example #2
0
def log_ip_ns():
    if not config.TempestConfig().debug.enable:
        return
    LOG.info("Host Addr:\n" + commands.ip_addr_raw())
    LOG.info("Host Route:\n" + commands.ip_route_raw())
    for table in ['filter', 'nat', 'mangle']:
        LOG.info('Host %s table:\n%s', table, commands.iptables_raw(table))
    ns_list = commands.ip_ns_list()
    LOG.info("Host ns list" + str(ns_list))
    for ns in ns_list:
        LOG.info("ns(%s) Addr:\n%s", ns, commands.ip_ns_addr(ns))
        LOG.info("ns(%s) Route:\n%s", ns, commands.ip_ns_route(ns))
        for table in ['filter', 'nat', 'mangle']:
            LOG.info('ns(%s) table(%s):\n%s', ns, table,
                     commands.iptables_ns(ns, table))
Example #3
0
 def test_ip_addr_raw(self, mock):
     expected = ['/usr/bin/sudo', '-n', 'ip', 'a']
     commands.ip_addr_raw()
     mock.assert_called_once_with(expected, **self.subprocess_args)
Example #4
0
 def test_ip_addr_raw(self, mock):
     expected = ['/usr/bin/sudo', '-n', 'ip', 'a']
     commands.ip_addr_raw()
     mock.assert_called_once_with(expected, **self.subprocess_args)