summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomsou <soth@intracom-telecom.com>2018-01-19 16:15:33 +0200
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-02-15 13:54:57 +0100
commitcf8727bcaa2b82c5f1d370bb41f62cd7ed8df571 (patch)
tree26659523f45f6fbb1def64000b4ea72cf96ccbc0
parente9167c0dbc19e056074817d4da351bd46b2e441c (diff)
Use bgvpn-delete and create instead of update
Testcases 1 and 4 fail because of netvirt bug [1] The same functionality is now achieved by using bgvpn-delete and bgpvpn-create cli commands instead of bgpvpn-update [1] https://jira.opendaylight.org/browse/NETVIRT-1067 Change-Id: Iaba6e06d0f39e356bf364b0640c707b0a83470d7 Signed-off-by: tomsou <soth@intracom-telecom.com> Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
-rw-r--r--sdnvpn/test/functest/testcase_1.py46
-rw-r--r--sdnvpn/test/functest/testcase_4.py48
2 files changed, 84 insertions, 10 deletions
diff --git a/sdnvpn/test/functest/testcase_1.py b/sdnvpn/test/functest/testcase_1.py
index 89011cd..b60a3c3 100644
--- a/sdnvpn/test/functest/testcase_1.py
+++ b/sdnvpn/test/functest/testcase_1.py
@@ -10,6 +10,7 @@
import logging
import sys
+import time
from functest.utils import openstack_utils as os_utils
from random import randint
@@ -192,11 +193,46 @@ def main():
results.add_to_summary(0, "-")
results.record_action(msg)
results.add_to_summary(0, "-")
- kwargs = {"import_targets": TESTCASE_CONFIG.targets1,
- "export_targets": TESTCASE_CONFIG.targets1,
- "name": vpn_name}
- bgpvpn = test_utils.update_bgpvpn(neutron_client,
- bgpvpn_id, **kwargs)
+
+ # use bgpvpn-create instead of update till NETVIRT-1067 bug is fixed
+ # kwargs = {"import_targets": TESTCASE_CONFIG.targets1,
+ # "export_targets": TESTCASE_CONFIG.targets1,
+ # "name": vpn_name}
+ # bgpvpn = test_utils.update_bgpvpn(neutron_client,
+ # bgpvpn_id, **kwargs)
+
+ test_utils.delete_bgpvpn(neutron_client, bgpvpn_id)
+ bgpvpn_ids.remove(bgpvpn_id)
+ kwargs = {
+ "import_targets": TESTCASE_CONFIG.targets1,
+ "export_targets": TESTCASE_CONFIG.targets1,
+ "route_distinguishers": TESTCASE_CONFIG.route_distinguishers,
+ "name": vpn_name
+ }
+
+ test_utils.wait_before_subtest()
+
+ bgpvpn = test_utils.create_bgpvpn(neutron_client, **kwargs)
+ bgpvpn_id = bgpvpn['bgpvpn']['id']
+ logger.debug("VPN re-created details: %s" % bgpvpn)
+ bgpvpn_ids.append(bgpvpn_id)
+
+ msg = ("Associate network '%s' to the VPN." %
+ TESTCASE_CONFIG.net_1_name)
+ results.record_action(msg)
+ results.add_to_summary(0, "-")
+
+ test_utils.create_network_association(
+ neutron_client, bgpvpn_id, network_1_id)
+
+ test_utils.create_network_association(
+ neutron_client, bgpvpn_id, network_2_id)
+
+ test_utils.wait_for_bgp_net_assocs(neutron_client,
+ bgpvpn_id,
+ network_1_id,
+ network_2_id)
+ # The above code has to be removed after re-enabling bgpvpn-update
logger.info("Waiting for the VMs to connect to each other using the"
" updated network configuration")
diff --git a/sdnvpn/test/functest/testcase_4.py b/sdnvpn/test/functest/testcase_4.py
index cc429c3..042fb59 100644
--- a/sdnvpn/test/functest/testcase_4.py
+++ b/sdnvpn/test/functest/testcase_4.py
@@ -10,6 +10,7 @@
import logging
import sys
+import time
from functest.utils import openstack_utils as os_utils
from random import randint
@@ -199,11 +200,48 @@ def main():
results.add_to_summary(0, "-")
results.record_action(msg)
results.add_to_summary(0, "-")
- kwargs = {"import_targets": TESTCASE_CONFIG.targets1,
- "export_targets": TESTCASE_CONFIG.targets1,
- "name": vpn_name}
- bgpvpn = test_utils.update_bgpvpn(neutron_client,
- bgpvpn_id, **kwargs)
+
+ # use bgpvpn-create instead of update till NETVIRT-1067 bug is fixed
+ # kwargs = {"import_targets": TESTCASE_CONFIG.targets1,
+ # "export_targets": TESTCASE_CONFIG.targets1,
+ # "name": vpn_name}
+ # bgpvpn = test_utils.update_bgpvpn(neutron_client,
+ # bgpvpn_id, **kwargs)
+
+ test_utils.delete_bgpvpn(neutron_client, bgpvpn_id)
+ bgpvpn_ids.remove(bgpvpn_id)
+ kwargs = {
+ "import_targets": TESTCASE_CONFIG.targets1,
+ "export_targets": TESTCASE_CONFIG.targets1,
+ "route_distinguishers": TESTCASE_CONFIG.route_distinguishers,
+ "name": vpn_name
+ }
+
+ test_utils.wait_before_subtest()
+
+ bgpvpn = test_utils.create_bgpvpn(neutron_client, **kwargs)
+ bgpvpn_id = bgpvpn['bgpvpn']['id']
+ logger.debug("VPN re-created details: %s" % bgpvpn)
+ bgpvpn_ids.append(bgpvpn_id)
+
+ msg = ("Associate again network '%s' and router '%s 'to the VPN."
+ % (TESTCASE_CONFIG.net_2_name,
+ TESTCASE_CONFIG.router_1_name))
+ results.add_to_summary(0, "-")
+ results.record_action(msg)
+ results.add_to_summary(0, "-")
+
+ test_utils.create_router_association(
+ neutron_client, bgpvpn_id, router_1_id)
+
+ test_utils.create_network_association(
+ neutron_client, bgpvpn_id, network_2_id)
+
+ test_utils.wait_for_bgp_router_assoc(
+ neutron_client, bgpvpn_id, router_1_id)
+ test_utils.wait_for_bgp_net_assoc(
+ neutron_client, bgpvpn_id, network_2_id)
+ # The above code has to be removed after re-enabling bgpvpn-update
logger.info("Waiting for the VMs to connect to each other using the"
" updated network configuration")