X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fcommon-functions.sh;h=2c466d220a3f8c8052102af87620be5fc1e0396d;hb=3f74d54d316d9ee1648aa645be5dc71fe5b6cfa3;hp=ced2cc36e17028ad4be5186eeb9994d517c8c6c8;hpb=45589cf60e5c450945cbb3f5bf8426b13b9b2a28;p=releng%2Fbuilder.git diff --git a/jjb/integration/common-functions.sh b/jjb/integration/common-functions.sh index ced2cc36e..2c466d220 100644 --- a/jjb/integration/common-functions.sh +++ b/jjb/integration/common-functions.sh @@ -133,6 +133,40 @@ function get_os_deploy() { export OPENSTACK_TOPO } +function get_test_suites() { + + #let the caller pick the name of the variable we will assign the suites to + local __suite_list=$1 + + echo "Locating test plan to use..." + testplan_filepath="${WORKSPACE}/test/csit/testplans/${STREAMTESTPLAN}" + if [ ! -f "${testplan_filepath}" ]; then + testplan_filepath="${WORKSPACE}/test/csit/testplans/${TESTPLAN}" + fi + + echo "Changing the testplan path..." + cat "${testplan_filepath}" | sed "s:integration:${WORKSPACE}:" > testplan.txt + cat testplan.txt + + # Use the testplan if specific SUITES are not defined. + if [ -z "${SUITES}" ]; then + suite_list=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '` + else + suite_list="" + workpath="${WORKSPACE}/test/csit/suites" + for suite in ${SUITES}; do + fullsuite="${workpath}/${suite}" + if [ -z "${suite_list}" ]; then + suite_list+=${fullsuite} + else + suite_list+=" "${fullsuite} + fi + done + fi + + eval $__suite_list="'$suite_list'" +} + function run_plan() { local -r type=$1