Fix testcase_3 27/63127/4
authordimitris.tsiolakis <dmts@intracom-telecom.com>
Wed, 3 Oct 2018 14:12:47 +0000 (17:12 +0300)
committerDimitris Tsiolakis <dmts@intracom-telecom.com>
Fri, 5 Oct 2018 09:17:14 +0000 (09:17 +0000)
After new Apex release Opendaylight run in container.
This enhancement identifies the controllers where the
Opendaylight runs, for both containerized and none
containerized installations.

Change-Id: I336176a9a74486a3f91a36508bb848a90bc6bda2
Signed-off-by: dimitris.tsiolakis <dmts@intracom-telecom.com>
sdnvpn/test/functest/testcase_3.py

index b06915a..258652f 100644 (file)
@@ -40,12 +40,23 @@ def main():
     results.add_to_summary(0, "=")
 
     openstack_nodes = test_utils.get_nodes()
+    installer_type = str(os.environ['INSTALLER_TYPE'].lower())
 
     # node.is_odl() doesn't work in Apex
     # https://jira.opnfv.org/browse/RELENG-192
-    controllers = [node for node in openstack_nodes
-                   if "running" in
-                   node.run_cmd("sudo systemctl status opendaylight")]
+    fuel_cmd = "sudo systemctl status opendaylight"
+    apex_cmd = "sudo docker exec opendaylight_api " \
+               "/opt/opendaylight/bin/status"
+    health_cmd = "sudo docker ps -f name=opendaylight_api -f " \
+                 "health=healthy -q"
+    if installer_type in ["fuel"]:
+        controllers = [node for node in openstack_nodes
+                       if "running" in node.run_cmd(fuel_cmd)]
+    elif installer_type in ["apex"]:
+        controllers = [node for node in openstack_nodes
+                       if node.run_cmd(health_cmd)
+                       if "Running" in node.run_cmd(apex_cmd)]
+
     computes = [node for node in openstack_nodes if node.is_compute()]
 
     msg = ("Verify that OpenDaylight can start/communicate with zrpcd/Quagga")