summaryrefslogtreecommitdiffstats
path: root/test/functest/utils.py
diff options
context:
space:
mode:
authorRomanos Skiadas <rski@intracom-telecom.com>2016-10-18 16:34:24 +0300
committerJose Lausuch <jose.lausuch@ericsson.com>2016-11-03 10:38:56 +0000
commit80ad3feb6f6f8e8e7d86ddf1f96dd160f05e5059 (patch)
tree98347c9fc69b6eab2544d8892e035fd4f1689d34 /test/functest/utils.py
parent31d8a2646bebb952a273d37186ceb80e51f18032 (diff)
Fix network assoc tests in Boroncolorado.2.0stable/colorado
Network assoc in Boron with netvirt does not work for subnets that have a router due to an inherent limitation in the implementation. See the mailing list and related bug: https://bugs.opendaylight.org/show_bug.cgi?id=6962 https://lists.opendaylight.org/pipermail/netvirt-dev/2016-October/001815.html Also, if a subnet does not have a route distinguisher, it is not added to the FIB, so association does not make traffic move between subnets. This is intentional and an error is logged when a subnet is associated to a bvpvpn without a route distinguisher. This commit fixes the net assoc case and works around these issues by: - Removing the routers from the subnets in testcase_1 - Adding a route distinguisher to the bgpvpn JIRA: SDNVPN-74 Change-Id: I6b57eab89839d9e9122cd24b0f05737467439dd9 Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com> (cherry picked from commit b9eb7024b014cba0d299b1cf3b01e179c7d0482e)
Diffstat (limited to 'test/functest/utils.py')
-rw-r--r--test/functest/utils.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functest/utils.py b/test/functest/utils.py
index 4d921c8..97f58c7 100644
--- a/test/functest/utils.py
+++ b/test/functest/utils.py
@@ -16,8 +16,36 @@ import functest.utils.openstack_utils as os_utils
logger = ft_logger.Logger("sndvpn_test_utils").getLogger()
+def create_net(neutron_client, name):
+ logger.debug("Creating network %s", name)
+ net_id = os_utils.create_neutron_net(neutron_client, name)
+ if not net_id:
+ logger.error(
+ "There has been a problem when creating the neutron network")
+ sys.exit(-1)
+ return net_id
+
+
+def create_subnet(neutron_client, name, cidr, net_id):
+ logger.debug("Creating subnet %s in network %s with cidr %s",
+ name, net_id, cidr)
+ subnet_id = os_utils.create_neutron_subnet(neutron_client,
+ name,
+ cidr,
+ net_id)
+ if not subnet_id:
+ logger.error(
+ "There has been a problem when creating the neutron subnet")
+ sys.exit(-1)
+ return subnet_id
+
+
def create_network(neutron_client, net, subnet1, cidr1,
router, subnet2=None, cidr2=None):
+ """Network assoc will not work for networks/subnets created by this function.
+
+ It is an ODL limitation due to it handling routers as vpns.
+ See https://bugs.opendaylight.org/show_bug.cgi?id=6962"""
network_dic = os_utils.create_network_full(neutron_client,
net,
subnet1,