Restoring bin/client in the scripts
[releng/builder.git] / jjb / integration / include-raw-integration-deploy-controller-run-test.sh
index fc5f6d7c7223f8c47f78ab0dc838cf6ca016a74a..73d8233d764c61cee38e5b1606fb33d3baba1bc1 100644 (file)
@@ -7,28 +7,34 @@ if [ ${CONTROLLERSCOPE} == 'all' ]; then
     CONTROLLERMEM="3072m"
 fi
 
+NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
+
 if [ ${BUNDLEURL} == 'last' ]; then
-    NEXUSPATH="https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}"
+    NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-${DISTRIBUTION}"
     # Extract the BUNDLEVERSION from the pom.xml
     BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
-    echo "Bundle version is $BUNDLEVERSION"
+    echo "Bundle version is ${BUNDLEVERSION}"
     # Acquire the timestamp information from maven-metadata.xml
     wget ${NEXUSPATH}/${BUNDLEVERSION}/maven-metadata.xml
     TIMESTAMP=`xpath maven-metadata.xml "//snapshotVersion[extension='zip'][1]/value/text()" 2>/dev/null`
-    echo "Nexus timestamp is $TIMESTAMP"
+    echo "Nexus timestamp is ${TIMESTAMP}"
     BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
     BUNDLE="distribution-${DISTRIBUTION}-${TIMESTAMP}.zip"
     BUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
-    echo "Distribution bundle URL is ${BUNDLEURL}"
 else
-    BUNDLE="$(echo "$BUNDLEURL" | awk -F '/' '{ print $(NF) }')"
-    BUNDLEFOLDER="${BUNDLE//.zip}"
+    BUNDLE="${BUNDLEURL##*/}"
+    BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
+    BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
 fi
 
+echo "Distribution bundle URL is ${BUNDLEURL}"
+echo "Distribution bundle is ${BUNDLE}"
+echo "Distribution folder is ${BUNDLEFOLDER}"
+
 cat > ${WORKSPACE}/controller-script.sh <<EOF
-echo "Downloading the distribution from ${BUNDLEURL}"
+echo "Downloading the distribution..."
 cd /tmp
-wget --no-verbose  ${BUNDLEURL}
+wget --no-verbose '${BUNDLEURL}'
 
 echo "Extracting the new controller..."
 unzip -q ${BUNDLE}
@@ -67,8 +73,9 @@ while true; do
         break
     elif (( "\$COUNT" > "600" )); then
         echo Timeout Controller DOWN
-        echo "Fetching Karaf log"
-        scp ${CONTROLLER0}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log .
+        echo "Dumping Karaf log..."
+        cd ../data/log
+        cat karaf.log
         exit 1
     else
         COUNT=\$(( \${COUNT} + 5 ))
@@ -81,11 +88,11 @@ echo "Cool down for 1 min :)..."
 sleep 60
 
 echo "Checking OSGi bundles..."
-./client 'bundle:list'
+sshpass -p karaf ./client -u karaf 'bundle:list'
 
 EOF
 
-scp ${WORKSPACE}/controller-script.sh $CONTROLLER0:/tmp
+scp ${WORKSPACE}/controller-script.sh ${CONTROLLER0}:/tmp
 ssh ${CONTROLLER0} 'bash /tmp/controller-script.sh'
 
 echo "Changing the testplan path..."
@@ -95,7 +102,7 @@ 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 --loglevel TRACE -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp -v CONTROLLER:${CONTROLLER0} -v MININET:${MININET0} -v MININET_USER:${USER} -v USER_HOME:${HOME} ${TESTOPTIONS} ${SUITES}
+pybot -N ${TESTPLAN} -c critical -e exclude --loglevel TRACE -v BUNDLEFOLDER:${BUNDLEFOLDER} -v WORKSPACE:/tmp -v CONTROLLER:${CONTROLLER0} -v MININET:${MININET0} -v MININET_USER:${USER} -v USER_HOME:${HOME} -v NEXUSURL_PREFIX:${NEXUSURL_PREFIX} ${TESTOPTIONS} ${SUITES}
 
 echo "Fetching Karaf log"
 scp ${CONTROLLER0}:/tmp/${BUNDLEFOLDER}/data/log/karaf.log .