Merge "Addition of negative test: network creation with an above the limit mtu value. The value max_mtu can be configured in tempest.conf"
diff --git a/neutron_tempest_plugin/api/test_networks_negative.py b/neutron_tempest_plugin/api/test_networks_negative.py
index 1cc8b93..d4941e4 100644
--- a/neutron_tempest_plugin/api/test_networks_negative.py
+++ b/neutron_tempest_plugin/api/test_networks_negative.py
@@ -15,6 +15,9 @@
 import testtools
 
 from neutron_tempest_plugin.api import base
+from tempest import config
+
+CONF = config.CONF
 
 
 class NetworksNegativeTest(base.BaseNetworkTest):
@@ -33,3 +36,10 @@
             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)
diff --git a/neutron_tempest_plugin/config.py b/neutron_tempest_plugin/config.py
index 6217456..df07042 100644
--- a/neutron_tempest_plugin/config.py
+++ b/neutron_tempest_plugin/config.py
@@ -57,6 +57,9 @@
                     '"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'],