Merge "Simple change to run a script stored in integration before controller starts"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Thu, 28 May 2015 12:48:29 +0000 (12:48 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 28 May 2015 12:48:29 +0000 (12:48 +0000)
jjb/integration/include-raw-integration-deploy-controller-run-test.sh

index 23eab114eb1e0ae6d23d3c0e20d24bd38eea7b6e..eb62b19583b6ae3d9674fcbbd46e87cad543ddce 100644 (file)
@@ -1,4 +1,4 @@
-NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
+export NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
 CONTROLLERMEM="2048m"
 
 if [ ${CONTROLLERSCOPE} == 'all' ]; then
@@ -11,20 +11,20 @@ fi
 if [ ${BUNDLEURL} == 'last' ]; then
     NEXUSPATH="${NEXUSURL_PREFIX}/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf"
     # Extract the BUNDLEVERSION from the pom.xml
-    BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
+    export BUNDLEVERSION=`xpath pom.xml '/project/version/text()' 2> /dev/null`
     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}"
-    BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
-    BUNDLE="distribution-karaf-${TIMESTAMP}.zip"
-    ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
+    export BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
+    export BUNDLE="distribution-karaf-${TIMESTAMP}.zip"
+    export ACTUALBUNDLEURL="${NEXUSPATH}/${BUNDLEVERSION}/${BUNDLE}"
 else
-    ACTUALBUNDLEURL="${BUNDLEURL}"
-    BUNDLE="${BUNDLEURL##*/}"
-    BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
-    BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
+    export ACTUALBUNDLEURL="${BUNDLEURL}"
+    export BUNDLE="${BUNDLEURL##*/}"
+    export BUNDLEVERSION="$(basename $(dirname $BUNDLEURL))"
+    export BUNDLEFOLDER="distribution-karaf-${BUNDLEVERSION}"
 fi
 
 echo "Distribution bundle URL is ${ACTUALBUNDLEURL}"
@@ -33,6 +33,17 @@ echo "Distribution bundle version is ${BUNDLEVERSION}"
 echo "Distribution folder is ${BUNDLEFOLDER}"
 echo "Nexus prefix is ${NEXUSURL_PREFIX}"
 
+if [ -f ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} ]; then
+    echo "scriptplan exists!!!"
+    echo "Changing the scriptplan path..."
+    cat ${WORKSPACE}/test/csit/scriptplans/${TESTPLAN} | sed "s:integration:${WORKSPACE}:" > scriptplan.txt
+    cat scriptplan.txt
+    for line in $( egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' scriptplan.txt ); do
+        echo "Executing ${line}..."
+        source ${line}
+    done
+fi
+
 cat > ${WORKSPACE}/controller-script.sh <<EOF
 
 echo "Changing to /tmp"