Merge "Get test suites from common-functions"
authorSam Hague <shague@redhat.com>
Wed, 28 Nov 2018 00:12:30 +0000 (00:12 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 28 Nov 2018 00:12:30 +0000 (00:12 +0000)
jjb/integration/common-functions.sh
jjb/integration/integration-apex-run-tests.sh
jjb/integration/integration-deploy-controller-run-test.sh
jjb/integration/integration-deploy-openstack-run-test.sh
jjb/integration/integration-start-cluster-run-test.sh

index 53ed46ada9c6fa5a09ffda094bfca2c8095fa7a3..bae69e425b164cce3fdd82ebf1cfd1403302c927 100644 (file)
@@ -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
 
index e7875281b03c5ada6f8c7a9b871f287b50643888..a34dbe92ea76d1d0a3ea9fbbc56f22f0f96c0438 100644 (file)
@@ -8,6 +8,8 @@ source /tmp/common-functions.sh ${BUNDLEFOLDER}
 # Ensure we fail the job if any steps fail.
 set -ex -o pipefail
 
+print_job_parameters
+
 get_os_deploy
 
 # Swap out the ODL distribution
@@ -98,22 +100,7 @@ ssh ${OPENSTACK_CONTROL_NODE_1_IP} "sudo ovs-vsctl show"
 ssh ${OPENSTACK_COMPUTE_NODE_1_IP} "sudo ovs-vsctl show"
 ssh ${OPENSTACK_COMPUTE_NODE_2_IP} "sudo ovs-vsctl show"
 
-# Use the testplan if specific SUITES are not defined.
-if [ -z "${SUITES}" ]; then
-    SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
-else
-    newsuites=""
-    workpath="${WORKSPACE}/test/csit/suites"
-    for suite in ${SUITES}; do
-        fullsuite="${workpath}/${suite}"
-        if [ -z "${newsuites}" ]; then
-            newsuites+=${fullsuite}
-        else
-            newsuites+=" "${fullsuite}
-        fi
-    done
-    SUITES=${newsuites}
-fi
+get_test_suites SUITES
 
 echo "Starting Robot test suites ${SUITES} ..."
 # please add pybot -v arguments on a single line and alphabetized
index 20a536a4553ec25d2813478b3963123fe5e31bf6..c2d94f7246212005db405a3d5f81de02c57e98dc 100755 (executable)
@@ -45,32 +45,7 @@ do
     tools_variables=${tools_variables}" -v ${MININETIP}:${!MININETIP}"
 done
 
-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
-    SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
-else
-    newsuites=""
-    workpath="${WORKSPACE}/test/csit/suites"
-    for suite in ${SUITES}; do
-        fullsuite="${workpath}/${suite}"
-        if [ -z "${newsuites}" ]; then
-            newsuites+=${fullsuite}
-        else
-            newsuites+=" "${fullsuite}
-        fi
-    done
-    SUITES=${newsuites}
-fi
+get_test_suites SUITES
 
 echo "Starting Robot test suites ${SUITES} ..."
 pybot -N ${TESTPLAN} \
index 95c26c47c9100be49ed0805999d9afe5b469654c..daaba59ebc571862216704e1d20e5115ebc45d54 100644 (file)
@@ -1075,32 +1075,7 @@ else
     HA_PROXY_3_IP=${ODL_SYSTEM_3_IP}
 fi
 
-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
-    SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
-else
-    newsuites=""
-    workpath="${WORKSPACE}/test/csit/suites"
-    for suite in ${SUITES}; do
-        fullsuite="${workpath}/${suite}"
-        if [ -z "${newsuites}" ]; then
-            newsuites+=${fullsuite}
-        else
-            newsuites+=" "${fullsuite}
-        fi
-    done
-    SUITES=${newsuites}
-fi
+get_test_suites SUITES
 
 #install all client versions required for this job testing
 install_openstack_clients_in_robot_vm
index e11908bb618150350189b2a421b7f7f4c1f229d5..49a036a4000cda1c2e005f564daabb45ac8312c7 100644 (file)
@@ -102,32 +102,7 @@ do
     tools_variables=${tools_variables}" -v ${MININETIP}:${!MININETIP}"
 done
 
-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
-    SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
-else
-    newsuites=""
-    workpath="${WORKSPACE}/test/csit/suites"
-    for suite in ${SUITES}; do
-        fullsuite="${workpath}/${suite}"
-        if [ -z "${newsuites}" ]; then
-            newsuites+=${fullsuite}
-        else
-            newsuites+=" "${fullsuite}
-        fi
-    done
-    SUITES=${newsuites}
-fi
+get_test_suites SUITES
 
 echo "Starting Robot test suites ${SUITES} ..."
 pybot -N ${TESTPLAN} \