summaryrefslogtreecommitdiffstats
path: root/sdnvpn/test/functest
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-06-15 15:16:10 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-06-15 15:16:10 +0000
commit3355eda6176c0a78b77143c9735c9a5c2a61d525 (patch)
tree4cbe57e220f5fd424424b0eb1d80fd457d1f3b86 /sdnvpn/test/functest
parentc6fbfb9651f5293c544351d3c9c549dfa24fafc6 (diff)
parent84a643211a012a965888403d500ee34e14865777 (diff)
Merge "[Bug Fix] Determine the BGP entity owner in ODL Cluster"
Diffstat (limited to 'sdnvpn/test/functest')
-rw-r--r--sdnvpn/test/functest/testcase_3.py57
1 files changed, 38 insertions, 19 deletions
diff --git a/sdnvpn/test/functest/testcase_3.py b/sdnvpn/test/functest/testcase_3.py
index 95023c6..b7fe642 100644
--- a/sdnvpn/test/functest/testcase_3.py
+++ b/sdnvpn/test/functest/testcase_3.py
@@ -17,6 +17,7 @@
import logging
import os
import sys
+import time
from sdnvpn.lib import quagga
from sdnvpn.lib import openstack_utils as os_utils
@@ -60,33 +61,48 @@ def main():
logger.info(msg)
results.add_success(msg)
- controller = controllers[0] # We don't handle HA well
- get_ext_ip_cmd = "sudo ip a | grep br-ex | grep inet | awk '{print $2}'"
- ext_net_cidr = controller.run_cmd(get_ext_ip_cmd).strip().split('\n')
- ext_net_mask = ext_net_cidr[0].split('/')[1]
- controller_ext_ip = ext_net_cidr[0].split('/')[0]
-
- logger.info("Starting bgp speaker of controller at IP %s "
- % controller_ext_ip)
logger.info("Checking if zrpcd is "
- "running on the controller node")
-
- output_zrpcd = controller.run_cmd("ps --no-headers -C "
- "zrpcd -o state")
- states = output_zrpcd.split()
- running = any([s != 'Z' for s in states])
+ "running on the controller nodes")
+
+ for controller in controllers:
+ output_zrpcd = controller.run_cmd("ps --no-headers -C "
+ "zrpcd -o state")
+ states = output_zrpcd.split()
+ running = any([s != 'Z' for s in states])
+ msg = ("zrpcd is running in {name}".format(name=controller.name))
+
+ if not running:
+ logger.info("zrpcd is not running on the controller node {name}"
+ .format(name=controller.name))
+ results.add_failure(msg)
+ else:
+ logger.info("zrpcd is running on the controller node {name}"
+ .format(name=controller.name))
+ results.add_success(msg)
- msg = ("zrpcd is running")
+ results.add_to_summary(0, "-")
- if not running:
- logger.info("zrpcd is not running on the controller node")
+ # Find the BGP entity owner in ODL because of this bug:
+ # https://jira.opendaylight.org/browse/NETVIRT-1308
+ msg = ("Found BGP entity owner")
+ controller = test_utils.get_odl_bgp_entity_owner(controllers)
+ if controller is None:
+ logger.error("Failed to find the BGP entity owner")
results.add_failure(msg)
else:
- logger.info("zrpcd is running on the controller node")
+ logger.info('BGP entity owner is {name}'
+ .format(name=controller.name))
results.add_success(msg)
-
results.add_to_summary(0, "-")
+ get_ext_ip_cmd = "sudo ip a | grep br-ex | grep inet | awk '{print $2}'"
+ ext_net_cidr = controller.run_cmd(get_ext_ip_cmd).strip().split('\n')
+ ext_net_mask = ext_net_cidr[0].split('/')[1]
+ controller_ext_ip = ext_net_cidr[0].split('/')[0]
+
+ logger.info("Starting bgp speaker of controller at IP %s "
+ % controller_ext_ip)
+
# Ensure that ZRPCD ip & port are well configured within ODL
add_client_conn_to_bgp = "bgp-connect -p 7644 -h 127.0.0.1 add"
test_utils.run_odl_cmd(controller, add_client_conn_to_bgp)
@@ -96,6 +112,9 @@ def main():
"--as-num 100 --router-id {0}".format(controller_ext_ip)
test_utils.run_odl_cmd(controller, start_quagga)
+ # we need to wait a bit until the bgpd is up
+ time.sleep(5)
+
logger.info("Checking if bgpd is running"
" on the controller node")