test_floatingip: Add a case for SRC without FIP
Change-Id: Iaa7121ced07f7877292e4ff15926bf02b5e7aaa1
diff --git a/neutron/tests/tempest/scenario/test_floatingip.py b/neutron/tests/tempest/scenario/test_floatingip.py
index 1ccb6ac..e4ad01d 100644
--- a/neutron/tests/tempest/scenario/test_floatingip.py
+++ b/neutron/tests/tempest/scenario/test_floatingip.py
@@ -19,6 +19,7 @@
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 @@
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 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 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