Builder job for deploying Openstack for testing
[releng/builder.git] / jjb / integration / include-raw-integration-start-cluster-run-test.sh
index d6d1bfb04ca03024bb3248d558381f896441a8c6..4bc956436ad5a7e2efd0ccb2377039901f989366 100644 (file)
@@ -67,14 +67,18 @@ do
     ssh ${!CONTROLLERIP} "bash /tmp/verify-cluster-is-up.sh ${i} ${!CONTROLLERIP}"
 done
 
-echo "Cool down for 1 min :)..."
-sleep 60
-
-echo "Changing the testplan path..."
-cat ${WORKSPACE}/test/csit/testplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > testplan.txt
-cat testplan.txt
-
-SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
+if [ ${NUM_OPENSTACK_SYSTEM} -gt 0 ]; then
+   echo "Exiting without running tests to deploy openstack for testing"
+   exit
+fi
+
+if [ ${CONTROLLERSCOPE} == 'all' ]; then
+    COOLDOWN_PERIOD="180"
+else
+    COOLDOWN_PERIOD="60"
+fi
+echo "Cool down for ${COOLDOWN_PERIOD} seconds :)..."
+sleep ${COOLDOWN_PERIOD}
 
 echo "Generating controller variables..."
 for i in `seq 1 ${NUM_ODL_SYSTEM}`
@@ -90,13 +94,28 @@ 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
+
+SUITES=`egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' testplan.txt | tr '\012' ' '`
+
 echo "Starting Robot test suites ${SUITES} ..."
-pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} \
+pybot -N ${TESTPLAN} -c critical -e exclude -v BUNDLEFOLDER:${BUNDLEFOLDER} \
+-v WORKSPACE:/tmp -v BUNDLE_URL:${ACTUALBUNDLEURL} -v JAVA_HOME:${JAVA_HOME} \
+-v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} -v JDKVERSION:${JDKVERSION} -v ODL_STREAM:${DISTROSTREAM} \
 -v CONTROLLER:${ODL_SYSTEM_IP} -v CONTROLLER1:${ODL_SYSTEM_2_IP} -v CONTROLLER2:${ODL_SYSTEM_3_IP} -v ODL_SYSTEM_IP:${ODL_SYSTEM_IP} \
 ${odl_variables} -v NUM_ODL_SYSTEM:${NUM_ODL_SYSTEM} -v CONTROLLER_USER:${USER} -v ODL_SYSTEM_USER:${USER} -v \
 TOOLS_SYSTEM_IP:${TOOLS_SYSTEM_IP} ${tools_variables} -v NUM_TOOLS_SYSTEM:${NUM_TOOLS_SYSTEM} -v TOOLS_SYSTEM_USER:${USER} \
 -v MININET:${TOOLS_SYSTEM_IP} -v MININET1:${TOOLS_SYSTEM_2_IP} -v MININET2:${TOOLS_SYSTEM_3_IP} -v MININET_USER:${USER} \
 -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES} || true
+# FIXME: Sort (at least -v) options alphabetically.
 
 set +e  # We do not want to create red dot just because something went wrong while fetching logs.
 for i in `seq 1 ${NUM_ODL_SYSTEM}`