Adapt bgp daemon to run properly for testcase3 03/48403/1
authortomsou <soth@intracom-telecom.com>
Thu, 9 Nov 2017 14:53:54 +0000 (16:53 +0200)
committerThomas Sounapoglou <soth@intracom-telecom.com>
Tue, 5 Dec 2017 18:55:35 +0000 (18:55 +0000)
Since apex includes a new version of zrpcd compatible with Carbon
and Nitrogen [0], an adaptation is needed for bgp daemon enabling
and running within testcase3

Note that zrpcd run now as a process and not as a service

JIRA: SDNVPN-172

[0] https://jira.opnfv.org/projects/APEX/issues/APEX-508

Change-Id: Ia0ec4ab0f15ecf3d5c76c5fa541fe8338762ecaf
Signed-off-by: tomsou <soth@intracom-telecom.com>
(cherry picked from commit e1372d3c4955a92f36bfb50ae5925dac2fc0b89c)

sdnvpn/test/functest/testcase_3.py

index 7e14505..f9ef865 100644 (file)
@@ -70,11 +70,14 @@ def main():
     logger.info("Checking if zrpcd is "
                 "running on the controller node")
 
-    cmd = "systemctl status zrpcd |grep -i running"
-    output = controller.run_cmd(cmd)
+    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")
 
-    if not output:
+    if not running:
         logger.info("zrpcd is not running on the controller node")
         results.add_failure(msg)
     else:
@@ -83,6 +86,11 @@ def main():
 
     results.add_to_summary(0, "-")
 
+    # 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)
+
+    # Start bgp daemon
     start_quagga = "odl:configure-bgp -op start-bgp-server " \
                    "--as-num 100 --router-id {0}".format(controller_ext_ip)
     test_utils.run_odl_cmd(controller, start_quagga)