Restoring bin/client in the scripts
[releng/builder.git] / jjb / integration / include-raw-integration-deploy-controller-run-test.sh
index 8611e1ab1f64210eaae6bf30dffc2eca4a40a701..73d8233d764c61cee38e5b1606fb33d3baba1bc1 100644 (file)
@@ -7,8 +7,10 @@ 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}"
@@ -20,11 +22,9 @@ if [ ${BUNDLEURL} == 'last' ]; then
     BUNDLE="distribution-${DISTRIBUTION}-${TIMESTAMP}.zip"
     BUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
 else
-    BUNDLE="$(echo ${BUNDLEURL} | awk -F '/' '{ print $(NF) }')"
-    echo "Finding out Bundle folder..."
-    wget --no-verbose  ${BUNDLEURL}
-    BUNDLEFOLDER="$(unzip -qql ${BUNDLE} | head -n1 | tr -s ' ' | cut -d' ' -f5- | rev | cut -c 2- | rev)"
-    rm ${BUNDLE}
+    BUNDLE="${BUNDLEURL##*/}"
+    BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
+    BUNDLEFOLDER="distribution-${DISTRIBUTION}-${BUNDLEVERSION}"
 fi
 
 echo "Distribution bundle URL is ${BUNDLEURL}"
@@ -32,9 +32,9 @@ 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}
@@ -88,7 +88,7 @@ echo "Cool down for 1 min :)..."
 sleep 60
 
 echo "Checking OSGi bundles..."
-./client 'bundle:list'
+sshpass -p karaf ./client -u karaf 'bundle:list'
 
 EOF
 
@@ -102,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 .