X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Ffunctest%2Ffunctest-suite.sh;h=9b7f1356c1756b339898cea337ecb55cb2a1ba79;hb=af0996b10798f9b648c098d3afc5c3d999b7e235;hp=df286569faf951b8ab5fca07c91a77fba3535f1e;hpb=372752d715c22885648fd2138a73f6717fe6a587;p=releng.git diff --git a/jjb/functest/functest-suite.sh b/jjb/functest/functest-suite.sh index df286569f..9b7f1356c 100755 --- a/jjb/functest/functest-suite.sh +++ b/jjb/functest/functest-suite.sh @@ -1,14 +1,25 @@ #!/bin/bash -set -e - -branch=${GIT_BRANCH##*/} -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="python ${FUNCTEST_REPO_DIR}/functest/ci/run_tests.py -t $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 + +tests=($(echo $FUNCTEST_SUITE_NAME | tr "," "\n")) +for test in ${tests[@]}; do + if [ "$BRANCH" == 'master' ]; then + cmd="run_tests -t $test" + else + cmd="python /home/opnfv/repos/functest/functest/ci/run_tests.py -t $test" + fi + docker exec $container_id $cmd + let global_ret_val+=$? +done + +ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" +echo ${global_ret_val}>${ret_val_file} + +exit 0