From 6e18f5d071a01c4b997ae50f2c799f9de7bd61eb Mon Sep 17 00:00:00 2001 From: Nilesh Lokhande Date: Wed, 17 Jul 2019 09:13:40 +0000 Subject: [PATCH] ENS check Removed Change-Id: I19e8ae1ef562fac8c6dfc6465b8a6d82e10e668d --- .../lib/appliance_manager.py | 36 ++++++++----------- .../lib/feature_manager.py | 17 +++++---- .../nsxv3/scenario/test_lbaas_scenario.py | 36 +++++++------------ .../scenario/test_octavia_loadbalancers.py | 21 ++++------- .../nsxv3/scenario/test_router_nonat_ops.py | 5 ++- .../tests/scenario/manager.py | 5 +-- 6 files changed, 45 insertions(+), 75 deletions(-) diff --git a/vmware_nsx_tempest_plugin/lib/appliance_manager.py b/vmware_nsx_tempest_plugin/lib/appliance_manager.py index a2b200e..64f1899 100644 --- a/vmware_nsx_tempest_plugin/lib/appliance_manager.py +++ b/vmware_nsx_tempest_plugin/lib/appliance_manager.py @@ -140,11 +140,8 @@ class ApplianceManager(manager.NetworkScenarioTest): network_id=external_network_id)} routers_client.update_router(router['id'], **public_network_info) self.topology_routers[router_name] = router - if CONF.nsxv3.ens: - pass - else: - self.addCleanup(test_utils.call_and_ignore_notfound_exc, - routers_client.delete_router, router['id']) + self.addCleanup(test_utils.call_and_ignore_notfound_exc, + routers_client.delete_router, router['id']) return router def get_server_nics(self, ssh_client): @@ -208,10 +205,7 @@ class ApplianceManager(manager.NetworkScenarioTest): # Neutron disables port security by default so we have to check the # config before trying to create the network with port_security_enabled if CONF.network_feature_enabled.port_security: - if not CONF.nsxv3.ens: - port_security_enabled = True - else: - port_security_enabled = False + port_security_enabled = True else: port_security_enabled = False result = networks_client.create_network( @@ -385,10 +379,11 @@ class ApplianceManager(manager.NetworkScenarioTest): return sg def create_topology_security_group_rule(self, tenant_id, sg, - sec_rule_client=None, - sec_client=None, - **kwargs): - rule = self._create_security_group_rule(tenant_id=tenant_id, + sec_rule_client=None, + sec_client=None, + **kwargs): + rule = self._create_security_group_rule( + tenant_id=tenant_id, sec_group_rules_client=sec_rule_client, security_groups_client=sec_client, secgroup=sg, @@ -422,7 +417,7 @@ class ApplianceManager(manager.NetworkScenarioTest): if router_client is None: router_client = self.routers_client interface = router_client.add_router_interface(router_id, - subnet_id=subnet_id) + subnet_id=subnet_id) self.addCleanup( test_utils.call_and_ignore_notfound_exc, router_client.remove_router_interface, router_id, @@ -475,13 +470,12 @@ class ApplianceManager(manager.NetworkScenarioTest): config_drive=None, keypair=None, image_id=None, clients=None, create_floating_ip=True, port=None, **kwargs): # Define security group for server. - if CONF.nsxv3.ens is not True: - if security_groups: - kwargs["security_groups"] = security_groups - else: - _sg = self.create_topology_security_group() - _security_groups = [{'name': _sg['name']}] - kwargs["security_groups"] = _security_groups + if security_groups: + kwargs["security_groups"] = security_groups + else: + _sg = self.create_topology_security_group() + _security_groups = [{'name': _sg['name']}] + kwargs["security_groups"] = _security_groups # Define config drive for server. if not config_drive: kwargs["config_drive"] = self.topology_config_drive diff --git a/vmware_nsx_tempest_plugin/lib/feature_manager.py b/vmware_nsx_tempest_plugin/lib/feature_manager.py index a424289..56d4d06 100644 --- a/vmware_nsx_tempest_plugin/lib/feature_manager.py +++ b/vmware_nsx_tempest_plugin/lib/feature_manager.py @@ -1024,15 +1024,14 @@ class FeatureManager(traffic_manager.IperfManager, count += 1 else: break - if not CONF.nsxv3.ens: - if barbican or external_subnet: - self.cmgr_adm.ports_client.update_port( - self.loadbalancer['vip_port_id'], - security_groups=[self.sg['id']]) - else: - self.ports_client.update_port( - self.loadbalancer['vip_port_id'], - security_groups=[self.sg['id']]) + if barbican or external_subnet: + self.cmgr_adm.ports_client.update_port( + self.loadbalancer['vip_port_id'], + security_groups=[self.sg['id']]) + else: + self.ports_client.update_port( + self.loadbalancer['vip_port_id'], + security_groups=[self.sg['id']]) # create lbaas public interface if barbican or external_subnet: if not hasattr(self, 'vip_ip_address'): diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_lbaas_scenario.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_lbaas_scenario.py index 23c4212..ed4e940 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_lbaas_scenario.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_lbaas_scenario.py @@ -129,8 +129,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('c5ac853b-6867-4b7a-8704-3844b11b1a34') def test_lbaas_http_traffic_roundrobin_with_ping_health_type(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", hm_type='PING') self.check_project_lbaas() @@ -139,8 +138,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('87b709bf-127f-4161-b43f-3915c216c44b') def test_lbaas_http_traffic_roundrobin_with_http_health_type(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", hm_type='HTTP') self.check_lbaas_project_weight_values(constants.NO_OF_VMS_2) @@ -149,8 +147,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('60e9facf-b8d6-48a9-b0d2-942e5bb38f38') def test_lbaas_http_leastconnections_with_ping_health_type(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEAST_CONNECTIONS", hm_type='PING') @@ -160,8 +157,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('3041a103-e03d-4660-b411-2f9d5987dba8') def test_lbaas_http_leastconnections_with_http_health_type(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEAST_CONNECTIONS", hm_type='HTTP') @@ -171,8 +167,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('73190a30-3879-4828-a198-4d3fff4cea3a') def test_lbaas_http_leastconnection_with_weighted_value(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEAST_CONNECTIONS", hm_type='HTTP', weight=1) @@ -182,8 +177,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('a18347f8-9de0-49b0-8935-5fd26c135afb') def test_lbaas_http_leastconnection_updated_weighted_value(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEAST_CONNECTIONS", hm_type='HTTP') @@ -195,8 +189,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('5041a903-e03d-4660-e421-2f9d5987dba9') def test_lbaas_http_leastconnection_updated_algorithm(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEAST_CONNECTIONS", hm_type='HTTP') @@ -208,8 +201,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): @decorators.idempotent_id('cb9f483b-a7b3-41fc-9a5f-86a8738f853b') def test_lbaas_http_roundrobin_with_weighted_value(self): self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", hm_type='HTTP', weight=1) @@ -276,8 +268,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): Delete tier-1 router when Lb is attached to it """ lb_topo = self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) lb = self.create_project_lbaas( protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", hm_type='PING') @@ -296,8 +287,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): client requests """ self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", hm_type='PING', persistence=True, @@ -313,8 +303,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): HTTP_COOKIE works fine. """ self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", hm_type='PING', persistence=True, @@ -339,8 +328,7 @@ class LBaasRoundRobinBaseTest(feature_manager.FeatureManager): for every new traffic that hits on the lb. """ self.deploy_lbaas_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) self.create_project_lbaas(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", hm_type='PING') diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py index b400e18..0c3a899 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_octavia_loadbalancers.py @@ -151,8 +151,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): option, and verifies the traffic on the loadbalancer vip """ diction = self.deploy_octavia_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) subnet_id = diction['subnet']['subnet']['id'] self.create_project_octavia(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", @@ -167,8 +166,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): option, and verifies the traffic on the loadbalancer vip """ diction = self.deploy_octavia_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) net_id = diction['network']['network']['id'] self.create_project_octavia(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", @@ -183,8 +181,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): option, and verifies the traffic on the loadbalancer vip """ diction = self.deploy_octavia_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) net_id = diction['network']['network']['id'] self.create_project_octavia(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEASTS_CONTNECTIONS", @@ -199,8 +196,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): option, and verifies the traffic on the loadbalancer vip """ diction = self.deploy_octavia_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) subnet_id = diction['subnet']['subnet']['id'] self.create_project_octavia(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEAST_CONNECTIONS", @@ -215,8 +211,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): option, and verifies the traffic on the loadbalancer vip """ diction = self.deploy_octavia_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) subnet_id = diction['subnet']['subnet']['id'] self.create_project_octavia(protocol_type="HTTP", protocol_port="80", lb_algorithm="LEAST_CONNECTIONS", @@ -242,8 +237,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): client requests """ diction = self.deploy_octavia_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) subnet_id = diction['subnet']['subnet']['id'] self.create_project_octavia(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", @@ -262,8 +256,7 @@ class OctaviaRoundRobin(feature_manager.FeatureManager): client requests """ diction = self.deploy_octavia_topology() - if not CONF.nsxv3.ens: - self.start_web_servers(constants.HTTP_PORT) + self.start_web_servers(constants.HTTP_PORT) net_id = diction['network']['network']['id'] self.create_project_octavia(protocol_type="HTTP", protocol_port="80", lb_algorithm="ROUND_ROBIN", diff --git a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py index f1467df..274f4e0 100644 --- a/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py +++ b/vmware_nsx_tempest_plugin/tests/nsxv3/scenario/test_router_nonat_ops.py @@ -155,9 +155,8 @@ class TestRouterNoNATOps(manager.NetworkScenarioTest): kwargs = {} keypair = self.create_keypair() self.keypairs[keypair['name']] = keypair - if CONF.nsxv3.ens is not True: - security_groups = [{'name': self.security_group['name']}] - kwargs["security_groups"] = security_groups + security_groups = [{'name': self.security_group['name']}] + kwargs["security_groups"] = security_groups network = {'uuid': network['id']} server = self.create_server(name=name, networks=[network], key_name=keypair['name'], diff --git a/vmware_nsx_tempest_plugin/tests/scenario/manager.py b/vmware_nsx_tempest_plugin/tests/scenario/manager.py index 0b6b75c..a499920 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/manager.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/manager.py @@ -719,10 +719,7 @@ class NetworkScenarioTest(ScenarioTest): # Neutron disables port security by default so we have to check the # config before trying to create the network with port_security_enabled if CONF.network_feature_enabled.port_security: - if not CONF.nsxv3.ens: - port_security_enabled = True - else: - port_security_enabled = False + port_security_enabled = True else: port_security_enabled = False network_kwargs['port_security_enabled'] = port_security_enabled