Add VM to VM L3HA connectivity test cases

Change-Id: I110b0f25411b51e515e96313855633e5573c0411
This commit is contained in:
Federico Ressi 2019-07-30 13:07:07 +02:00
parent ee63744150
commit 262dee6d22
7 changed files with 92 additions and 24 deletions

View File

@ -16,6 +16,7 @@
from __future__ import absolute_import
from tobiko.openstack.stacks import _cirros
from tobiko.openstack.stacks import _l3ha
from tobiko.openstack.stacks import _neutron
from tobiko.openstack.stacks import _nova
from tobiko.openstack.stacks import _ubuntu
@ -28,10 +29,15 @@ CirrosDifferentHostServerStackFixture = (
_cirros.CirrosDifferentHostServerStackFixture)
CirrosSameHostServerStackFixture = _cirros.CirrosSameHostServerStackFixture
L3haNetworkStackFixture = _l3ha.L3haNetworkStackFixture
L3haServerStackFixture = _l3ha.L3haServerStackFixture
L3haPeerServerStackFixture = _l3ha.L3haPeerServerStackFixture
L3haDifferentHostServerStackFixture = _l3ha.L3haDifferentHostServerStackFixture
L3haSameHostServerStackFixture = _l3ha.L3haSameHostServerStackFixture
NetworkStackFixture = _neutron.NetworkStackFixture
NetworkWithNetMtuWriteStackFixture = (
_neutron.NetworkWithNetMtuWriteStackFixture)
NetworkWithL3HAStackFixture = _neutron.NetworkWithL3HAStackFixture
SecurityGroupsFixture = _neutron.SecurityGroupsFixture
ServerStackFixture = _nova.ServerStackFixture

View File

@ -0,0 +1,47 @@
# Copyright 2019 Red Hat
#
# 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 __future__ import absolute_import
import tobiko
from tobiko.openstack import neutron
from tobiko.openstack.stacks import _cirros
from tobiko.openstack.stacks import _neutron
from tobiko.openstack.stacks import _nova
@neutron.skip_if_missing_networking_extensions('l3-ha')
class L3haNetworkStackFixture(_neutron.NetworkStackFixture):
ha = True
@neutron.skip_if_missing_networking_extensions('l3-ha')
class L3haServerStackFixture(_cirros.CirrosServerStackFixture):
#: Heat stack for creating internal network with custom MTU value
network_stack = tobiko.required_setup_fixture(
L3haNetworkStackFixture)
class L3haPeerServerStackFixture(
L3haServerStackFixture, _nova.PeerServerStackFixture):
peer_stack = tobiko.required_setup_fixture(L3haServerStackFixture)
class L3haSameHostServerStackFixture(
L3haPeerServerStackFixture, _nova.SameHostServerStackFixture):
pass
class L3haDifferentHostServerStackFixture(
L3haPeerServerStackFixture, _nova.DifferentHostServerStackFixture):
pass

View File

@ -153,11 +153,6 @@ class NetworkWithNetMtuWriteStackFixture(NetworkStackFixture):
return dict(value_specs, mtu=self.custom_mtu_size)
@neutron.skip_if_missing_networking_extensions('l3-ha')
class NetworkWithL3HAStackFixture(NetworkStackFixture):
ha = True
@neutron.skip_if_missing_networking_extensions('security-group')
class SecurityGroupsFixture(heat.HeatStackFixture):
"""Heat stack with some security groups

View File

@ -219,6 +219,10 @@ class PeerServerStackFixture(ServerStackFixture):
username=self.username,
proxy_command=proxy_command)
@property
def network(self):
return self.peer_stack.network
@nova.skip_if_missing_hypervisors(count=2, state='up', status='enabled')
class DifferentHostServerStackFixture(PeerServerStackFixture):

View File

@ -234,22 +234,11 @@ class FloatingIpWithMtuWritableTest(FloatingIPTest):
return self.stack.network_stack.custom_mtu_size
# --- Test la-h3 extension --------------------------------------------
@neutron.skip_if_missing_networking_extensions('l3-ha')
class FloatingIPWithL3HAFixture(stacks.CirrosServerStackFixture):
"""Heat stack for testing floating IP with a custom MTU network value"""
#: Heat stack for creating internal network with custom MTU value
network_stack = tobiko.required_setup_fixture(
stacks.NetworkWithL3HAStackFixture)
# --- Test la-h3 extension ----------------------------------------------------
@neutron.skip_if_missing_networking_extensions('l3-ha')
@neutron.skip_if_missing_networking_agents(binary='neutron-l3-agent',
count=2)
class NetworkWithL3HATest(FloatingIPTest):
"""Tests connectivity via floating IP with a custom MTU value"""
class FloatingIpWithL3HATest(FloatingIPTest):
#: Resources stack with floating IP and Nova server
stack = tobiko.required_setup_fixture(FloatingIPWithL3HAFixture)
stack = tobiko.required_setup_fixture(stacks.L3haServerStackFixture)

View File

@ -64,8 +64,6 @@ class NetworkTest(testtools.TestCase):
gateway['ha'])
# --- Same compute host VM to VM scenario -------------------------------------
class SameHostNetworkTest(NetworkTest):
#: Resources stack with Nova server to send messages to
@ -81,8 +79,6 @@ class SameHostNetworkTest(NetworkTest):
getattr(receiver, 'OS-EXT-SRV-ATTR:host'))
# --- Different compute host VM to VM scenario --------------------------------
@nova.skip_if_missing_hypervisors(count=2, state='up', status='enabled')
class DifferentHostNetworkTest(NetworkTest):
@ -97,3 +93,31 @@ class DifferentHostNetworkTest(NetworkTest):
self.stack.scheduler_hints)
self.assertNotEqual(getattr(sender, 'OS-EXT-SRV-ATTR:host'),
getattr(receiver, 'OS-EXT-SRV-ATTR:host'))
# --- l3-ha extension VM to VM scenario ---------------------------------------
@neutron.skip_if_missing_networking_extensions('l3-ha')
@neutron.skip_if_missing_networking_agents(binary='neutron-l3-agent',
count=2)
class L3haNetworkTest(NetworkTest):
#: Resources stack with floating IP and Nova server
stack = tobiko.required_setup_fixture(stacks.L3haPeerServerStackFixture)
@neutron.skip_if_missing_networking_extensions('l3-ha')
@neutron.skip_if_missing_networking_agents(binary='neutron-l3-agent',
count=2)
class L3haSameHostNetworkTest(SameHostNetworkTest):
#: Resources stack with Nova server to send messages to
stack = tobiko.required_setup_fixture(
stacks.L3haSameHostServerStackFixture)
@neutron.skip_if_missing_networking_extensions('l3-ha')
@neutron.skip_if_missing_networking_agents(binary='neutron-l3-agent',
count=2)
class L3haDifferentHostNetworkTest(SameHostNetworkTest):
#: Resources stack with Nova server to send messages to
stack = tobiko.required_setup_fixture(
stacks.L3haDifferentHostServerStackFixture)

View File

@ -59,6 +59,9 @@
quota_floatingip: 500
quota_security_group: 100
quota_security_group_rule: 1000
$NOVA_CONF:
QUOTAS:
quota_instances: 20
test-config:
$TEMPEST_CONFIG:
compute: