Addition of negative test: network creation with an

above the limit mtu value.
The value max_mtu can be configured in tempest.conf

Change-Id: Ic1d488418fbceeca9ff34baa2d177431e98c1edc
This commit is contained in:
pkomarov 2019-03-23 22:53:26 +02:00 committed by Slawek Kaplonski
parent c1052e777d
commit 5ce1bc22b4
2 changed files with 13 additions and 0 deletions

View File

@ -15,6 +15,9 @@ from tempest.lib import exceptions as lib_exc
import testtools
from neutron_tempest_plugin.api import base
from tempest import config
CONF = config.CONF
class NetworksNegativeTest(base.BaseNetworkTest):
@ -33,3 +36,10 @@ class NetworksNegativeTest(base.BaseNetworkTest):
self.client.delete_subnet(self.subnet['id'])
with testtools.ExpectedException(lib_exc.Conflict):
self.client.delete_network(self.network['id'])
@decorators.attr(type='negative')
@decorators.idempotent_id('9f80f25b-5d1b-4f26-9f6b-774b9b270820')
def test_update_network_mtu(self):
with testtools.ExpectedException(lib_exc.BadRequest):
self.client.create_network(
mtu=CONF.neutron_plugin_options.max_mtu + 1)

View File

@ -57,6 +57,9 @@ NeutronPluginOptions = [
'"mtu":<MTU> - integer '
'"cidr"<SUBNET/MASK> - string '
'"provider:segmentation_id":<VLAN_ID> - integer'),
cfg.IntOpt('max_mtu',
default=1500,
help='Max mtu value of default deployments".'),
cfg.StrOpt('q_agent',
default=None,
choices=['None', 'linuxbridge', 'ovs', 'sriov'],