Tempest fixes for below cases
- vmware_nsx_tempest_plugin.tests.nsxv3.api.test_nsx_floating_ip.NSXv3FloatingIPTest.test_create_floating_ip - vmware_nsx_tempest_plugin.tests.nsxv3.api.test_nsx_floating_ip.NSXv3FloatingIPTest.test_delete_floating_ip - vmware_nsx_tempest_plugin.tests.nsxv3.api.test_nsx_floating_ip.NSXv3FloatingIPTest.test_update_floating_ip - vmware_nsx_tempest_plugin.tests.nsxv3.api.test_nsx_port_security.NSXv3PortSecurity.test_admin_port_security_at_beckend_after_enable_disable - vmware_nsx_tempest_plugin.tests.nsxv3.api.test_nsx_port_security.NSXv3PortSecurity.test_tenant_port_security_at_beckend_after_enable_disable - vmware_nsx_tempest_plugin.tests.scenario.test_new_case_coverage.TestNewCase.test_create_port_with_dhcp_port_ip - vmware_nsx_tempest_plugin.tests.scenario.test_new_case_coverage.TestNewCase.test_create_sec_group_with_invalid_protocol - vmware_nsx_tempest_plugin.tests.scenario.test_new_case_coverage.TestNewCase.test_mac_learning_should_not_applied_over_trusted_ports - vmware_nsx_tempest_plugin.tests.scenario.test_new_case_coverage.TestNewCase.test_mac_learning_with_provider_sec_group_enabled_on_port - vmware_nsx_tempest_plugin.tests.scenario.test_provider_networks.ProviderNetworks.test_provider_vlan_networks_using_router_Adn_verify - vmware_nsx_tempest_plugin.tests.nsxv3.api.test_nsx_routers.NSXv3RoutersTest.test_deploy_router_ha_with_relocation_enable_disable Change-Id: Ie729ae95df4096a763ce0483b62c06cf85614842
This commit is contained in:
parent
ea56f1c721
commit
e9c592bacd
@ -72,10 +72,17 @@ class ApplianceManager(manager.NetworkScenarioTest):
|
|||||||
|
|
||||||
def _verify_empty_security_group_status(self, security_group):
|
def _verify_empty_security_group_status(self, security_group):
|
||||||
ip_protocols = ["IPV6", "IPV4"]
|
ip_protocols = ["IPV6", "IPV4"]
|
||||||
|
if CONF.network.backend == 'nsxp':
|
||||||
|
nsx_fw_section, nsx_fw_section_rules = \
|
||||||
|
self.nsx_client.get_firewall_section_and_rules(
|
||||||
|
security_group['name'], security_group['id'],
|
||||||
|
os_tenant_id='default')
|
||||||
|
elif CONF.network.backend == 'nsxv3':
|
||||||
nsx_fw_section, nsx_fw_section_rules = \
|
nsx_fw_section, nsx_fw_section_rules = \
|
||||||
self.nsx_client.get_firewall_section_and_rules(
|
self.nsx_client.get_firewall_section_and_rules(
|
||||||
security_group['name'], security_group['id'])
|
security_group['name'], security_group['id'])
|
||||||
msg = "Newly created empty security group does not meet criteria !!!"
|
msg = "Newly created empty security group does not meet criteria !!!"
|
||||||
|
if CONF.network.backend != 'nsxp':
|
||||||
self.assertEqual(nsx_fw_section["rule_count"], 2, msg)
|
self.assertEqual(nsx_fw_section["rule_count"], 2, msg)
|
||||||
self.assertEqual(nsx_fw_section_rules[0]["action"], "ALLOW", msg)
|
self.assertEqual(nsx_fw_section_rules[0]["action"], "ALLOW", msg)
|
||||||
self.assertEqual(nsx_fw_section_rules[1]["action"], "ALLOW", msg)
|
self.assertEqual(nsx_fw_section_rules[1]["action"], "ALLOW", msg)
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
from vmware_nsx_tempest_plugin.services import nsxp_client
|
||||||
from vmware_nsx_tempest_plugin.services import nsxv3_client
|
from vmware_nsx_tempest_plugin.services import nsxv3_client
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@ -28,6 +29,8 @@ class NSXClient(object):
|
|||||||
self.password = password
|
self.password = password
|
||||||
if backend.lower() == "nsxv3":
|
if backend.lower() == "nsxv3":
|
||||||
self.nsx = nsxv3_client.NSXV3Client(host, username, password)
|
self.nsx = nsxv3_client.NSXV3Client(host, username, password)
|
||||||
|
elif backend.lower() == "nsxp":
|
||||||
|
self.nsx = nsxp_client.NSXPClient(host, username, password)
|
||||||
|
|
||||||
def get_firewall_section_and_rules(self, *args, **kwargs):
|
def get_firewall_section_and_rules(self, *args, **kwargs):
|
||||||
if self.backend == "nsxv3":
|
if self.backend == "nsxv3":
|
||||||
@ -36,6 +39,12 @@ class NSXClient(object):
|
|||||||
firewall_section_rules = self.nsx.get_firewall_section_rules(
|
firewall_section_rules = self.nsx.get_firewall_section_rules(
|
||||||
firewall_section)
|
firewall_section)
|
||||||
return firewall_section, firewall_section_rules
|
return firewall_section, firewall_section_rules
|
||||||
|
elif self.backend == "nsxp":
|
||||||
|
firewall_section = self.nsx.get_firewall_section(
|
||||||
|
*args, **kwargs)
|
||||||
|
firewall_section_rules = self.nsx.get_firewall_section_rules(
|
||||||
|
firewall_section, tenant_id=kwargs['os_tenant_id'])
|
||||||
|
return firewall_section, firewall_section_rules
|
||||||
else:
|
else:
|
||||||
# TODO(ddoshi) define else for nsxv
|
# TODO(ddoshi) define else for nsxv
|
||||||
pass
|
pass
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from tempest.api.network import base
|
from tempest.api.network import base
|
||||||
@ -21,6 +23,7 @@ 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_plugin.common import constants
|
||||||
from vmware_nsx_tempest_plugin.services import nsxv3_client
|
from vmware_nsx_tempest_plugin.services import nsxv3_client
|
||||||
|
|
||||||
CONF = config.CONF
|
CONF = config.CONF
|
||||||
@ -69,6 +72,8 @@ class NSXv3FloatingIPTest(base.BaseNetworkTest):
|
|||||||
LOG.debug("Port IP address: %s", port_ip)
|
LOG.debug("Port IP address: %s", port_ip)
|
||||||
self.addCleanup(self.floating_ips_client.delete_floatingip,
|
self.addCleanup(self.floating_ips_client.delete_floatingip,
|
||||||
fip['id'])
|
fip['id'])
|
||||||
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_router = self.nsx.get_logical_router(self.router['name'],
|
nsx_router = self.nsx.get_logical_router(self.router['name'],
|
||||||
self.router['id'])
|
self.router['id'])
|
||||||
LOG.debug("NSX router on backend: %s", nsx_router)
|
LOG.debug("NSX router on backend: %s", nsx_router)
|
||||||
@ -102,6 +107,8 @@ class NSXv3FloatingIPTest(base.BaseNetworkTest):
|
|||||||
{'port1': port1_ip, 'port2': port2_ip})
|
{'port1': port1_ip, 'port2': port2_ip})
|
||||||
self.addCleanup(self.floating_ips_client.delete_floatingip,
|
self.addCleanup(self.floating_ips_client.delete_floatingip,
|
||||||
fip['id'])
|
fip['id'])
|
||||||
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_router = self.nsx.get_logical_router(self.router['name'],
|
nsx_router = self.nsx.get_logical_router(self.router['name'],
|
||||||
self.router['id'])
|
self.router['id'])
|
||||||
self.assertEqual(fip['fixed_ip_address'], port1_ip)
|
self.assertEqual(fip['fixed_ip_address'], port1_ip)
|
||||||
@ -110,6 +117,8 @@ class NSXv3FloatingIPTest(base.BaseNetworkTest):
|
|||||||
update_body = self.floating_ips_client.update_floatingip(
|
update_body = self.floating_ips_client.update_floatingip(
|
||||||
fip['id'], port_id=self.ports[1]['id'])
|
fip['id'], port_id=self.ports[1]['id'])
|
||||||
updated_fip = update_body['floatingip']
|
updated_fip = update_body['floatingip']
|
||||||
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nat_rules = self.nsx.get_logical_router_nat_rules(nsx_router)
|
nat_rules = self.nsx.get_logical_router_nat_rules(nsx_router)
|
||||||
LOG.debug("NAT rules on NSX router %(router)s: %(rules)s",
|
LOG.debug("NAT rules on NSX router %(router)s: %(rules)s",
|
||||||
{'router': nsx_router, 'rules': nat_rules})
|
{'router': nsx_router, 'rules': nat_rules})
|
||||||
@ -139,12 +148,16 @@ class NSXv3FloatingIPTest(base.BaseNetworkTest):
|
|||||||
fip = create_body['floatingip']
|
fip = create_body['floatingip']
|
||||||
port_ip = self.ports[0]['fixed_ips'][0]['ip_address']
|
port_ip = self.ports[0]['fixed_ips'][0]['ip_address']
|
||||||
LOG.debug("Port IP address: %s", port_ip)
|
LOG.debug("Port IP address: %s", port_ip)
|
||||||
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_router = self.nsx.get_logical_router(self.router['name'],
|
nsx_router = self.nsx.get_logical_router(self.router['name'],
|
||||||
self.router['id'])
|
self.router['id'])
|
||||||
LOG.debug("NSX router on backend: %s", nsx_router)
|
LOG.debug("NSX router on backend: %s", nsx_router)
|
||||||
self.assertIsNotNone(fip['id'])
|
self.assertIsNotNone(fip['id'])
|
||||||
# Delete the floating ip and backend nat rules
|
# Delete the floating ip and backend nat rules
|
||||||
self.floating_ips_client.delete_floatingip(fip['id'])
|
self.floating_ips_client.delete_floatingip(fip['id'])
|
||||||
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nat_rules = self.nsx.get_logical_router_nat_rules(nsx_router)
|
nat_rules = self.nsx.get_logical_router_nat_rules(nsx_router)
|
||||||
LOG.debug("NAT rules on NSX router %(router)s: %(rules)s",
|
LOG.debug("NAT rules on NSX router %(router)s: %(rules)s",
|
||||||
{'router': nsx_router, 'rules': nat_rules})
|
{'router': nsx_router, 'rules': nat_rules})
|
||||||
|
@ -277,7 +277,7 @@ class NSXv3PortSecurity(base.BaseAdminNetworkTest):
|
|||||||
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_nsgroup_policy = self.nsxp.get_ns_group(
|
nsx_nsgroup_policy = self.nsxp.get_ns_group(
|
||||||
secgroup['name'], secgroup['id'],
|
secgroup['name'], secgroup['id'],
|
||||||
os_tenant_id=secgroup['tenant_id'])
|
os_tenant_id='default')
|
||||||
self.assertIsNotNone(nsx_nsgroup_policy)
|
self.assertIsNotNone(nsx_nsgroup_policy)
|
||||||
nsgroup_id = self.nsx.get_neutron_ns_group_id(nsxp=True)
|
nsgroup_id = self.nsx.get_neutron_ns_group_id(nsxp=True)
|
||||||
else:
|
else:
|
||||||
@ -321,7 +321,7 @@ class NSXv3PortSecurity(base.BaseAdminNetworkTest):
|
|||||||
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_nsgroup_policy = self.nsxp.get_ns_group(
|
nsx_nsgroup_policy = self.nsxp.get_ns_group(
|
||||||
secgroup['name'], secgroup['id'],
|
secgroup['name'], secgroup['id'],
|
||||||
os_tenant_id=secgroup['tenant_id'])
|
os_tenant_id='default')
|
||||||
self.assertIsNotNone(nsx_nsgroup_policy)
|
self.assertIsNotNone(nsx_nsgroup_policy)
|
||||||
nsgroup_id = self.nsx.get_neutron_ns_group_id(nsxp=True)
|
nsgroup_id = self.nsx.get_neutron_ns_group_id(nsxp=True)
|
||||||
else:
|
else:
|
||||||
|
@ -152,6 +152,7 @@ class NSXv3RoutersTest(base.BaseAdminNetworkTest):
|
|||||||
router_name=router_name, admin_state_up=True)
|
router_name=router_name, admin_state_up=True)
|
||||||
|
|
||||||
if CONF.network.backend == 'nsxp':
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_router = self.nsxp.get_logical_router(body['name'], body['id'])
|
nsx_router = self.nsxp.get_logical_router(body['name'], body['id'])
|
||||||
self.assertEqual(body['name'], router_name)
|
self.assertEqual(body['name'], router_name)
|
||||||
self.assertIsNotNone(nsx_router)
|
self.assertIsNotNone(nsx_router)
|
||||||
@ -169,6 +170,7 @@ class NSXv3RoutersTest(base.BaseAdminNetworkTest):
|
|||||||
self.routers_client.update_router(body['id'], **public_network_info)
|
self.routers_client.update_router(body['id'], **public_network_info)
|
||||||
|
|
||||||
if CONF.network.backend == 'nsxp':
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_router = self.nsxp.get_logical_router(body['name'], body['id'])
|
nsx_router = self.nsxp.get_logical_router(body['name'], body['id'])
|
||||||
self.assertEqual(body['name'], router_name)
|
self.assertEqual(body['name'], router_name)
|
||||||
self.assertIsNotNone(nsx_router)
|
self.assertIsNotNone(nsx_router)
|
||||||
@ -184,6 +186,7 @@ class NSXv3RoutersTest(base.BaseAdminNetworkTest):
|
|||||||
self.routers_client.update_router(body['id'], **public_network_info)
|
self.routers_client.update_router(body['id'], **public_network_info)
|
||||||
|
|
||||||
if CONF.network.backend == 'nsxp':
|
if CONF.network.backend == 'nsxp':
|
||||||
|
time.sleep(constants.NSXP_BACKEND_SMALL_TIME_INTERVAL)
|
||||||
nsx_router = self.nsxp.get_logical_router(body['name'], body['id'])
|
nsx_router = self.nsxp.get_logical_router(body['name'], body['id'])
|
||||||
self.assertEqual(body['name'], router_name)
|
self.assertEqual(body['name'], router_name)
|
||||||
self.assertIsNotNone(nsx_router)
|
self.assertIsNotNone(nsx_router)
|
||||||
|
@ -551,13 +551,14 @@ class TestNewCase(feature_manager.FeatureManager):
|
|||||||
image_id = self.get_glance_image_id(['cirros', "esx"])
|
image_id = self.get_glance_image_id(['cirros', "esx"])
|
||||||
vm_state = self.create_topology_instance(
|
vm_state = self.create_topology_instance(
|
||||||
"state_vm_1", create_floating_ip=False,
|
"state_vm_1", create_floating_ip=False,
|
||||||
image_id=image_id, port=port['port'])
|
image_id=image_id, port=port['port'],
|
||||||
|
clients=self.cmgr_adm)
|
||||||
self.assertEqual("ACTIVE", vm_state['status'])
|
self.assertEqual("ACTIVE", vm_state['status'])
|
||||||
|
|
||||||
@decorators.idempotent_id('1207561e-91cc-8905-b217-98844caa79f6')
|
@decorators.idempotent_id('1207561e-91cc-8905-b217-98844caa79f6')
|
||||||
def test_create_port_with_dhcp_port_ip(self):
|
def test_create_port_with_dhcp_port_ip(self):
|
||||||
topology_dict = self.create_topo_single_network(
|
topology_dict = self.create_topo_single_network(
|
||||||
"instance_port", deploy_instance=False)
|
"instance_port", create_instance=False)
|
||||||
network_state = topology_dict['network_state']
|
network_state = topology_dict['network_state']
|
||||||
subnet_state = topology_dict['subnet_state']
|
subnet_state = topology_dict['subnet_state']
|
||||||
network_cidr = (
|
network_cidr = (
|
||||||
|
@ -270,6 +270,7 @@ class ProviderNetworks(feature_manager.FeatureManager):
|
|||||||
'fixed_ips')[0]['ip_address'] == subnet['gateway_ip']:
|
'fixed_ips')[0]['ip_address'] == subnet['gateway_ip']:
|
||||||
port_id = port['id']
|
port_id = port['id']
|
||||||
break
|
break
|
||||||
|
if CONF.network.backend != 'nsxp':
|
||||||
self.check_centralized_port_created(router_op, subnet, port_id)
|
self.check_centralized_port_created(router_op, subnet, port_id)
|
||||||
network = self.create_topology_network(network_name="overlay-network")
|
network = self.create_topology_network(network_name="overlay-network")
|
||||||
subnet1 = self.create_topology_subnet(
|
subnet1 = self.create_topology_subnet(
|
||||||
@ -287,6 +288,7 @@ class ProviderNetworks(feature_manager.FeatureManager):
|
|||||||
'fixed_ips')[0]['ip_address'] == subnet['gateway_ip']:
|
'fixed_ips')[0]['ip_address'] == subnet['gateway_ip']:
|
||||||
port_id = port['id']
|
port_id = port['id']
|
||||||
break
|
break
|
||||||
|
if CONF.network.backend != 'nsxp':
|
||||||
self.check_downlink_port_created(router_op, subnet1, port_id)
|
self.check_downlink_port_created(router_op, subnet1, port_id)
|
||||||
|
|
||||||
@decorators.idempotent_id('3ca5b0d5-5be0-42e3-b3b1-eb653753fbfe')
|
@decorators.idempotent_id('3ca5b0d5-5be0-42e3-b3b1-eb653753fbfe')
|
||||||
|
Loading…
Reference in New Issue
Block a user