Restore execution of FloatingIpWithMtuWritableTest

Test floating IP with a network with a custom MTU
size.

Change-Id: I47ff6e0dc5eee366951ac46b52c471bbbb58a555
This commit is contained in:
Federico Ressi 2019-06-18 10:45:03 +02:00
parent 7668c64bbc
commit 823ac73bad
3 changed files with 36 additions and 30 deletions

View File

@ -32,4 +32,14 @@ def register_tobiko_options(conf):
help="The CIDR block to allocate IPv6 subnets from"),
cfg.IntOpt('ipv6_prefixlen',
default=64,
help="The mask bits for IPv6 subnets")])
help="The mask bits for IPv6 subnets"),
cfg.IntOpt('custom_mtu_size',
default=1400,
help=("Customized maximum transfer unit size\n"
"Notes:\n"
" - MTU values as small as 1000 has been seen "
"breaking networking binding due to an "
"unknown cause.\n"
" - Too big MTU values (like greater than 1400)"
" may be refused during network creation")),
])

View File

@ -16,6 +16,7 @@
from __future__ import absolute_import
import netaddr
from oslo_log import log
import tobiko
from tobiko import config
@ -28,6 +29,7 @@ from tobiko.shell import ssh
CONF = config.CONF
LOG = log.getLogger(__name__)
@neutron.skip_if_missing_networking_extensions('port-security')
@ -68,16 +70,20 @@ class NetworkStackFixture(heat.HeatStackFixture):
def value_specs(self):
return {}
#: Floating IP network where the Neutron floating IPs are created
gateway_network = CONF.tobiko.neutron.floating_network
@property
def gateway_network(self):
"""Floating IP network where the Neutron floating IPs are created"""
return CONF.tobiko.neutron.floating_network
@property
def has_gateway(self):
"""Whenever to setup gateway router"""
return bool(self.gateway_network)
# Whenever cat obtain network MTU value
has_net_mtu = neutron.has_networking_extensions('net-mtu')
@property
def has_net_mtu(self):
"""Whenever can obtain network MTU value"""
return neutron.has_networking_extensions('net-mtu')
@property
def network_details(self):
@ -129,17 +135,15 @@ class NetworkStackFixture(heat.HeatStackFixture):
@neutron.skip_if_missing_networking_extensions('net-mtu-writable')
class NetworkWithNetMtuWriteStackFixture(NetworkStackFixture):
# Whenever cat obtain network MTU value
has_net_mtu = True
#: Value for maximum transfer unit on the internal network
mtu = 1000
@property
def custom_mtu_size(self):
return CONF.tobiko.neutron.custom_mtu_size
@property
def value_specs(self):
return dict(
super(NetworkWithNetMtuWriteStackFixture, self).value_specs,
mtu=int(self.mtu))
value_specs = super(
NetworkWithNetMtuWriteStackFixture, self).value_specs
return dict(value_specs, mtu=self.custom_mtu_size)
@neutron.skip_if_missing_networking_extensions('security-group')

View File

@ -108,18 +108,6 @@ class FloatingIPTest(base.TobikoTest):
count=5,
check=False).assert_not_replied()
@neutron.skip_if_missing_networking_extensions('net-mtu-writable')
def test_mtu_net_attribute(self):
"""Test 'mtu' network attribute"""
if self.expected_net_mtu:
self.assertEqual(self.expected_net_mtu,
self.observed_net_mtu)
@property
def expected_net_mtu(self):
"""Expected MTU value for internal network"""
return self.stack.network_stack.mtu
@property
def observed_net_mtu(self):
"""Actual MTU value for internal network"""
@ -220,13 +208,17 @@ class FloatingIPWithNetMtuWritableFixture(stacks.FloatingIpServerStackFixture):
@neutron.skip_if_missing_networking_extensions('net-mtu-writable')
class FlatingIpWithMtuWritableTest(FloatingIPTest):
class FloatingIpWithMtuWritableTest(FloatingIPTest):
"""Tests connectivity via floating IP with a custom MTU value"""
#: Resources stack with floating IP and Nova server
stack = tobiko.required_setup_fixture(FloatingIPWithNetMtuWritableFixture)
@classmethod
def setUpClass(cls):
super(FlatingIpWithMtuWritableTest, cls).setUpClass()
tobiko.skip('Disable this test to see if it fixes the problem')
def test_net_mtu_write(self):
"""Test 'mtu' network attribute"""
self.assertEqual(self.expected_net_mtu, self.observed_net_mtu)
@property
def expected_net_mtu(self):
"""Expected MTU value for internal network"""
return self.stack.network_stack.custom_mtu_size