Drop log translations

Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I9d37ae28a3fecbe910e60dc7f22e229a7b65940c
This commit is contained in:
Gary Kotton 2017-03-26 04:41:58 -07:00
parent 8577607d48
commit c8415a8a12
18 changed files with 125 additions and 161 deletions

View File

@ -27,16 +27,6 @@ _C = _translators.contextual_form
# The plural translation function using the name "_P" # The plural translation function using the name "_P"
_P = _translators.plural_form _P = _translators.plural_form
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical
def get_available_languages(): def get_available_languages():
return oslo_i18n.get_available_languages(DOMAIN) return oslo_i18n.get_available_languages(DOMAIN)

View File

@ -21,8 +21,6 @@ from tempest import config
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _ from vmware_nsx_tempest._i18n import _
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest._i18n import _LW
from vmware_nsx_tempest.common import constants from vmware_nsx_tempest.common import constants
from vmware_nsx_tempest.services import l2_gateway_client from vmware_nsx_tempest.services import l2_gateway_client
from vmware_nsx_tempest.services import l2_gateway_connection_client from vmware_nsx_tempest.services import l2_gateway_connection_client
@ -140,7 +138,7 @@ class BaseL2GatewayTest(base.BaseAdminNetworkTest):
_params = manager.default_params_withy_timeout_values.copy() _params = manager.default_params_withy_timeout_values.copy()
except AttributeError as attribute_err: except AttributeError as attribute_err:
LOG.warning( LOG.warning(
_LW("Failed to locate the attribute, Error: %(err_msg)s") % "Failed to locate the attribute, Error: %(err_msg)s",
{"err_msg": attribute_err.__str__()}) {"err_msg": attribute_err.__str__()})
_params = {} _params = {}
cls.l2gw_client = l2_gateway_client.L2GatewayClient( cls.l2gw_client = l2_gateway_client.L2GatewayClient(
@ -191,7 +189,7 @@ class BaseL2GatewayTest(base.BaseAdminNetworkTest):
:return: response of L2GW create API :return: response of L2GW create API
""" """
LOG.info(_LI("l2gw name: %(name)s, l2gw_param: %(devices)s ") % LOG.info("l2gw name: %(name)s, l2gw_param: %(devices)s ",
{"name": l2gw_name, "devices": l2gw_param}) {"name": l2gw_name, "devices": l2gw_param})
devices = [] devices = []
for device_dict in l2gw_param: for device_dict in l2gw_param:
@ -203,10 +201,10 @@ class BaseL2GatewayTest(base.BaseAdminNetworkTest):
"interfaces": interface} "interfaces": interface}
devices.append(device) devices.append(device)
l2gw_request_body = {"devices": devices} l2gw_request_body = {"devices": devices}
LOG.info(_LI(" l2gw_request_body: %s") % l2gw_request_body) LOG.info(" l2gw_request_body: %s", l2gw_request_body)
rsp = self.l2gw_client.create_l2_gateway( rsp = self.l2gw_client.create_l2_gateway(
name=l2gw_name, **l2gw_request_body) name=l2gw_name, **l2gw_request_body)
LOG.info(_LI(" l2gw response: %s") % rsp) LOG.info(" l2gw response: %s", rsp)
self.l2gw_created[rsp[constants.L2GW]["id"]] = rsp[constants.L2GW] self.l2gw_created[rsp[constants.L2GW]["id"]] = rsp[constants.L2GW]
return rsp, devices return rsp, devices
@ -218,9 +216,9 @@ class BaseL2GatewayTest(base.BaseAdminNetworkTest):
:return: response of the l2gw delete API. :return: response of the l2gw delete API.
""" """
LOG.info(_LI("L2GW id: %(id)s to be deleted.") % {"id": l2gw_id}) LOG.info("L2GW id: %(id)s to be deleted.", {"id": l2gw_id})
rsp = self.l2gw_client.delete_l2_gateway(l2gw_id) rsp = self.l2gw_client.delete_l2_gateway(l2gw_id)
LOG.info(_LI("response : %(rsp)s") % {"rsp": rsp}) LOG.info("response : %(rsp)s", {"rsp": rsp})
return rsp return rsp
def update_l2gw(self, l2gw_id, l2gw_new_name, devices): def update_l2gw(self, l2gw_id, l2gw_new_name, devices):
@ -256,16 +254,16 @@ class BaseL2GatewayTest(base.BaseAdminNetworkTest):
:return: response of L2GWC create API. :return: response of L2GWC create API.
""" """
LOG.info(_LI("l2gwc param: %(param)s ") % {"param": l2gwc_param}) LOG.info("l2gwc param: %(param)s ", {"param": l2gwc_param})
l2gwc_request_body = {"l2_gateway_id": l2gwc_param["l2_gateway_id"], l2gwc_request_body = {"l2_gateway_id": l2gwc_param["l2_gateway_id"],
"network_id": l2gwc_param["network_id"]} "network_id": l2gwc_param["network_id"]}
if "segmentation_id" in l2gwc_param: if "segmentation_id" in l2gwc_param:
l2gwc_request_body["segmentation_id"] = l2gwc_param[ l2gwc_request_body["segmentation_id"] = l2gwc_param[
"segmentation_id"] "segmentation_id"]
LOG.info(_LI("l2gwc_request_body: %s") % l2gwc_request_body) LOG.info("l2gwc_request_body: %s", l2gwc_request_body)
rsp = self.l2gwc_client.create_l2_gateway_connection( rsp = self.l2gwc_client.create_l2_gateway_connection(
**l2gwc_request_body) **l2gwc_request_body)
LOG.info(_LI("l2gwc response: %s") % rsp) LOG.info("l2gwc response: %s", rsp)
self.l2gwc_created[rsp[constants.L2GWC]["id"]] = rsp[constants.L2GWC] self.l2gwc_created[rsp[constants.L2GWC]["id"]] = rsp[constants.L2GWC]
return rsp return rsp
@ -277,8 +275,8 @@ class BaseL2GatewayTest(base.BaseAdminNetworkTest):
:return: response of the l2gwc delete API. :return: response of the l2gwc delete API.
""" """
LOG.info(_LI("L2GW connection id: %(id)s to be deleted") LOG.info("L2GW connection id: %(id)s to be deleted",
% {"id": l2gwc_id}) {"id": l2gwc_id})
rsp = self.l2gwc_client.delete_l2_gateway_connection(l2gwc_id) rsp = self.l2gwc_client.delete_l2_gateway_connection(l2gwc_id)
LOG.info(_LI("response : %(rsp)s") % {"rsp": rsp}) LOG.info("response : %(rsp)s", {"rsp": rsp})
return rsp return rsp

View File

@ -16,8 +16,6 @@ from oslo_log import log
from tempest.lib.services.network import base from tempest.lib.services.network import base
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest._i18n import _LW
from vmware_nsx_tempest.common import constants from vmware_nsx_tempest.common import constants
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
@ -36,31 +34,31 @@ class L2GatewayClient(base.BaseNetworkClient):
def create_l2_gateway(self, **kwargs): def create_l2_gateway(self, **kwargs):
uri = constants.L2_GWS_BASE_URI uri = constants.L2_GWS_BASE_URI
post_data = {constants.L2GW: kwargs} post_data = {constants.L2GW: kwargs}
LOG.info(_LI("URI : %(uri)s, posting data : %(post_data)s") % { LOG.info("URI : %(uri)s, posting data : %(post_data)s",
"uri": uri, "post_data": post_data}) {"uri": uri, "post_data": post_data})
return self.create_resource(uri, post_data) return self.create_resource(uri, post_data)
def update_l2_gateway(self, l2_gateway_id, **kwargs): def update_l2_gateway(self, l2_gateway_id, **kwargs):
uri = constants.L2_GWS_BASE_URI + "/" + l2_gateway_id uri = constants.L2_GWS_BASE_URI + "/" + l2_gateway_id
post_data = {constants.L2GW: kwargs} post_data = {constants.L2GW: kwargs}
constants.LOG.info( constants.LOG.info(
_LI("URI : %(uri)s, posting data : %(post_data)s") % { "URI : %(uri)s, posting data : %(post_data)s",
"uri": uri, "post_data": post_data}) {"uri": uri, "post_data": post_data})
return self.update_resource(uri, post_data) return self.update_resource(uri, post_data)
def show_l2_gateway(self, l2_gateway_id, **fields): def show_l2_gateway(self, l2_gateway_id, **fields):
uri = constants.L2_GWS_BASE_URI + "/" + l2_gateway_id uri = constants.L2_GWS_BASE_URI + "/" + l2_gateway_id
LOG.info(_LI("URI : %(uri)s") % {"uri": uri}) LOG.info("URI : %(uri)s", {"uri": uri})
return self.show_resource(uri, **fields) return self.show_resource(uri, **fields)
def delete_l2_gateway(self, l2_gateway_id): def delete_l2_gateway(self, l2_gateway_id):
uri = constants.L2_GWS_BASE_URI + "/" + l2_gateway_id uri = constants.L2_GWS_BASE_URI + "/" + l2_gateway_id
LOG.info(_LI("URI : %(uri)s") % {"uri": uri}) LOG.info("URI : %(uri)s", {"uri": uri})
return self.delete_resource(uri) return self.delete_resource(uri)
def list_l2_gateways(self, **filters): def list_l2_gateways(self, **filters):
uri = constants.L2_GWS_BASE_URI uri = constants.L2_GWS_BASE_URI
LOG.info(_LI("URI : %(uri)s") % {"uri": uri}) LOG.info("URI : %(uri)s", {"uri": uri})
return self.list_resources(uri, **filters) return self.list_resources(uri, **filters)
@ -73,7 +71,7 @@ def get_client(client_mgr):
net_client = getattr(manager, "networks_client") net_client = getattr(manager, "networks_client")
_params = manager.default_params_withy_timeout_values.copy() _params = manager.default_params_withy_timeout_values.copy()
except AttributeError as attribute_err: except AttributeError as attribute_err:
LOG.warning(_LW("Failed to locate the attribute, Error: %(err_msg)s") % LOG.warning("Failed to locate the attribute, Error: %(err_msg)s",
{"err_msg": attribute_err.__str__()}) {"err_msg": attribute_err.__str__()})
_params = {} _params = {}
client = L2GatewayClient(net_client.auth_provider, client = L2GatewayClient(net_client.auth_provider,

View File

@ -21,10 +21,6 @@ import six.moves.urllib.parse as urlparse
from oslo_log import log as logging from oslo_log import log as logging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from vmware_nsx_tempest._i18n import _LE
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest._i18n import _LW
requests.packages.urllib3.disable_warnings() requests.packages.urllib3.disable_warnings()
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -173,8 +169,8 @@ class NSXV3Client(object):
Return the logical port if found, otherwise return None. Return the logical port if found, otherwise return None.
""" """
if not os_name: if not os_name:
LOG.error(_LE("Name of OS port should be present " LOG.error("Name of OS port should be present "
"in order to query backend logical port created")) "in order to query backend logical port created")
return None return None
lports = self.get_logical_ports() lports = self.get_logical_ports()
return self.get_nsx_resource_by_name(lports, os_name) return self.get_nsx_resource_by_name(lports, os_name)
@ -217,7 +213,7 @@ class NSXV3Client(object):
endpoint = "/logical-ports/%s" % p['id'] endpoint = "/logical-ports/%s" % p['id']
response = self.put(endpoint=endpoint, body=p) response = self.put(endpoint=endpoint, body=p)
if response.status_code != requests.codes.ok: if response.status_code != requests.codes.ok:
LOG.error(_LE("Failed to update lport %s"), p['id']) LOG.error("Failed to update lport %s", p['id'])
def cleanup_os_logical_ports(self): def cleanup_os_logical_ports(self):
""" """
@ -225,7 +221,7 @@ class NSXV3Client(object):
""" """
lports = self.get_logical_ports() lports = self.get_logical_ports()
os_lports = self.get_os_resources(lports) os_lports = self.get_os_resources(lports)
LOG.info(_LI("Number of OS Logical Ports to be deleted: %s"), LOG.info("Number of OS Logical Ports to be deleted: %s",
len(os_lports)) len(os_lports))
# logical port vif detachment # logical port vif detachment
self.update_logical_port_attachment(os_lports) self.update_logical_port_attachment(os_lports)
@ -233,10 +229,10 @@ class NSXV3Client(object):
endpoint = '/logical-ports/%s' % p['id'] endpoint = '/logical-ports/%s' % p['id']
response = self.delete(endpoint=endpoint) response = self.delete(endpoint=endpoint)
if response.status_code == requests.codes.ok: if response.status_code == requests.codes.ok:
LOG.info(_LI("Successfully deleted logical port %s"), p['id']) LOG.info("Successfully deleted logical port %s", p['id'])
else: else:
LOG.error(_LE("Failed to delete lport %(port_id)s, response " LOG.error("Failed to delete lport %(port_id)s, response "
"code %(code)s"), "code %(code)s",
{'port_id': p['id'], 'code': response.status_code}) {'port_id': p['id'], 'code': response.status_code})
def get_os_resources(self, resources): def get_os_resources(self, resources):
@ -258,14 +254,14 @@ class NSXV3Client(object):
nsx_resource = [n for n in nsx_resources if nsx_resource = [n for n in nsx_resources if
n['display_name'] == nsx_name] n['display_name'] == nsx_name]
if len(nsx_resource) == 0: if len(nsx_resource) == 0:
LOG.warning(_LW("Backend nsx resource %s NOT found!"), nsx_name) LOG.warning("Backend nsx resource %s NOT found!", nsx_name)
return None return None
if len(nsx_resource) > 1: if len(nsx_resource) > 1:
LOG.error(_LE("More than 1 nsx resources found: %s!"), LOG.error("More than 1 nsx resources found: %s!",
nsx_resource) nsx_resource)
return None return None
else: else:
LOG.info(_LI("Found nsgroup: %s"), nsx_resource[0]) LOG.info("Found nsgroup: %s", nsx_resource[0])
return nsx_resource[0] return nsx_resource[0]
def get_logical_switches(self): def get_logical_switches(self):
@ -297,8 +293,8 @@ class NSXV3Client(object):
Return logical switch if found, otherwise return None Return logical switch if found, otherwise return None
""" """
if not os_name or not os_uuid: if not os_name or not os_uuid:
LOG.error(_LE("Name and uuid of OpenStack L2 network need to be " LOG.error("Name and uuid of OpenStack L2 network need to be "
"present in order to query backend logical switch!")) "present in order to query backend logical switch!")
return None return None
nsx_name = os_name + "_" + os_uuid[:5] + "..." + os_uuid[-5:] nsx_name = os_name + "_" + os_uuid[:5] + "..." + os_uuid[-5:]
lswitches = self.get_logical_switches() lswitches = self.get_logical_switches()
@ -322,9 +318,9 @@ class NSXV3Client(object):
Get the firewall section by os_name and os_uuid Get the firewall section by os_name and os_uuid
""" """
if not os_name or not os_uuid: if not os_name or not os_uuid:
LOG.error(_LE("Name and uuid of OS security group should be " LOG.error("Name and uuid of OS security group should be "
"present in order to query backend FW section " "present in order to query backend FW section "
"created")) "created")
return None return None
nsx_name = os_name + " - " + os_uuid nsx_name = os_name + " - " + os_uuid
fw_sections = self.get_firewall_sections() fw_sections = self.get_firewall_sections()
@ -378,8 +374,8 @@ class NSXV3Client(object):
Return nsgroup if found, otherwise return None Return nsgroup if found, otherwise return None
""" """
if not os_name or not os_uuid: if not os_name or not os_uuid:
LOG.error(_LE("Name and uuid of OS security group should be " LOG.error("Name and uuid of OS security group should be "
"present in order to query backend nsgroup created")) "present in order to query backend nsgroup created")
return None return None
nsx_name = os_name + " - " + os_uuid nsx_name = os_name + " - " + os_uuid
nsgroups = self.get_ns_groups() nsgroups = self.get_ns_groups()
@ -404,8 +400,8 @@ class NSXV3Client(object):
Return the logical router if found, otherwise return None. Return the logical router if found, otherwise return None.
""" """
if not os_name or not os_uuid: if not os_name or not os_uuid:
LOG.error(_LE("Name and uuid of OS router should be present " LOG.error("Name and uuid of OS router should be present "
"in order to query backend logical router created")) "in order to query backend logical router created")
return None return None
nsx_name = os_name + "_" + os_uuid[:5] + "..." + os_uuid[-5:] nsx_name = os_name + "_" + os_uuid[:5] + "..." + os_uuid[-5:]
lrouters = self.get_logical_routers() lrouters = self.get_logical_routers()
@ -423,8 +419,8 @@ class NSXV3Client(object):
Get all user defined NAT rules of the specific logical router Get all user defined NAT rules of the specific logical router
""" """
if not lrouter: if not lrouter:
LOG.error(_LE("Logical router needs to be present in order " LOG.error("Logical router needs to be present in order "
"to get the NAT rules")) "to get the NAT rules")
return None return None
endpoint = "/logical-routers/%s/nat/rules" % lrouter['id'] endpoint = "/logical-routers/%s/nat/rules" % lrouter['id']
return self.get_logical_resources(endpoint) return self.get_logical_resources(endpoint)
@ -432,8 +428,8 @@ class NSXV3Client(object):
def get_logical_router_advertisement(self, lrouter): def get_logical_router_advertisement(self, lrouter):
"""Get logical router advertisement""" """Get logical router advertisement"""
if not lrouter: if not lrouter:
LOG.error(_LE("Logical router needs to be present in order " LOG.error("Logical router needs to be present in order "
"to get router advertisement!")) "to get router advertisement!")
return None return None
endpoint = "/logical-routers/%s/routing/advertisement" % lrouter['id'] endpoint = "/logical-routers/%s/routing/advertisement" % lrouter['id']
response = self.get(endpoint) response = self.get(endpoint)
@ -454,9 +450,9 @@ class NSXV3Client(object):
Return logical dhcp server if found, otherwise return None Return logical dhcp server if found, otherwise return None
""" """
if not os_name or not os_uuid: if not os_name or not os_uuid:
LOG.error(_LE("Name and uuid of OpenStack L2 network need to be " LOG.error("Name and uuid of OpenStack L2 network need to be "
"present in order to query backend logical dhcp " "present in order to query backend logical dhcp "
"server!")) "server!")
return None return None
nsx_name = os_name + "_" + os_uuid[:5] + "..." + os_uuid[-5:] nsx_name = os_name + "_" + os_uuid[:5] + "..." + os_uuid[-5:]
dhcp_servers = self.get_logical_dhcp_servers() dhcp_servers = self.get_logical_dhcp_servers()

View File

@ -26,7 +26,6 @@ from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions from tempest.lib import exceptions
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.services.lbaas import health_monitors_client from vmware_nsx_tempest.services.lbaas import health_monitors_client
from vmware_nsx_tempest.services.lbaas import l7policies_client from vmware_nsx_tempest.services.lbaas import l7policies_client
from vmware_nsx_tempest.services.lbaas import l7rules_client from vmware_nsx_tempest.services.lbaas import l7rules_client
@ -153,12 +152,12 @@ class BaseTestCase(base.BaseNetworkTest):
super(BaseTestCase, cls).setUpClass() super(BaseTestCase, cls).setUpClass()
def setUp(cls): def setUp(cls):
cls.LOG.info(_LI('Starting: {0}').format(cls._testMethodName)) cls.LOG.info(('Starting: {0}').format(cls._testMethodName))
super(BaseTestCase, cls).setUp() super(BaseTestCase, cls).setUp()
def tearDown(cls): def tearDown(cls):
super(BaseTestCase, cls).tearDown() super(BaseTestCase, cls).tearDown()
cls.LOG.info(_LI('Finished: {0}').format(cls._testMethodName)) cls.LOG.info(('Finished: {0}').format(cls._testMethodName))
@classmethod @classmethod
def _create_load_balancer(cls, wait=True, **lb_kwargs): def _create_load_balancer(cls, wait=True, **lb_kwargs):

View File

@ -21,8 +21,6 @@ from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CONF = config.CONF CONF = config.CONF
@ -261,5 +259,5 @@ class SubnetPoolsTestJSON(base.BaseNetworkTest):
self.clean_subnet(subnet_client, subnet['subnet']['id']) self.clean_subnet(subnet_client, subnet['subnet']['id'])
except lib_exc.ServerFault: except lib_exc.ServerFault:
pass pass
LOG.info(_LI("Failed to allocate subnet: Insufficient " LOG.info("Failed to allocate subnet: Insufficient "
"prefix space to allocate subnet size")) "prefix space to allocate subnet size")

View File

@ -28,7 +28,6 @@ from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.services import nsxv_client from vmware_nsx_tempest.services import nsxv_client
from vmware_nsx_tempest.tests.nsxv.scenario import ( from vmware_nsx_tempest.tests.nsxv.scenario import (
manager_topo_deployment as dmgr) manager_topo_deployment as dmgr)
@ -125,14 +124,14 @@ class TestDHCP121BasicOps(dmgr.TopoDeployScenarioManager):
cmd = ('/sbin/route -n') cmd = ('/sbin/route -n')
out_data = client.exec_command(cmd) out_data = client.exec_command(cmd)
self.assertIn(Metadataserver_ip, out_data) self.assertIn(Metadataserver_ip, out_data)
LOG.info(_LI("Metadata routes available on vm")) LOG.info("Metadata routes available on vm")
cmd = ('wget http://169.254.169.254 -O sample.txt') cmd = ('wget http://169.254.169.254 -O sample.txt')
client.exec_command(cmd) client.exec_command(cmd)
cmd = ('cat sample.txt') cmd = ('cat sample.txt')
out_data = client.exec_command(cmd) out_data = client.exec_command(cmd)
# Check metadata server inforamtion available or not # Check metadata server inforamtion available or not
self.assertIn('latest', out_data) self.assertIn('latest', out_data)
LOG.info(_LI("metadata server is acessible")) LOG.info("metadata server is acessible")
# Fetch dhcp edge infor from nsx-v # Fetch dhcp edge infor from nsx-v
exc_edge = self.vsm.get_dhcp_edge_info() exc_edge = self.vsm.get_dhcp_edge_info()
self.assertIsNotNone(exc_edge) self.assertIsNotNone(exc_edge)
@ -186,7 +185,7 @@ class TestDHCP121BasicOps(dmgr.TopoDeployScenarioManager):
self.assertIn( self.assertIn(
_subnet_data['new_host_routes'][0]['nexthop'], out_data) _subnet_data['new_host_routes'][0]['nexthop'], out_data)
self.assertIn(self.nexthop_host_route, out_data) self.assertIn(self.nexthop_host_route, out_data)
LOG.info(_LI("Host routes available on vm")) LOG.info("Host routes available on vm")
# Check Host route info at beckend # Check Host route info at beckend
exc_edge = self.vsm.get_dhcp_edge_info() exc_edge = self.vsm.get_dhcp_edge_info()
self.assertIsNotNone(exc_edge) self.assertIsNotNone(exc_edge)
@ -200,7 +199,7 @@ class TestDHCP121BasicOps(dmgr.TopoDeployScenarioManager):
dest_subnet = destination_net['destinationSubnet'] dest_subnet = destination_net['destinationSubnet']
dest_router = destination_net['router'] dest_router = destination_net['router']
if (dest in dest_subnet and self.nexthop1 in dest_router): if (dest in dest_subnet and self.nexthop1 in dest_router):
LOG.info(_LI("Host routes available on nsxv")) LOG.info("Host routes available on nsxv")
# Update subnet with no host-routes # Update subnet with no host-routes
_subnet_data1 = {'new_host_routes': []} _subnet_data1 = {'new_host_routes': []}
new_host_routes = _subnet_data1['new_host_routes'] new_host_routes = _subnet_data1['new_host_routes']
@ -227,7 +226,7 @@ class TestDHCP121BasicOps(dmgr.TopoDeployScenarioManager):
for destination_net in dhcp_options_info: for destination_net in dhcp_options_info:
if (_subnet_data['new_host_routes'][0]['destination'] if (_subnet_data['new_host_routes'][0]['destination']
not in destination_net['destinationSubnet']): not in destination_net['destinationSubnet']):
LOG.info(_LI("Host routes not available on nsxv")) LOG.info("Host routes not available on nsxv")
project_dict = dict(security_group=vm_env['security_group'], project_dict = dict(security_group=vm_env['security_group'],
network=vm_env['network'], subnet=vm_env['subnet'], network=vm_env['network'], subnet=vm_env['subnet'],
router=vm_env['router'], router=vm_env['router'],
@ -297,30 +296,30 @@ class TestDhcpMetadata(TestDHCP121BasicOps):
@test.attr(type='nsxv') @test.attr(type='nsxv')
@decorators.idempotent_id('95d06aba-895f-47f8-b47d-ae48c6853a85') @decorators.idempotent_id('95d06aba-895f-47f8-b47d-ae48c6853a85')
def test_dhcp_121_metadata_check_on_vm_nsxv(self): def test_dhcp_121_metadata_check_on_vm_nsxv(self):
LOG.info(_LI("Testcase DHCP-121 option metadata check on vm and \ LOG.info("Testcase DHCP-121 option metadata check on vm and "
on nsx deploying")) "on nsx deploying")
self.vm_env = self.setup_vm_enviornment(self.manager, 'green', True) self.vm_env = self.setup_vm_enviornment(self.manager, 'green', True)
self.green = self.dhcp_121_metadata_hostroutes_check_on_vm_nsxv( self.green = self.dhcp_121_metadata_hostroutes_check_on_vm_nsxv(
self.vm_env) self.vm_env)
LOG.info(_LI("Testcase DHCP-121 option metadata check on vm and on \ LOG.info("Testcase DHCP-121 option metadata check on vm and on "
nsx completed")) "nsx completed")
class TestDhcpHostroutesClear(TestDHCP121BasicOps): class TestDhcpHostroutesClear(TestDHCP121BasicOps):
@test.attr(type='nsxv') @test.attr(type='nsxv')
@decorators.idempotent_id('6bec6eb4-8632-493d-a895-a3ee87cb3002') @decorators.idempotent_id('6bec6eb4-8632-493d-a895-a3ee87cb3002')
def test_dhcp_121_hostroutes_clear(self): def test_dhcp_121_hostroutes_clear(self):
LOG.info(_LI("Testcase DHCP-121 option host routes clear deploying")) LOG.info("Testcase DHCP-121 option host routes clear deploying")
self.vm_env = self.setup_vm_enviornment(self.manager, 'green', True) self.vm_env = self.setup_vm_enviornment(self.manager, 'green', True)
self.green = self.dhcp_121_hostroutes_clear(self.vm_env) self.green = self.dhcp_121_hostroutes_clear(self.vm_env)
LOG.info(_LI("Testcase DHCP-121 option host routes clear completed")) LOG.info("Testcase DHCP-121 option host routes clear completed")
class TestDhcpNegative(TestDHCP121BasicOps): class TestDhcpNegative(TestDHCP121BasicOps):
@test.attr(type='nsxv') @test.attr(type='nsxv')
@decorators.idempotent_id('a58dc6c5-9f28-4184-baf7-37ded52593c4') @decorators.idempotent_id('a58dc6c5-9f28-4184-baf7-37ded52593c4')
def test_dhcp121_negative_test(self): def test_dhcp121_negative_test(self):
LOG.info(_LI("Testcase DHCP-121 option negative test deploying")) LOG.info("Testcase DHCP-121 option negative test deploying")
t_net_id, t_network, t_subnet =\ t_net_id, t_network, t_subnet =\
self.create_project_network_subnet('admin') self.create_project_network_subnet('admin')
subnet_id = t_subnet['id'] subnet_id = t_subnet['id']
@ -349,9 +348,9 @@ class TestDhcpNegative(TestDHCP121BasicOps):
except exceptions.BadRequest: except exceptions.BadRequest:
e = sys.exc_info()[0].__dict__['message'] e = sys.exc_info()[0].__dict__['message']
if (e == "Bad request"): if (e == "Bad request"):
LOG.info(_LI("Invalid input for operation:\ LOG.info("Invalid input for operation: "
Host routes can only be supported when\ "Host routes can only be supported when "
DHCP is enabled")) "DHCP is enabled")
pass pass
subnet_id = t_subnet['id'] subnet_id = t_subnet['id']
kwargs = {'enable_dhcp': 'true'} kwargs = {'enable_dhcp': 'true'}
@ -379,16 +378,16 @@ class TestDhcpNegative(TestDHCP121BasicOps):
except exceptions.BadRequest: except exceptions.BadRequest:
e = sys.exc_info()[0].__dict__['message'] e = sys.exc_info()[0].__dict__['message']
if (e == "Bad request"): if (e == "Bad request"):
LOG.info(_LI("Can't disable DHCP while using host routes")) LOG.info("Can't disable DHCP while using host routes")
pass pass
LOG.info(_LI("Testcase DHCP-121 option negative test completed")) LOG.info("Testcase DHCP-121 option negative test completed")
class TestDhcpMultiHostRoute(TestDHCP121BasicOps): class TestDhcpMultiHostRoute(TestDHCP121BasicOps):
@test.attr(type='nsxv') @test.attr(type='nsxv')
@decorators.idempotent_id('c3ca96d7-b704-4d94-b42d-e7bae94b82cd') @decorators.idempotent_id('c3ca96d7-b704-4d94-b42d-e7bae94b82cd')
def test_dhcp121_multi_host_route(self): def test_dhcp121_multi_host_route(self):
LOG.info(_LI("Testcase DHCP-121 option multi host routes deploying")) LOG.info("Testcase DHCP-121 option multi host routes deploying")
t_net_id, t_network, t_subnet =\ t_net_id, t_network, t_subnet =\
self.create_project_network_subnet('admin') self.create_project_network_subnet('admin')
# Fetch next hop information from tempest.conf # Fetch next hop information from tempest.conf
@ -448,8 +447,8 @@ class TestDhcpMultiHostRoute(TestDHCP121BasicOps):
subnet host_routes equal to 19 or not subnet host_routes equal to 19 or not
''' '''
if (len(subnet['subnet']['host_routes']) == 19): if (len(subnet['subnet']['host_routes']) == 19):
LOG.info(_LI("Multiple entries for host routes available")) LOG.info("Multiple entries for host routes available")
LOG.info(_LI("Testcase DHCP-121 option multi host routes completed")) LOG.info("Testcase DHCP-121 option multi host routes completed")
class TestDhcpHostRoutesBetweenVms(TestDHCP121BasicOps): class TestDhcpHostRoutesBetweenVms(TestDHCP121BasicOps):

View File

@ -23,7 +23,6 @@ from tempest.lib.common.utils import test_utils
from tempest.lib import decorators from tempest.lib import decorators
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.services import nsxv_client from vmware_nsx_tempest.services import nsxv_client
from vmware_nsx_tempest.tests.nsxv.scenario import ( from vmware_nsx_tempest.tests.nsxv.scenario import (
manager_topo_deployment as dmgr) manager_topo_deployment as dmgr)
@ -195,7 +194,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm_id in exclude_vm: if vm_id in exclude_vm:
LOG.info(_LI("Vm in exclude list")) LOG.info("Vm in exclude list")
# Update Port security to disabled # Update Port security to disabled
port_client.update_port( port_client.update_port(
port_id=port_id, port_id=port_id,
@ -204,7 +203,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
if exclude_vm in exclude_list: if exclude_vm in exclude_list:
if vm_id not in exclude_vm: if vm_id not in exclude_vm:
LOG.info(_LI("Vm not in exclude list")) LOG.info("Vm not in exclude list")
# Detach interface from vm # Detach interface from vm
self.interface_client.delete_interface(vm_id, port_id) self.interface_client.delete_interface(vm_id, port_id)
@ -315,7 +314,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm_id in exclude_vm: if vm_id in exclude_vm:
LOG.info(_LI("Vm1 in exclude list")) LOG.info("Vm1 in exclude list")
vm2_id = t_serv2['id'] vm2_id = t_serv2['id']
# Update vm2 port to disable port security # Update vm2 port to disable port security
port_client.update_port( port_client.update_port(
@ -326,7 +325,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
# Check vm2 in exclude list or not # Check vm2 in exclude list or not
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm2_id in exclude_vm: if vm2_id in exclude_vm:
LOG.info(_LI("Vm2 in exclude list")) LOG.info("Vm2 in exclude list")
vm3_id = t_serv3['id'] vm3_id = t_serv3['id']
# Update vm3 port to enable port security # Update vm3 port to enable port security
port_client.update_port( port_client.update_port(
@ -337,7 +336,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
# Check vm3 in exclude list or not # Check vm3 in exclude list or not
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm3_id in exclude_vm: if vm3_id in exclude_vm:
LOG.info(_LI("Vm3 in exclude list")) LOG.info("Vm3 in exclude list")
# Update vm1 port to enable port security # Update vm1 port to enable port security
port_client.update_port( port_client.update_port(
port_id=port1_id, port_id=port1_id,
@ -347,7 +346,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
# Check vm should not be in exclude list # Check vm should not be in exclude list
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm_id not in exclude_vm: if vm_id not in exclude_vm:
LOG.info(_LI("Vm1 not in exclude list")) LOG.info("Vm1 not in exclude list")
@test.attr(type='nsxv') @test.attr(type='nsxv')
@decorators.idempotent_id('f034d3e9-d717-4bcd-8e6e-18e9ada7b81a') @decorators.idempotent_id('f034d3e9-d717-4bcd-8e6e-18e9ada7b81a')
@ -365,7 +364,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm_id in exclude_vm: if vm_id in exclude_vm:
LOG.info(_LI("Vm in exclude list")) LOG.info("Vm in exclude list")
port_client.update_port( port_client.update_port(
port_id=port_id, port_id=port_id,
port_security_enabled='true') port_security_enabled='true')
@ -373,7 +372,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
if exclude_vm in exclude_list: if exclude_vm in exclude_list:
if vm_id not in exclude_vm: if vm_id not in exclude_vm:
LOG.info(_LI("Vm not in exclude list")) LOG.info("Vm not in exclude list")
self.interface_client.delete_interface(vm_id, port_id) self.interface_client.delete_interface(vm_id, port_id)
@test.attr(type='nsxv') @test.attr(type='nsxv')
@ -394,7 +393,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
# Check port security of created port # Check port security of created port
port_details = port_client.show_port(port_id=port_id) port_details = port_client.show_port(port_id=port_id)
if (port_details['port']['port_security_enabled'] == 'false'): if (port_details['port']['port_security_enabled'] == 'false'):
LOG.info(_LI("Port security of port is disabled")) LOG.info("Port security of port is disabled")
kwargs = {'port_security_enabled': 'true'} kwargs = {'port_security_enabled': 'true'}
# Update port security of network to enabled # Update port security of network to enabled
network_client.update_network(network_id=net_id, **kwargs) network_client.update_network(network_id=net_id, **kwargs)
@ -404,7 +403,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
port_id = port['id'] port_id = port['id']
port_details = port_client.show_port(port_id=port_id) port_details = port_client.show_port(port_id=port_id)
if (port_details['port']['port_security_enabled'] == 'true'): if (port_details['port']['port_security_enabled'] == 'true'):
LOG.info(_LI("Port security of port is enabled")) LOG.info("Port security of port is enabled")
@test.attr(type='nsxv') @test.attr(type='nsxv')
@decorators.idempotent_id('c8683cb7-4be5-4670-95c6-344a0aea3667') @decorators.idempotent_id('c8683cb7-4be5-4670-95c6-344a0aea3667')
@ -425,7 +424,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm_id in exclude_vm: if vm_id in exclude_vm:
LOG.info(_LI("Vm in exclude list")) LOG.info("Vm in exclude list")
name = 'disabled-port-security-port2' name = 'disabled-port-security-port2'
kwargs = {'name': name, 'network_id': net_id, kwargs = {'name': name, 'network_id': net_id,
'port_security_enabled': 'false'} 'port_security_enabled': 'false'}
@ -436,7 +435,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm_id in exclude_vm: if vm_id in exclude_vm:
LOG.info(_LI("Vm in exclude list")) LOG.info("Vm in exclude list")
port_client.update_port( port_client.update_port(
port_id=port2_id, port_id=port2_id,
port_security_enabled='true') port_security_enabled='true')
@ -444,7 +443,7 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
for exclude_vm in exclude_list: for exclude_vm in exclude_list:
if vm_id in exclude_vm: if vm_id in exclude_vm:
LOG.info(_LI("Vm in exclude list")) LOG.info("Vm in exclude list")
port_client.update_port( port_client.update_port(
port_id=port1_id, port_id=port1_id,
port_security_enabled='true') port_security_enabled='true')
@ -452,6 +451,6 @@ class TestSpoofGuardFeature(TestSpoofGuardBasicOps):
exclude_list = [item.encode('utf-8') for item in items] exclude_list = [item.encode('utf-8') for item in items]
if exclude_vm in exclude_list: if exclude_vm in exclude_list:
if vm_id not in exclude_vm: if vm_id not in exclude_vm:
LOG.info(_LI("Vm not in exclude list")) LOG.info("Vm not in exclude list")
self.interface_client.delete_interface(vm_id, port1_id) self.interface_client.delete_interface(vm_id, port1_id)
self.interface_client.delete_interface(vm_id, port2_id) self.interface_client.delete_interface(vm_id, port2_id)

View File

@ -20,7 +20,6 @@ from tempest.lib.common.utils import data_utils
from tempest.lib import decorators from tempest.lib import decorators
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.common import constants from vmware_nsx_tempest.common import constants
from vmware_nsx_tempest.services import base_l2gw from vmware_nsx_tempest.services import base_l2gw
@ -42,7 +41,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
To create l2gw we need bridge cluster name (interface name) and To create l2gw we need bridge cluster name (interface name) and
bridge cluster UUID (device name) from NSX manager. bridge cluster UUID (device name) from NSX manager.
""" """
LOG.info(_LI("Testing l2_gateway_create api")) LOG.info("Testing l2_gateway_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -67,7 +66,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
To create l2gw we need bridge cluster name (interface name) and To create l2gw we need bridge cluster name (interface name) and
bridge cluster UUID (device name) from NSX manager and vlan id. bridge cluster UUID (device name) from NSX manager and vlan id.
""" """
LOG.info(_LI("Testing l2_gateway_create api with segmentation ID")) LOG.info("Testing l2_gateway_create api with segmentation ID")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -104,7 +103,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
To create l2gw we need bridge cluster name (interface name) and To create l2gw we need bridge cluster name (interface name) and
bridge cluster UUID (device name) from NSX manager and vlan id. bridge cluster UUID (device name) from NSX manager and vlan id.
""" """
LOG.info(_LI("Testing l2_gateway_create api with segmentation ID")) LOG.info("Testing l2_gateway_create api with segmentation ID")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -140,7 +139,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
Delete l2gw will create l2gw and delete recently created l2gw. To Delete l2gw will create l2gw and delete recently created l2gw. To
delete l2gw we need l2gw id. delete l2gw we need l2gw id.
""" """
LOG.info(_LI("Testing l2_gateway_delete api")) LOG.info("Testing l2_gateway_delete api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -171,7 +170,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
Update l2gw will update info in already created l2gw. To Update l2gw will update info in already created l2gw. To
update l2gw we need l2gw id and payload to update. update l2gw we need l2gw id and payload to update.
""" """
LOG.info(_LI("Testing l2_gateway_update api")) LOG.info("Testing l2_gateway_update api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -198,7 +197,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
"code": "code":
constants.EXPECTED_HTTP_RESPONSE_200}) constants.EXPECTED_HTTP_RESPONSE_200})
rsp_l2gw = update_rsp[constants.L2GW] rsp_l2gw = update_rsp[constants.L2GW]
LOG.info(_LI("response : %(rsp_l2gw)s") % {"rsp_l2gw": rsp_l2gw}) LOG.info("response : %(rsp_l2gw)s", {"rsp_l2gw": rsp_l2gw})
# Assert if name is not updated. # Assert if name is not updated.
self.assertEqual(l2gw_new_name, rsp_l2gw["name"], self.assertEqual(l2gw_new_name, rsp_l2gw["name"],
"l2gw name=%(rsp_name)s is not the same as " "l2gw name=%(rsp_name)s is not the same as "
@ -213,7 +212,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
Update l2gw will update info in already created l2gw. To Update l2gw will update info in already created l2gw. To
update l2gw we need l2gw id and payload to update. update l2gw we need l2gw id and payload to update.
""" """
LOG.info(_LI("Testing l2_gateway_update api")) LOG.info("Testing l2_gateway_update api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -243,7 +242,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
constants.EXPECTED_HTTP_RESPONSE_200}) constants.EXPECTED_HTTP_RESPONSE_200})
rsp_l2gw = update_rsp[constants.L2GW] rsp_l2gw = update_rsp[constants.L2GW]
self.l2gw_created[rsp_l2gw["id"]] = rsp_l2gw self.l2gw_created[rsp_l2gw["id"]] = rsp_l2gw
LOG.info(_LI("response : %(rsp_l2gw)s") % {"rsp_l2gw": rsp_l2gw}) LOG.info("response : %(rsp_l2gw)s", {"rsp_l2gw": rsp_l2gw})
if "segmentation_id" in devices["devices"][0]["interfaces"][0]: if "segmentation_id" in devices["devices"][0]["interfaces"][0]:
self.assertEqual(devices["devices"][0]["interfaces"][0][ self.assertEqual(devices["devices"][0]["interfaces"][0][
"segmentation_id"][0], "segmentation_id"][0],
@ -258,7 +257,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
""" """
show l2gw based on UUID. To see l2gw info we need l2gw id. show l2gw based on UUID. To see l2gw info we need l2gw id.
""" """
LOG.info(_LI("Testing l2_gateway_show api")) LOG.info("Testing l2_gateway_show api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -301,7 +300,7 @@ class L2GatewayTest(base_l2gw.BaseL2GatewayTest):
""" """
list created l2gw. list created l2gw.
""" """
LOG.info(_LI("Testing l2_gateway_list api")) LOG.info("Testing l2_gateway_list api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)

View File

@ -22,7 +22,6 @@ from tempest.lib.common.utils import test_utils
from tempest.lib import decorators from tempest.lib import decorators
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.common import constants from vmware_nsx_tempest.common import constants
from vmware_nsx_tempest.services import base_l2gw from vmware_nsx_tempest.services import base_l2gw
@ -83,7 +82,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
Create l2 gateway connection using one vlan. Vlan parameter is Create l2 gateway connection using one vlan. Vlan parameter is
passed into L2GW create. passed into L2GW create.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -116,7 +115,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
Create l2 gateway connection using multiple vlans. Vlan parameter is Create l2 gateway connection using multiple vlans. Vlan parameter is
passed into L2GW create. passed into L2GW create.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -149,7 +148,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
Create l2 gateway connection using one vlan. Vlan parameter is Create l2 gateway connection using one vlan. Vlan parameter is
passed into L2GW connection create. passed into L2GW connection create.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -186,7 +185,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
Create l2 gateway connection using one vlan and tes l2 gateway Create l2 gateway connection using one vlan and tes l2 gateway
connection show api connection show api
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -231,7 +230,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
Create l2 gateway connection using one vlan and test l2 gateway Create l2 gateway connection using one vlan and test l2 gateway
connection list api. connection list api.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -250,7 +249,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
"Response code is not %(code)s" % { "Response code is not %(code)s" % {
"code": constants.EXPECTED_HTTP_RESPONSE_201}) "code": constants.EXPECTED_HTTP_RESPONSE_201})
list_rsp = self.l2gwc_client.list_l2_gateway_connections() list_rsp = self.l2gwc_client.list_l2_gateway_connections()
LOG.info(_LI("l2gw connection list response: %s") % list_rsp) LOG.info("l2gw connection list response: %s", list_rsp)
# Assert in case of failure. # Assert in case of failure.
self.assertEqual(constants.EXPECTED_HTTP_RESPONSE_200, self.assertEqual(constants.EXPECTED_HTTP_RESPONSE_200,
list_rsp.response["status"], list_rsp.response["status"],
@ -289,10 +288,10 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
- Recreate l2gw connection - Recreate l2gw connection
- verify with l2gw connection list API. - verify with l2gw connection list API.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
# List all the L2GW connection. # List all the L2GW connection.
list_rsp = self.l2gwc_client.list_l2_gateway_connections() list_rsp = self.l2gwc_client.list_l2_gateway_connections()
LOG.info(_LI("l2gw connection list response: %s") % list_rsp) LOG.info("l2gw connection list response: %s", list_rsp)
# Assert in case of failure. # Assert in case of failure.
self.assertEqual(constants.EXPECTED_HTTP_RESPONSE_200, self.assertEqual(constants.EXPECTED_HTTP_RESPONSE_200,
list_rsp.response["status"], list_rsp.response["status"],
@ -333,7 +332,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
"code": constants.EXPECTED_HTTP_RESPONSE_201}) "code": constants.EXPECTED_HTTP_RESPONSE_201})
# List all the L2GW connection. # List all the L2GW connection.
list_rsp = self.l2gwc_client.list_l2_gateway_connections() list_rsp = self.l2gwc_client.list_l2_gateway_connections()
LOG.info(_LI("l2gw connection list response: %s") % list_rsp) LOG.info("l2gw connection list response: %s", list_rsp)
# Assert in case of failure. # Assert in case of failure.
self.assertEqual(constants.EXPECTED_HTTP_RESPONSE_200, self.assertEqual(constants.EXPECTED_HTTP_RESPONSE_200,
list_rsp.response["status"], list_rsp.response["status"],
@ -353,7 +352,7 @@ class L2GatewayConnectionTest(base_l2gw.BaseL2GatewayTest):
Delete l2gw will create l2gw and delete recently created l2gw. To Delete l2gw will create l2gw and delete recently created l2gw. To
delete l2gw we need l2gw id. delete l2gw we need l2gw id.
""" """
LOG.info(_LI("Testing l2_gateway_connection_delete api")) LOG.info("Testing l2_gateway_connection_delete api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)

View File

@ -24,7 +24,6 @@ from tempest.lib.common.utils import test_utils
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc from tempest.lib import exceptions as lib_exc
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.common import constants from vmware_nsx_tempest.common import constants
from vmware_nsx_tempest.services import base_l2gw from vmware_nsx_tempest.services import base_l2gw
@ -85,7 +84,7 @@ class L2GatewayConnectionNegative(base_l2gw.BaseL2GatewayTest):
""" """
Delete l2 gateway with active mapping. Delete l2 gateway with active mapping.
""" """
LOG.info(_LI("Testing test_l2_gateway_create api")) LOG.info("Testing test_l2_gateway_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -112,7 +111,7 @@ class L2GatewayConnectionNegative(base_l2gw.BaseL2GatewayTest):
""" """
Recreate l2 gateway connection using same parameters. Recreate l2 gateway connection using same parameters.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
l2gw_name = data_utils.rand_name(constants.L2GW) l2gw_name = data_utils.rand_name(constants.L2GW)
@ -138,7 +137,7 @@ class L2GatewayConnectionNegative(base_l2gw.BaseL2GatewayTest):
""" """
Create l2 gateway connection using non exist l2gw uuid. Create l2 gateway connection using non exist l2gw uuid.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
non_exist_l2gw_uuid = NON_EXIST_UUID non_exist_l2gw_uuid = NON_EXIST_UUID
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
@ -160,7 +159,7 @@ class L2GatewayConnectionNegative(base_l2gw.BaseL2GatewayTest):
""" """
Create l2 gateway connection using non exist l2gw uuid. Create l2 gateway connection using non exist l2gw uuid.
""" """
LOG.info(_LI("Testing test_l2_gateway_connection_create api")) LOG.info("Testing test_l2_gateway_connection_create api")
non_exist_network_uuid = NON_EXIST_UUID non_exist_network_uuid = NON_EXIST_UUID
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
@ -182,7 +181,7 @@ class L2GatewayConnectionNegative(base_l2gw.BaseL2GatewayTest):
""" """
Create l2 gateway connection using invalid seg id. Create l2 gateway connection using invalid seg id.
""" """
LOG.info(_LI("Testing l2_gateway_create api with segmentation ID")) LOG.info("Testing l2_gateway_create api with segmentation ID")
invalid_seg_id = 20000 invalid_seg_id = 20000
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]
@ -201,7 +200,7 @@ class L2GatewayConnectionNegative(base_l2gw.BaseL2GatewayTest):
""" """
Create l2 gateway connection using invalid seg id. Create l2 gateway connection using invalid seg id.
""" """
LOG.info(_LI("Testing l2_gateway_create api with segmentation ID")) LOG.info("Testing l2_gateway_create api with segmentation ID")
invalid_seg_id = 2.45 invalid_seg_id = 2.45
cluster_info = self.nsx_bridge_cluster_info() cluster_info = self.nsx_bridge_cluster_info()
device_name, interface_name = cluster_info[0][0], cluster_info[0][1] device_name, interface_name = cluster_info[0][0], cluster_info[0][1]

View File

@ -24,7 +24,6 @@ from tempest.lib.common.utils import data_utils
from tempest.lib import decorators from tempest.lib import decorators
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.services import nsxv3_client from vmware_nsx_tempest.services import nsxv3_client
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -93,7 +92,7 @@ class NSXv3SecGroupTest(base.BaseSecGroupTest):
group_create_body, name = self._create_security_group() group_create_body, name = self._create_security_group()
secgroup = group_create_body['security_group'] secgroup = group_create_body['security_group']
time.sleep(NSX_FIREWALL_REALIZED_DELAY) time.sleep(NSX_FIREWALL_REALIZED_DELAY)
LOG.info(_LI("Create security group with name %(name)s and id %(id)s"), LOG.info("Create security group with name %(name)s and id %(id)s",
{'name': secgroup['name'], 'id': secgroup['id']}) {'name': secgroup['name'], 'id': secgroup['id']})
# List security groups and verify if created group is there in response # List security groups and verify if created group is there in response
list_body = self.security_groups_client.list_security_groups() list_body = self.security_groups_client.list_security_groups()

View File

@ -22,7 +22,6 @@ from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.common import constants from vmware_nsx_tempest.common import constants
from vmware_nsx_tempest.services import nsxv3_client from vmware_nsx_tempest.services import nsxv3_client
@ -298,8 +297,8 @@ class ProviderSecurityGroupTest(base.BaseAdminNetworkTest):
if (provider_sg_name in sec_name['display_name'] and if (provider_sg_name in sec_name['display_name'] and
sg_name not in sec_name['display_name']): sg_name not in sec_name['display_name']):
if count == 0: if count == 0:
LOG.info(_LI("Provider group has high priority over" LOG.info("Provider group has high priority over "
"default sec group")) "default sec group")
break break
count += count count += count
self.assertIn(provider_sg_name, sec_name['display_name']) self.assertIn(provider_sg_name, sec_name['display_name'])
@ -316,8 +315,8 @@ class ProviderSecurityGroupTest(base.BaseAdminNetworkTest):
try: try:
self.delete_security_group(sg_client, sg_id) self.delete_security_group(sg_client, sg_id)
except Exception: except Exception:
LOG.info(_LI("Non Admin tenant can't see admin" LOG.info("Non Admin tenant can't see admin "
"provider security group")) "provider security group")
pass pass
@test.attr(type='nsxv3') @test.attr(type='nsxv3')
@ -328,7 +327,7 @@ class ProviderSecurityGroupTest(base.BaseAdminNetworkTest):
self.create_security_provider_group, self.create_security_provider_group,
self.cmgr_alt, project_id=project_id, self.cmgr_alt, project_id=project_id,
provider=True) provider=True)
LOG.info(_LI("Non-Admin Tenant cannot create provider sec group")) LOG.info("Non-Admin Tenant cannot create provider sec group")
@test.attr(type='nsxv3') @test.attr(type='nsxv3')
@decorators.idempotent_id('0d021bb2-9e21-422c-a509-6ac27803b2a2') @decorators.idempotent_id('0d021bb2-9e21-422c-a509-6ac27803b2a2')

View File

@ -22,7 +22,6 @@ from tempest.lib import decorators
from tempest.scenario import manager from tempest.scenario import manager
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LI
from vmware_nsx_tempest.common import constants from vmware_nsx_tempest.common import constants
from vmware_nsx_tempest.services import nsxv3_client from vmware_nsx_tempest.services import nsxv3_client
@ -150,7 +149,7 @@ class TestMDProxy(manager.NetworkScenarioTest):
break break
exec_cmd_retried += 1 exec_cmd_retried += 1
time.sleep(constants.INTERVAL_BETWEEN_EXEC_RETRY_ON_SSH) time.sleep(constants.INTERVAL_BETWEEN_EXEC_RETRY_ON_SSH)
LOG.info(_LI("Tried %s times!!!") % exec_cmd_retried) LOG.info("Tried %s times!!!", exec_cmd_retried)
if check_exist_only: if check_exist_only:
return "Verification is successful!" return "Verification is successful!"
msg = ("Failed while verifying metadata on server. Result " msg = ("Failed while verifying metadata on server. Result "

View File

@ -22,8 +22,6 @@ from tempest.lib import decorators
from tempest.scenario import manager from tempest.scenario import manager
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LE
CONF = config.CONF CONF = config.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -153,8 +151,8 @@ class TestMultiHVNetworkOps(manager.NetworkScenarioTest):
(ssh_source, remote_ip, should_connect), (ssh_source, remote_ip, should_connect),
msg) msg)
except Exception: except Exception:
LOG.exception(_LE("Unable to access %{dest}s via ssh to " LOG.exception("Unable to access %{dest}s via ssh to "
"floating-ip %{src}s"), "floating-ip %{src}s",
{'dest': remote_ip, 'src': floating_ip}) {'dest': remote_ip, 'src': floating_ip})
raise raise

View File

@ -24,8 +24,6 @@ from tempest.lib import decorators
from tempest.scenario import manager from tempest.scenario import manager
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LE
CONF = config.CONF CONF = config.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -194,8 +192,8 @@ class TestMultiNetworksOps(manager.NetworkScenarioTest):
(ssh_source, remote_ip, should_connect), (ssh_source, remote_ip, should_connect),
msg) msg)
except Exception: except Exception:
LOG.exception(_LE("Unable to access %{dest}s via ssh to " LOG.exception("Unable to access %{dest}s via ssh to "
"floating-ip %{src}s"), "floating-ip %{src}s",
{'dest': remote_ip, 'src': floating_ip}) {'dest': remote_ip, 'src': floating_ip})
raise raise

View File

@ -24,7 +24,6 @@ from tempest.lib import decorators
from tempest.scenario import manager from tempest.scenario import manager
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LE
from vmware_nsx_tempest.services import nsxv3_client from vmware_nsx_tempest.services import nsxv3_client
CONF = config.CONF CONF = config.CONF
@ -213,8 +212,8 @@ class TestRouterNoNATOps(manager.NetworkScenarioTest):
(ssh_source, remote_ip, should_connect), (ssh_source, remote_ip, should_connect),
msg) msg)
except Exception: except Exception:
LOG.exception(_LE("Unable to access %{dest}s via ssh to " LOG.exception("Unable to access %{dest}s via ssh to "
"floating-ip %{src}s"), "floating-ip %{src}s",
{'dest': remote_ip, 'src': floating_ip}) {'dest': remote_ip, 'src': floating_ip})
raise raise

View File

@ -23,8 +23,6 @@ from tempest.lib import decorators
from tempest.scenario import manager from tempest.scenario import manager
from tempest import test from tempest import test
from vmware_nsx_tempest._i18n import _LE
CONF = config.CONF CONF = config.CONF
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -248,8 +246,8 @@ class TestMicroSegmentationOps(manager.NetworkScenarioTest):
(ssh_source, remote_ip, should_connect), (ssh_source, remote_ip, should_connect),
msg) msg)
except Exception: except Exception:
LOG.exception(_LE("Unable to access %{dest}s via ssh to " LOG.exception("Unable to access %{dest}s via ssh to "
"floating-ip %{src}s"), "floating-ip %{src}s",
{'dest': remote_ip, 'src': floating_ip}) {'dest': remote_ip, 'src': floating_ip})
raise raise