Merge "Push FAIL to DB for onos-sfc"
[functest.git] / ci / exec_test.sh
index 03eb2c8..e402e0c 100755 (executable)
@@ -39,25 +39,24 @@ fi
 FUNCTEST_REPO_DIR=${repos_dir}/functest
 FUNCTEST_CONF_DIR=/home/opnfv/functest/conf
 
+export PYTHONUNBUFFERED=1
 
 function odl_tests(){
     keystone_ip=$(openstack catalog show identity |grep publicURL| cut -f3 -d"/" | cut -f1 -d":")
     neutron_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":")
     odl_ip=${neutron_ip}
-    odl_port=8181
+    odl_port=8080
     if [ "$INSTALLER_TYPE" == "fuel" ]; then
         odl_port=8282
     elif [ "$INSTALLER_TYPE" == "apex" ]; then
         odl_ip=$SDN_CONTROLLER_IP
+        odl_port=8181
     elif [ "$INSTALLER_TYPE" == "joid" ]; then
         odl_ip=$SDN_CONTROLLER
-        odl_port=8080
-        :
     elif [ "$INSTALLER_TYPE" == "compass" ]; then
-        :
+        odl_port=8181
     else
         odl_ip=$SDN_CONTROLLER_IP
-        odl_port=8080
     fi
 }
 
@@ -80,12 +79,7 @@ function run_test(){
         ;;
         "odl")
             odl_tests
-            if [[ "$report" == "-r" &&
-                  -n "$DEPLOY_SCENARIO" && "$DEPLOY_SCENARIO" != "none" &&
-                  -n "$INSTALLER_TYPE" && "$INSTALLER_TYPE" != "none" ]] &&
-               env | grep NODE_NAME > /dev/null; then
-                args=-p
-            fi
+            [[ "$report" == "-r" ]] && args=-p
             ${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/OpenDaylightTesting.py \
                 --keystoneip $keystone_ip --neutronip $neutron_ip \
                 --osusername ${OS_USERNAME} --ostenantname ${OS_TENANT_NAME} \
@@ -153,18 +147,11 @@ function run_test(){
             python ${FUNCTEST_REPO_DIR}/testcases/features/domino.py $report
         ;;
         "odl-sfc")
-            bash ${FUNCTEST_REPO_DIR}/testcases/features/sfc/server_presetup_CI.bash
-            ret_val=$?
-            if [ $ret_val != 0 ]; then
-                exit $ret_val
-            fi
-            bash ${FUNCTEST_REPO_DIR}/testcases/features/sfc/compute_presetup_CI.bash
-            ret_val=$?
-            if [ $ret_val != 0 ]; then
-                exit $ret_val
-            fi
-            source ${FUNCTEST_REPO_DIR}/testcases/features/sfc/tackerc
-            python ${FUNCTEST_REPO_DIR}/testcases/features/sfc/sfc.py $report
+            ODL_SFC_DIR=${FUNCTEST_REPO_DIR}/testcases/features/sfc
+            # pass FUNCTEST_REPO_DIR inside prepare_odl_sfc.bash
+            FUNCTEST_REPO_DIR=${FUNCTEST_REPO_DIR} bash ${ODL_SFC_DIR}/prepare_odl_sfc.bash || exit $?
+            source ${ODL_SFC_DIR}/tackerc
+            python ${ODL_SFC_DIR}/sfc.py $report
         ;;
         "parser")
             python ${FUNCTEST_REPO_DIR}/testcases/vnf/vRNC/parser.py $report