summaryrefslogtreecommitdiffstats
path: root/sdnvpn/test/functest/testcase_4.py
diff options
context:
space:
mode:
Diffstat (limited to 'sdnvpn/test/functest/testcase_4.py')
-rw-r--r--sdnvpn/test/functest/testcase_4.py58
1 files changed, 48 insertions, 10 deletions
diff --git a/sdnvpn/test/functest/testcase_4.py b/sdnvpn/test/functest/testcase_4.py
index cc429c3..9b11cc3 100644
--- a/sdnvpn/test/functest/testcase_4.py
+++ b/sdnvpn/test/functest/testcase_4.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
#
# Copyright (c) 2017 All rights reserved
# This program and the accompanying materials
@@ -11,9 +11,9 @@
import logging
import sys
-from functest.utils import openstack_utils as os_utils
from random import randint
from sdnvpn.lib import config as sdnvpn_config
+from sdnvpn.lib import openstack_utils as os_utils
from sdnvpn.lib import utils as test_utils
from sdnvpn.lib.results import Results
@@ -199,18 +199,57 @@ 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")
test_utils.wait_before_subtest()
- results.get_ping_status(vm_1, vm_4, expected="PASS", timeout=30)
- results.get_ping_status(vm_1, vm_5, expected="PASS", timeout=30)
+ # TODO: uncomment the following once ODL netvirt fixes the following
+ # bug: https://jira.opendaylight.org/browse/NETVIRT-932
+ # results.get_ping_status(vm_1, vm_4, expected="PASS", timeout=30)
+ # results.get_ping_status(vm_1, vm_5, expected="PASS", timeout=30)
results.add_to_summary(0, "=")
logger.info("\n%s" % results.summary)
@@ -229,5 +268,4 @@ def main():
if __name__ == '__main__':
- logging.basicConfig(level=logging.INFO)
sys.exit(main())