-cat > ${WORKSPACE}/deploy-sanitytest-controller-script.sh <<EOF
-set -x
-
-echo "Waiting for controller to come up..."
-cd /tmp
-cd ${BUNDLEFOLDER}/bin
-
-COUNT="0"
-
-
-while true; do
- RESP="\$( curl --user admin:admin -sL -w "%{http_code} %{url_effective}\\n" http://localhost:8181/restconf/modules -o /dev/null )"
- echo \$RESP
- if [[ \$RESP == *"200"* ]]; then
- echo Controller is UP
- break
- elif (( "\$COUNT" > "600" )); then
- echo Timeout Controller DOWN
-
- cd /tmp/${BUNDLEFOLDER}/data/
- cat karaf.log
- exit 1
- else
- COUNT=\$(( \${COUNT} + 5 ))
- sleep 5
- echo waiting \$COUNT secs...
- fi
-done
-
-
-cd /tmp/${BUNDLEFOLDER}/bin/
-
-echo "Checking OSGi bundles..."
-sshpass -p karaf ./client -u karaf 'bundle:list'
-
-pkill java
-
-set +x
-
-EOF
-
-
-set +x
-
-
-
-
-###############################################################
-## Define a function to run controller-script on controller #
-###############################################################
-
-function runcontrollerscript
-{
- local CONTROLLERIP=$1
- echo "running controller $CONTROLLERIP"
- scp ${WORKSPACE}/deploy-controller-script.sh $CONTROLLERIP:/tmp
- ssh $CONTROLLERIP 'bash /tmp/deploy-controller-script.sh'
-}
-
-function sanitytestcontroller
-{
- local CONTROLLERIP=$1
- echo "sanity testing controller $CONTROLLERIP"
- scp ${WORKSPACE}/deploy-sanitytest-controller-script.sh $CONTROLLERIP:/tmp
- ssh $CONTROLLERIP 'bash /tmp/deploy-sanitytest-controller-script.sh'
-}
-
-echo "##################################"
-echo "## Loop through controller IPs #"
-echo "##################################"
-
-declare CONTROLLERIPS=($(cat slave_addresses.txt | grep CONTROLLER | awk -F = '{print $2}'))
-
-for i in "${CONTROLLERIPS[@]}"