[Functest] Refactor Functest-suite job 75/29175/4
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 21 Feb 2017 20:48:52 +0000 (21:48 +0100)
committerjose.lausuch <jose.lausuch@ericsson.com>
Tue, 21 Feb 2017 21:15:52 +0000 (22:15 +0100)
- Remove if clauses for old releases (not used any more)
- Use python call to run_tests.py instead of CLI
   This will allow us to return the proper value to
   the job. The CLI command returns always 0.
- Remove push logs to artifacts
    Functest-suite is not meant for daily CI runs

Change-Id: I34d99cbe5af07a1fcf583a9a0b6ac6ab286c9adc
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
jjb/functest/functest-ci-jobs.yml
jjb/functest/functest-suite.sh

index 49901be..b3348c7 100644 (file)
         - 'functest-cleanup'
         - 'set-functest-env'
         - 'functest-suite'
-        - 'functest-store-results'
-        - 'functest-exit'
 
 - builder:
     name: functest-daily
index f28d3d0..228cc3d 100755 (executable)
@@ -1,19 +1,18 @@
 #!/bin/bash
-set -e
 
-echo "Functest: run $FUNCTEST_SUITE_NAME on branch $BRANCH"
-if [[ "$BRANCH" =~ 'brahmaputra' ]]; then
-    cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test $FUNCTEST_SUITE_NAME"
-elif [[ "$BRANCH" =~ 'colorado' ]]; then
-    cmd="python ${FUNCTEST_REPO_DIR}/ci/run_tests.py -t $FUNCTEST_SUITE_NAME"
-else
-    cmd="functest testcase run $FUNCTEST_SUITE_NAME"
-fi
 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
-docker exec $container_id $cmd
+if [ -z $container_id ]; then
+    echo "Functest container not found"
+    exit 1
+fi
+
+global_ret_val=0
 
-ret_value=$?
-ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value"
-echo ${ret_value}>${ret_val_file}
+tests=($(echo $FUNCTEST_SUITE_NAME | tr "," "\n"))
+for test in ${tests[@]}; do
+    cmd="python /home/opnfv/repos/functest/functest/ci/run_tests.py -t $test"
+    docker exec $container_id $cmd
+    let global_ret_val+=$?
+done
 
-exit 0
+exit $global_ret_val