def test_iptables_raw(self, mock): table = 'filter' expected = ['/usr/bin/sudo', '-n', 'iptables', '--line-numbers', '-L', '-nv', '-t', '%s' % table] commands.iptables_raw(table) mock.assert_called_once_with(expected, **self.subprocess_args)
def test_iptables_raw(self, mock): table = 'filter' expected = [ '/usr/bin/sudo', '-n', 'iptables', '-v', '-S', '-t', '%s' % table ] commands.iptables_raw(table) mock.assert_called_once_with(expected, **self.subprocess_args)
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))
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))