Merge "test_floatingip: Add a case for SRC without FIP"

This commit is contained in:
Jenkins 2017-06-29 04:30:15 +00:00 committed by Gerrit Code Review
commit f54feddd4a
1 changed files with 31 additions and 10 deletions

View File

@ -19,6 +19,7 @@ from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest import test
import testscenarios
from testscenarios.scenarios import multiply_scenarios
from neutron.tests.tempest.common import ssh
from neutron.tests.tempest import config
@ -83,12 +84,28 @@ class FloatingIpTestCasesMixin(object):
return {'port': port, 'fip': fip, 'server': server}
def _test_east_west(self):
# The proxy VM is used to control the source VM when it doesn't
# have a floating-ip.
if self.src_has_fip:
proxy = None
proxy_client = None
else:
proxy = self._create_server()
proxy_client = ssh.Client(proxy['fip']['floating_ip_address'],
CONF.validation.image_ssh_user,
pkey=self.keypair['private_key'])
# Source VM
server1 = self._create_server()
server1_ip = server1['fip']['floating_ip_address']
ssh_client = ssh.Client(server1_ip,
if self.src_has_fip:
src_server = self._create_server()
src_server_ip = src_server['fip']['floating_ip_address']
else:
src_server = self._create_server(create_floating_ip=False)
src_server_ip = src_server['port']['fixed_ips'][0]['ip_address']
ssh_client = ssh.Client(src_server_ip,
CONF.validation.image_ssh_user,
pkey=self.keypair['private_key'])
pkey=self.keypair['private_key'],
proxy_client=proxy_client)
# Destination VM
if self.dest_has_fip:
@ -107,11 +124,13 @@ class FloatingIpTestCasesMixin(object):
class FloatingIpSameNetwork(FloatingIpTestCasesMixin,
base.BaseTempestTestCase):
# REVISIT(yamamoto): 'SRC without FIP' case is possible?
scenarios = [
scenarios = multiply_scenarios([
('SRC with FIP', dict(src_has_fip=True)),
('SRC without FIP', dict(src_has_fip=False)),
], [
('DEST with FIP', dict(dest_has_fip=True)),
('DEST without FIP', dict(dest_has_fip=False)),
]
])
same_network = True
@ -122,11 +141,13 @@ class FloatingIpSameNetwork(FloatingIpTestCasesMixin,
class FloatingIpSeparateNetwork(FloatingIpTestCasesMixin,
base.BaseTempestTestCase):
# REVISIT(yamamoto): 'SRC without FIP' case is possible?
scenarios = [
scenarios = multiply_scenarios([
('SRC with FIP', dict(src_has_fip=True)),
('SRC without FIP', dict(src_has_fip=False)),
], [
('DEST with FIP', dict(dest_has_fip=True)),
('DEST without FIP', dict(dest_has_fip=False)),
]
])
same_network = False