summaryrefslogtreecommitdiffstats
path: root/sdnvpn/test/functest
diff options
context:
space:
mode:
authorDimitrios Markou <mardim@intracom-telecom.com>2018-06-06 14:14:15 +0300
committerDimitrios Markou <mardim@intracom-telecom.com>2018-06-14 12:41:12 +0300
commit84a643211a012a965888403d500ee34e14865777 (patch)
tree8cbe16858c418c619d38ebce9107656fd1bde335 /sdnvpn/test/functest
parent96d17e018f0b4b4547689a31fb0e4f4af1d65a07 (diff)
[Bug Fix] Determine the BGP entity owner in ODL Cluster
In HA deployments is essential to determine which is the ODL BGP entity owner and transform that ODL to BGP speaker. This is necessary because of this bug [0] in netvirt. So we can consider this as a workaround for the testcase_3. Note: This patch is dependent on this task resolution [1] for master branch. Note: This patch works fine in stable/fraser branch. [0] https://jira.opendaylight.org/browse/NETVIRT-1308 [1] https://jira.opnfv.org/browse/SDNVPN-217 Jira: SDNVPN-214 Change-Id: I383987e650da45400a3a6437dbdaaea904db9265 Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com>
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")