Browse Source

GVT api cases automation

{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_create_vlan_backed_gvt_with_incorrect_network_type_manual [0.315791s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_create_vlan_backed_gvt_with_incorrect_physical_network_id [0.619839s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_create_vlan_enabled_network_vlan40to1000and_update_subnet [21.580483s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_create_vlan_enabled_network_vlan40to1000and_updateqos [27.156031s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_create_vlan_enabled_network_vlan_40to1000with_disabled_dhcp [18.911594s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_delete_vlan_enabled_network_with_enabled_gvt_manual [3.854728s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_delete_vxlan_enabled_network_manual [2.748262s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_read_vlan_enabled_network_with_enabled_gvt [3.305594s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_read_vxlan_enabled_network [2.604374s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_update_subnet_vlan_enabled_network_with_enabled_gvt [4.314844s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_update_subnet_vxlan_enabled_network_with_enabled_gvt [3.468739s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_update_vlan_enabled_network_40to1000with_port_sec_dis [21.722404s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_update_with_port_security_vlan_enabled_network_with_gvt [5.927418s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_update_with_port_security_vxlan_enabled_network_with_gvt [3.736936s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_update_with_qos_vlan_enabled_network_with_enabled_gvt [7.531114s] ... ok
{0} vmware_nsx_tempest_plugin.tests.scenario.test_gvt.GuestVlanTaggingTests.test_update_with_qos_vxlan_enabled_network_with_enabled_gvt [6.458085s] ... ok

Change-Id: Iec639691662f8b72ad7ba3b92e15dce1002aec03
changes/64/773864/4
Shubham Kadam 3 months ago
parent
commit
4870aee2a1
4 changed files with 469 additions and 7 deletions
  1. +3
    -2
      vmware_nsx_tempest_plugin/lib/appliance_manager.py
  2. +8
    -0
      vmware_nsx_tempest_plugin/lib/feature_manager.py
  3. +5
    -5
      vmware_nsx_tempest_plugin/tests/scenario/test_allowed_addres_cidr.py
  4. +453
    -0
      vmware_nsx_tempest_plugin/tests/scenario/test_gvt.py

+ 3
- 2
vmware_nsx_tempest_plugin/lib/appliance_manager.py View File

@ -277,7 +277,7 @@ class ApplianceManager(manager.NetworkScenarioTest):
def create_topology_subnet(
self, subnet_name, network, routers_client=None,
subnets_client=None, router_id=None, ip_version=4, cidr=None,
mask_bits=None, clean_up=True, **kwargs):
mask_bits=None, clean_up=True, enable_dhcp=True, **kwargs):
subnet_name_ = constants.APPLIANCE_NAME_STARTS_WITH + subnet_name
if not subnets_client:
subnets_client = self.subnets_client
@ -318,7 +318,8 @@ class ApplianceManager(manager.NetworkScenarioTest):
raise
subnet = dict(name=data_utils.rand_name(subnet_name_),
network_id=network['id'], tenant_id=network['tenant_id'],
cidr=str_cidr, ip_version=ip_version, **kwargs)
cidr=str_cidr, ip_version=ip_version,
enable_dhcp=enable_dhcp, **kwargs)
try:
result = None
result = subnets_client.create_subnet(**subnet)


+ 8
- 0
vmware_nsx_tempest_plugin/lib/feature_manager.py View File

@ -23,6 +23,8 @@ from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.network import quotas_client as net_quota
from vmware_nsx_tempest_plugin._i18n import _
from vmware_nsx_tempest_plugin.common import constants
from vmware_nsx_tempest_plugin.lib import traffic_manager
@ -70,6 +72,12 @@ class FeatureManager(traffic_manager.IperfManager,
net_client.region,
net_client.endpoint_type,
**_params)
cls.network_quotas_client = net_quota.QuotasClient(
net_client.auth_provider,
net_client.service,
'nova',
'internal',
**_params)
cls.nsx_client = nsx_client.NSXClient(
CONF.network.backend,
CONF.nsxv3.nsx_manager,


+ 5
- 5
vmware_nsx_tempest_plugin/tests/scenario/test_allowed_addres_cidr.py View File

@ -73,7 +73,7 @@ class TestAllowedAddresCidr(feature_manager.FeatureManager):
CONF.nsxv3.nsx_user,
CONF.nsxv3.nsx_password)
@decorators.idempotent_id('2317449c-14ca-1428-a428-09956daa46c3')
@decorators.idempotent_id('4441119c-14ca-1428-a428-09956daa46c3')
def test_allowed_address_cidr_octavia_lb(self):
"""
Create NAT and Firewall rules on router.
@ -145,7 +145,7 @@ class TestAllowedAddresCidr(feature_manager.FeatureManager):
self.check_project_lbaas(no_resp=False)
self.delete_octavia_lb_resources(lb_cist['lb_id'])
@decorators.idempotent_id('2317449c-14ca-1428-a428-09956daa46c3')
@decorators.idempotent_id('2317449c-11cc-1428-a428-09956daa46c3')
def test_allowed_address_ipv6_cidr_octavia_lb(self):
"""
Create NAT and Firewall rules on router.
@ -282,7 +282,7 @@ class TestAllowedAddresCidr(feature_manager.FeatureManager):
self.assertIn(data, ['state_vm_1', 'state_vm_2'])
self.delete_octavia_lb_resources(lb_cist['lb_id'])
@decorators.idempotent_id('2317449c-14ca-1428-a428-09956daa46c3')
@decorators.idempotent_id('2317449c-14ca-1428-a444-09956daa46c3')
def test_allowed_address_0_0_0_0_cidr_octavia_lb(self):
"""
Create NAT and Firewall rules on router.
@ -360,7 +360,7 @@ class TestAllowedAddresCidr(feature_manager.FeatureManager):
self.check_project_lbaas(no_resp=False)
self.delete_octavia_lb_resources(lb_cist['lb_id'])
@decorators.idempotent_id('2317449c-14ca-1428-a428-09956daa46c3')
@decorators.idempotent_id('2317449c-14ca-1428-a428-00006daa46c3')
def test_allowed_address_cidr_barbican_octavia_lb(self):
"""
Create NAT and Firewall rules on router.
@ -452,7 +452,7 @@ class TestAllowedAddresCidr(feature_manager.FeatureManager):
self.check_project_lbaas(no_resp=False, HTTPS=True)
self.delete_octavia_lb_resources(lb_cist['lb_id'])
@decorators.idempotent_id('2317449c-14ca-1428-a428-09956daa46c3')
@decorators.idempotent_id('2317449c-14ca-1428-a428-99996daa46c3')
def test_allowed_address_ipv6_cidr_barbican_octavia_lb(self):
"""
Create NAT and Firewall rules on router.


+ 453
- 0
vmware_nsx_tempest_plugin/tests/scenario/test_gvt.py View File

@ -0,0 +1,453 @@
# Copyright 2021 VMware Inc
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions
from tempest.lib.common.utils import test_utils
from vmware_nsx_tempest_plugin.common import constants
from vmware_nsx_tempest_plugin.lib import feature_manager
from vmware_nsx_tempest_plugin.services import nsxv3_client
CONF = config.CONF
DSCP_MARK = 12
DSCP_MARK_UPDATED = 16
BW_VALUE_KBPS = 1024
BW_VALUE_MBPS = 1
UPDATED_BW_VALUE_KBPS = 2048
UPDATED_BW_VALUE_MBPS = 2
MAX_BURST_KBPS = 1024000
MAX_BURST_MBPS = 1
class GuestVlanTaggingTests(feature_manager.FeatureManager):
"""Test SR Anti Affinity
"""
@classmethod
def setup_clients(cls):
super(GuestVlanTaggingTests, cls).setup_clients()
cls.cmgr_adm = cls.get_client_manager('admin')
cls.cmgr_alt = cls.get_client_manager('alt')
cls.cmgr_adm = cls.get_client_manager('admin')
cls.routers_client = cls.cmgr_adm.routers_client
cls.networks_client = cls.cmgr_adm.networks_client
cls.subnets_client = cls.cmgr_adm.subnets_client
cls.sec_rule_client = cls.cmgr_adm.security_group_rules_client
cls.sec_client = cls.cmgr_adm.security_groups_client
cls.quotas_client = cls.cmgr_adm.quotas_client
@classmethod
def resource_setup(cls):
cls.nsx = nsxv3_client.NSXV3Client(CONF.nsxv3.nsx_manager,
CONF.nsxv3.nsx_user,
CONF.nsxv3.nsx_password)
out = cls.nsx.get_transport_zones()
vlan_flag = 0
vxlan_flag = 0
for tz in out:
if "transport_type" in tz.keys() and \
(vlan_flag == 0 or vxlan_flag == 0):
if vxlan_flag == 0 and tz['transport_type'] == "OVERLAY"\
and tz['_create_user'] == 'admin':
cls.overlay_id = tz['id']
vxlan_flag = 1
if vlan_flag == 0 and tz['transport_type'] == "VLAN"\
and tz['_create_user'] == 'admin':
cls.vlan_id = tz['id']
vlan_flag = 1
def provider_networks_gvt_topoloy(self, net_type,
admin_state_up=True,
tz_id=None,
vlan_id_unique=None,
networks_client=None,
transparent_vlan=True):
if networks_client is None:
networks_client = self.cmgr_adm.networks_client
if net_type == constants.VXLAN_TYPE:
name = "provider_network_vxlan"
if transparent_vlan:
body = {"provider:physical_network": tz_id,
"provider:network_type": net_type,
"admin_state_up": admin_state_up,
"vlan_transparent": True}
else:
body = {"provider:physical_network": tz_id,
"provider:network_type": net_type,
"admin_state_up": admin_state_up,
"vlan_transparent": False}
elif net_type == constants.VLAN_TYPE:
name = "provider_network_vlan"
if vlan_id_unique is not None:
vlan_id_no = vlan_id_unique
else:
vlan_id_no = 0
if tz_id is None:
if transparent_vlan:
body = {"provider:segmentation_id": vlan_id_no,
"provider:network_type": net_type,
"admin_state_up": admin_state_up,
"vlan_transparent": True}
else:
body = {"provider:segmentation_id": vlan_id_no,
"provider:network_type": net_type,
"admin_state_up": admin_state_up,
"vlan_transparent": False}
else:
if transparent_vlan:
body = {"provider:segmentation_id": vlan_id_no,
"provider:network_type": net_type,
"provider:physical_network": tz_id,
"admin_state_up": admin_state_up,
"vlan_transparent": True}
else:
body = {"provider:segmentation_id": vlan_id_no,
"provider:network_type": net_type,
"provider:physical_network": tz_id,
"admin_state_up": admin_state_up,
"vlan_transparent": False}
network = self.create_topology_network(name,
networks_client=networks_client,
**body)
return network
def _create_qos_policy(self):
"""Create a qos policy with bandwidth limit rule
and dscp rule
"""
name = data_utils.rand_name('test-qos-policy-')
policy = self.create_qos_policy(name,
description='bw_dscp_rule',
shared=False)
# add bw rule
self.create_bandwidth_limit_rule(
policy_id=policy['id'], max_kbps=BW_VALUE_KBPS,
max_burst_kbps=MAX_BURST_KBPS)
# add dscp rule
self.create_dscp_marking_rule(
policy_id=policy['id'], dscp_mark=DSCP_MARK)
return policy
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('86d814ed-fdce-4062-a633-2f0a7af5671d')
def test_read_vxlan_enabled_network(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VXLAN_TYPE, tz_id=self.overlay_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])
self.assertIsNotNone(network)
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-efdf-4062-a633-2f0a7af5671d')
def test_update_with_qos_vlan_enabled_network_with_enabled_gvt(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])['network']
self.assertIsNotNone(network)
qos_policy = self._create_qos_policy()
network = self.cmgr_adm.networks_client.update_network(
network['id'], qos_policy_id=qos_policy['id'])['network']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.networks_client.update_network,
network['id'], qos_policy_id=None)
self.assertEqual(network['qos_policy_id'],
qos_policy['id'])
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-fdce-5173-a633-2f0a7af5671d')
def test_update_with_qos_vxlan_enabled_network_with_enabled_gvt(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VXLAN_TYPE, tz_id=self.overlay_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])['network']
self.assertIsNotNone(network)
qos_policy = self._create_qos_policy()
network = self.cmgr_adm.networks_client.update_network(
network['id'], qos_policy_id=qos_policy['id'])['network']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.networks_client.update_network,
network['id'], qos_policy_id=None)
self.assertEqual(network['qos_policy_id'],
qos_policy['id'])
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-fdce-4062-b744-2f0a7af5671d')
def test_update_with_port_security_vlan_enabled_network_with_gvt(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])['network']
self.assertIsNotNone(network)
network = self.cmgr_adm.networks_client.update_network(
network['id'], port_security_enabled=False)['network']
self.assertEqual(network['port_security_enabled'],
False)
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-fdce-4062-a633-3e1b8af5671d')
def test_update_with_port_security_vxlan_enabled_network_with_gvt(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VXLAN_TYPE, tz_id=self.overlay_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])['network']
self.assertIsNotNone(network)
network = self.cmgr_adm.networks_client.update_network(
network['id'], port_security_enabled=False)['network']
self.assertEqual(network['port_security_enabled'],
False)
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-fdce-4062-a633-2f0a7af6723d')
def test_update_subnet_vlan_enabled_network_with_enabled_gvt(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
subnet = self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])['network']
self.assertIsNotNone(network)
subnet = self.cmgr_adm.subnets_client.update_subnet(
subnet['id'], name="test-subnet-new")['subnet']
self.assertEqual(subnet['name'],
"test-subnet-new")
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c703ae-fdce-4062-a633-2f0a7af5671d')
def test_update_subnet_vxlan_enabled_network_with_enabled_gvt(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VXLAN_TYPE, tz_id=self.overlay_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
subnet = self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])['network']
self.assertIsNotNone(network)
subnet = self.cmgr_adm.subnets_client.update_subnet(
subnet['id'], name="test-subnet-new")['subnet']
self.assertEqual(subnet['name'],
"test-subnet-new")
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-ebbb-5341-a633-2f0a7af5671d')
def test_read_vlan_enabled_network_with_enabled_gvt(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])
self.assertIsNotNone(network)
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-ffcc-4040-a633-2f0a7af5671d')
def test_delete_vlan_enabled_network_with_enabled_gvt_manual(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])
self.assertIsNotNone(network)
self.cmgr_adm.networks_client.delete_network(
provider_network['id'])
self.assertRaises(exceptions.NotFound,
self.cmgr_adm.networks_client.show_network,
provider_network['id'])
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-fdce-4062-aa22-2f0a7af5671d')
def test_delete_vxlan_enabled_network_manual(self):
provider_network = self.provider_networks_gvt_topoloy(
constants.VXLAN_TYPE, tz_id=self.overlay_id)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])
self.assertIsNotNone(network)
self.cmgr_adm.networks_client.delete_network(
provider_network['id'])
self.assertRaises(exceptions.NotFound,
self.cmgr_adm.networks_client.show_network,
provider_network['id'])
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-fdce-4062-a633-2f2f1ba5671d')
def test_create_vlan_backed_gvt_with_incorrect_physical_network_id(self):
self.assertRaises(exceptions.BadRequest,
self.provider_networks_gvt_topoloy,
constants.VLAN_TYPE,
tz_id="yajsjasj8281912")
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-fdce-0022-a633-2f0a7af5671d')
def test_create_vlan_backed_gvt_with_incorrect_network_type_manual(self):
networks_client = self.cmgr_adm.networks_client
name = "provider_network_vlan"
vlan_id_no = 0
body = {"provider:segmentation_id": vlan_id_no,
"provider:network_type": "vlan1",
"provider:physical_network": self.vlan_id,
"admin_state_up": True,
"vlan_transparent": True}
self.assertRaises(exceptions.BadRequest,
self.create_topology_network,
name, networks_client=networks_client,
**body)
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c793ed-dddd-4062-a633-2f0a7af5671d')
def test_create_vlan_enabled_network_vlan_40to1000with_disabled_dhcp(self):
kwargs = {'subnet': -1, 'network': -1, 'floatingip': -1,
'router': -1, 'port': -1}
self.network_quotas_client.update_quotas(
tenant_id=self.network_quotas_client.tenant_id, **kwargs)
for i in range(40, 1000):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id,
vlan_id_unique=i,
transparent_vlan=False)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.show_network(
provider_network['id'])
self.assertIsNotNone(network)
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c712aa-fdce-4062-a633-2f0a7af5671d')
def test_create_vlan_enabled_network_vlan40to1000and_update_subnet(self):
kwargs = {'subnet': -1, 'network': -1, 'floatingip': -1,
'router': -1, 'port': -1}
self.network_quotas_client.update_quotas(
tenant_id=self.network_quotas_client.tenant_id, **kwargs)
for i in range(40, 1000):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id,
vlan_id_unique=i,
transparent_vlan=False)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
subnet = self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
subnet = self.cmgr_adm.subnets_client.update_subnet(
subnet['id'], name="test-subnet-new")['subnet']
self.assertEqual(subnet['name'],
"test-subnet-new")
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('75c653ed-fdce-4062-a633-2f0a7af5671d')
def test_create_vlan_enabled_network_vlan40to1000and_updateqos(self):
kwargs = {'subnet': -1, 'network': -1, 'floatingip': -1,
'router': -1, 'port': -1}
self.network_quotas_client.update_quotas(
tenant_id=self.network_quotas_client.tenant_id, **kwargs)
qos_policy = self._create_qos_policy()
for i in range(40, 1000):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id,
vlan_id_unique=i,
transparent_vlan=False)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.update_network(
provider_network['id'],
qos_policy_id=qos_policy['id'])['network']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.cmgr_adm.networks_client.update_network,
network['id'], qos_policy_id=None)
self.assertEqual(network['qos_policy_id'],
qos_policy['id'])
@decorators.attr(type='nsxv3')
@decorators.idempotent_id('23a803ed-fdce-4062-a633-2f0a7af5671d')
def test_update_vlan_enabled_network_40to1000with_port_sec_dis(self):
kwargs = {'subnet': -1, 'network': -1, 'floatingip': -1,
'router': -1, 'port': -1}
self.network_quotas_client.update_quotas(
tenant_id=self.network_quotas_client.tenant_id, **kwargs)
for i in range(40, 1000):
provider_network = self.provider_networks_gvt_topoloy(
constants.VLAN_TYPE,
tz_id=self.vlan_id,
vlan_id_unique=i,
transparent_vlan=False)
subnet_client = self.cmgr_adm.subnets_client
subnet_name = provider_network['name'] + '_subnet'
self.create_topology_subnet(subnet_name, provider_network,
enable_dhcp=False,
subnets_client=subnet_client)
network = self.cmgr_adm.networks_client.update_network(
provider_network['id'], port_security_enabled=False)['network']
self.assertEqual(network['port_security_enabled'],
False)

Loading…
Cancel
Save