Attila Fazekas | aeeeefd | 2013-08-06 17:01:56 +0200 | [diff] [blame] | 1 | # All Rights Reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | from tempest.common import commands |
| 16 | from tempest import config |
| 17 | |
| 18 | from tempest.openstack.common import log as logging |
| 19 | |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 20 | CONF = config.CONF |
Attila Fazekas | aeeeefd | 2013-08-06 17:01:56 +0200 | [diff] [blame] | 21 | LOG = logging.getLogger(__name__) |
| 22 | |
| 23 | tables = ['filter', 'nat', 'mangle'] |
| 24 | |
| 25 | |
| 26 | def log_ip_ns(): |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 27 | if not CONF.debug.enable: |
Attila Fazekas | aeeeefd | 2013-08-06 17:01:56 +0200 | [diff] [blame] | 28 | return |
| 29 | LOG.info("Host Addr:\n" + commands.ip_addr_raw()) |
| 30 | LOG.info("Host Route:\n" + commands.ip_route_raw()) |
| 31 | for table in ['filter', 'nat', 'mangle']: |
| 32 | LOG.info('Host %s table:\n%s', table, commands.iptables_raw(table)) |
| 33 | ns_list = commands.ip_ns_list() |
| 34 | LOG.info("Host ns list" + str(ns_list)) |
| 35 | for ns in ns_list: |
| 36 | LOG.info("ns(%s) Addr:\n%s", ns, commands.ip_ns_addr(ns)) |
| 37 | LOG.info("ns(%s) Route:\n%s", ns, commands.ip_ns_route(ns)) |
| 38 | for table in ['filter', 'nat', 'mangle']: |
| 39 | LOG.info('ns(%s) table(%s):\n%s', ns, table, |
| 40 | commands.iptables_ns(ns, table)) |