Merge "Re-enable internal DNS tests"
diff --git a/.zuul.yaml b/.zuul.yaml
index 750f21f..fbfcad6 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -392,7 +392,7 @@
devstack_localrc:
PHYSICAL_NETWORK: default
DOWNLOAD_DEFAULT_IMAGES: false
- IMAGE_URLS: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img,http://cloud-images.ubuntu.com/releases/16.04/release-20180622/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
+ IMAGE_URLS: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img,https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
DEFAULT_IMAGE_NAME: cirros-0.3.4-i386-disk
ADVANCED_IMAGE_NAME: ubuntu-16.04-server-cloudimg-amd64-disk1
ADVANCED_INSTANCE_TYPE: ds512M
@@ -507,7 +507,7 @@
NETWORK_API_EXTENSIONS: "{{ (network_api_extensions_common + network_api_extensions_dvr) | join(',') }}"
PHYSICAL_NETWORK: default
DOWNLOAD_DEFAULT_IMAGES: false
- IMAGE_URLS: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img,http://cloud-images.ubuntu.com/releases/16.04/release-20180622/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
+ IMAGE_URLS: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img,https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
DEFAULT_IMAGE_NAME: cirros-0.3.4-i386-disk
ADVANCED_IMAGE_NAME: ubuntu-16.04-server-cloudimg-amd64-disk1
ADVANCED_INSTANCE_TYPE: ds512M
@@ -526,6 +526,7 @@
neutron-segments: true
neutron-trunk: true
neutron-log: true
+ neutron-port-forwarding: true
cinder: true
devstack_local_conf:
post-config:
@@ -588,6 +589,7 @@
neutron-qos: true
neutron-trunk: true
neutron-log: true
+ neutron-port-forwarding: true
devstack_local_conf:
post-config:
$NEUTRON_CONF:
diff --git a/HACKING.rst b/HACKING.rst
index cd3c49c..3392185 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -1,4 +1,4 @@
openstack Style Commandments
-===============================================
+============================
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/
diff --git a/neutron_tempest_plugin/scenario/test_connectivity.py b/neutron_tempest_plugin/scenario/test_connectivity.py
index 311c263..6aaf48d 100644
--- a/neutron_tempest_plugin/scenario/test_connectivity.py
+++ b/neutron_tempest_plugin/scenario/test_connectivity.py
@@ -146,3 +146,77 @@
self.check_remote_connectivity(
sshclient, internal_port_2['fixed_ips'][0]['ip_address'],
ping_count=10)
+
+ @utils.requires_ext(extension="dvr", service="network")
+ @decorators.idempotent_id('69d3650a-5c32-40bc-ae56-5c4c849ddd37')
+ def test_connectivity_dvr_and_no_dvr_routers_in_same_subnet(self):
+ """This test case tests connectivity between vm and 2 routers.
+
+ Subnet is connected to dvr and non-dvr routers in the same time, test
+ ensures that connectivity from VM to both routers is working.
+
+ Test scenario:
+ +----------------+ +------------+
+ | Non-dvr router | | DVR router |
+ | | | |
+ | 10.0.0.1 | | 10.0.0.x |
+ +-------+--------+ +-----+------+
+ | |
+ | 10.0.0.0/24 |
+ +----------------+----------------+
+ |
+ +-+-+
+ |VM |
+ +---+
+
+ where:
+ 10.0.0.1 - is subnet's gateway IP address,
+ 10.0.0.x - is any other IP address taken from subnet's range
+
+ Test ensures that both 10.0.0.1 and 10.0.0.x IP addresses are
+ reachable from VM.
+ """
+
+ network = self.create_network()
+ subnet = self.create_subnet(
+ network, cidr="10.0.0.0/24", gateway="10.0.0.1")
+
+ non_dvr_router = self.create_router_by_client(
+ tenant_id=self.client.tenant_id,
+ is_admin=True,
+ router_name=data_utils.rand_name("nondvr-2-routers-same-network"),
+ admin_state_up=True,
+ distributed=False)
+ self.create_router_interface(non_dvr_router['id'], subnet['id'])
+
+ dvr_router = self.create_router_by_client(
+ tenant_id=self.client.tenant_id,
+ is_admin=True,
+ router_name=data_utils.rand_name("dvr-2-rotuers-same-network"),
+ admin_state_up=True,
+ distributed=True)
+ dvr_router_port = self.create_port(network)
+ self.client.add_router_interface_with_port_id(
+ dvr_router['id'], dvr_router_port['id'])
+
+ vm = self.create_server(
+ flavor_ref=CONF.compute.flavor_ref,
+ image_ref=CONF.compute.image_ref,
+ key_name=self.keypair['name'],
+ networks=[{'uuid': network['id']}],
+ security_groups=[{'name': self.secgroup['name']}])
+ self.wait_for_server_active(vm['server'])
+
+ vm_port = self.client.list_ports(
+ network_id=network['id'], device_id=vm['server']['id'])['ports'][0]
+ fip = self.create_and_associate_floatingip(vm_port['id'])
+
+ sshclient = ssh.Client(
+ fip['floating_ip_address'], CONF.validation.image_ssh_user,
+ pkey=self.keypair['private_key'])
+
+ self.check_remote_connectivity(
+ sshclient, '10.0.0.1', ping_count=10)
+ self.check_remote_connectivity(
+ sshclient, dvr_router_port['fixed_ips'][0]['ip_address'],
+ ping_count=10)
diff --git a/neutron_tempest_plugin/scenario/test_port_forwardings.py b/neutron_tempest_plugin/scenario/test_port_forwardings.py
new file mode 100644
index 0000000..e366d8f
--- /dev/null
+++ b/neutron_tempest_plugin/scenario/test_port_forwardings.py
@@ -0,0 +1,75 @@
+# Copyright 2019 Red Hat, Inc.
+# All Rights Reserved.
+#
+# 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 tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
+
+from neutron_tempest_plugin.common import ssh
+from neutron_tempest_plugin import config
+from neutron_tempest_plugin.scenario import base
+
+CONF = config.CONF
+
+
+class PortForwardingTestJSON(base.BaseTempestTestCase):
+
+ required_extensions = ['router', 'floating-ip-port-forwarding']
+
+ @classmethod
+ def resource_setup(cls):
+ super(PortForwardingTestJSON, cls).resource_setup()
+ cls.network = cls.create_network()
+ cls.subnet = cls.create_subnet(cls.network)
+ cls.router = cls.create_router_by_client()
+ cls.create_router_interface(cls.router['id'], cls.subnet['id'])
+ cls.fip = cls.create_floatingip()
+ cls.secgroup = cls.create_security_group(
+ name=data_utils.rand_name("test_port_secgroup"))
+ cls.create_loginable_secgroup_rule(secgroup_id=cls.secgroup['id'])
+ cls.keypair = cls.create_keypair()
+
+ @decorators.idempotent_id('ab40fc48-ca8d-41a0-b2a3-f6679c847bfe')
+ def test_port_forwarding_to_2_servers(self):
+ internal_tcp_port = 22
+ servers = []
+ for i in range(1, 3):
+ external_tcp_port = 1000 + i
+ name = data_utils.rand_name("server-%s" % i)
+ port = self.create_port(
+ self.network,
+ security_groups=[self.secgroup['id']])
+ server = self.create_server(
+ flavor_ref=CONF.compute.flavor_ref,
+ image_ref=CONF.compute.image_ref,
+ key_name=self.keypair['name'], name=name,
+ networks=[{'port': port['id']}])['server']
+ server['name'] = name
+ self.wait_for_server_active(server)
+ server['port_forwarding'] = self.create_port_forwarding(
+ self.fip['id'],
+ internal_port_id=port['id'],
+ internal_ip_address=port['fixed_ips'][0]['ip_address'],
+ internal_port=internal_tcp_port,
+ external_port=external_tcp_port,
+ protocol="tcp")
+ servers.append(server)
+
+ for server in servers:
+ ssh_client = ssh.Client(
+ self.fip['floating_ip_address'],
+ CONF.validation.image_ssh_user,
+ pkey=self.keypair['private_key'],
+ port=server['port_forwarding']['external_port'])
+ self.assertIn(server['name'], ssh_client.exec_command('hostname'))
diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst
index 5648f19..7486090 100644
--- a/releasenotes/source/index.rst
+++ b/releasenotes/source/index.rst
@@ -1,6 +1,6 @@
-======================================
- Neutron Tempest Plugin Release Notes
-======================================
+====================================
+Neutron Tempest Plugin Release Notes
+====================================
.. toctree::
:maxdepth: 1
diff --git a/test-requirements.txt b/test-requirements.txt
index c0546cf..20b29f4 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -7,7 +7,8 @@
coverage!=4.4,>=4.0 # Apache-2.0
flake8-import-order==0.12 # LGPLv3
python-subunit>=1.0.0 # Apache-2.0/BSD
-sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
+sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
+sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testtools>=2.2.0 # MIT