--- /dev/null
+# Create a script to run controller inside a dynamic jenkins slave
+cat > ${WORKSPACE}/controller-script.sh <<EOF
+# redefine our TMP space
+export TMP=/tmp/jenkins-integration-controller
+pidfile="\${TMP}/opendaylight.PID"
+
+# create our new tmp space (we do it here in case we recently just finished cleaning)
+mkdir -p \${TMP}
+
+# download the artifact
+cd /tmp
+wget --no-verbose ${BUNDLEURL}
+
+# extract the new controller
+cd \${TMP}
+BUNDLE="$(echo "$BUNDLEURL" | awk -F '/' '{ print $(NF) }')"
+BUNDLEFOLDER="\${BUNDLE//.zip}"
+unzip -q /tmp/\${BUNDLE}
+
+# Configure the controller
+cd \${BUNDLEFOLDER}/etc
+# Configure the startup features
+export CFG=org.apache.karaf.features.cfg
+cp \${CFG} \${CFG}.bak
+cat \${CFG}.bak | sed 's/^featuresBoot=.*/featuresBoot=${CONTROLLER_FEATURES}/' > \${CFG}
+# Configure the log
+export LOG=org.ops4j.pax.logging.cfg
+cp \${LOG} \${LOG}.bak
+cat \${LOG}.bak | sed 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=20MB/' > \${LOG}
+
+# run the controller but trick jenkins into not killing it
+cd ../bin
+BUILD_ID=dontKillMe ./start
+
+# sleep for 300 seconds may need to be longer
+sleep 150
+
+# Check OSGi bundles
+./client 'bundle:list'
+
+# Getting ODL PID to store in common file
+cd ../instances
+ODLPID=\`grep pid instance.properties | awk -F ' ' '{print \$3}'\`
+echo \${ODLPID}
+ps -p \${ODLPID}
+echo \${ODLPID} > \${pidfile}
+
+ls \${TMP}
+EOF
+
+scp ${WORKSPACE}/controller-script.sh $CONTROLLER0:/tmp
+ssh $CONTROLLER0 'bash /tmp/controller-script.sh'
+
+# vim: ts=4 sw=4 sts=4 et ft=sh :
--- /dev/null
+# Get the Controller and Mininet slave addresses
+
+CONTROLLER=()
+MININET=()
+
+IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}"
+
+for i in "${ADDR[@]}"
+do
+ REMHOST=`ssh ${i} hostname`
+ if [ `echo ${REMHOST} | grep java` ]; then
+ CONTROLLER=( "${CONTROLLER[@]}" "${i}" )
+ else
+ MININET=( "${MININET[@]}" "${i}" )
+ fi
+done
+
+for i in `seq 0 $(( ${#CONTROLLER[@]} - 1 ))`
+do
+ echo "CONTROLLER${i}=${CONTROLLER[${i}]}" >> slave_addresses.txt
+done
+
+for i in `seq 0 $(( ${#MININET[@]} - 1 ))`
+do
+ echo "MININET${i}=${MININET[${i}]}" >> slave_addresses.txt
+done
+
+# vim: sw=4 ts=4 sts=4 et ft=sh :
--- /dev/null
+# start Robot tests
+pybot -c critical -e netconf -e pingall -e ovsdb -e apps -v TOPO_TREE_DEPTH:5 -v CONTROLLER:${CONTROLLER0} -v MININET:${MININET0} -v MININET_USER:${USER} -v USER_HOME:${HOME} -v RESTCONFPORT:8181 ${WORKSPACE}/test/csit/suites/karaf-compatible
+
+# fetch controller log
+BUNDLE="$(echo "$BUNDLEURL" | awk -F '/' '{ print $(NF) }')"
+BUNDLEFOLDER="${BUNDLE//.zip}"
+scp $CONTROLLER0:/tmp/jenkins-integration-controller/$BUNDLEFOLDER/data/log/karaf.log .
+
+# vim: ts=4 sw=4 sts=4 et ft=sh :
--- /dev/null
+- project:
+ name: integration-csit-tests
+ jobs:
+ - 'integration-{stream}-csit-compatible-min'
+
+ # stream: branch with - in place of / (eg. stable-helium)
+ # branch: branch (eg. stable/helium)
+ stream:
+ - master:
+ branch: 'master'
+ - stable-helium:
+ branch: 'stable/helium'
+
+
+- job-template:
+ name: 'integration-{stream}-csit-compatible-min'
+
+ project-type: freestyle
+ node: dynamic_robot
+
+ logrotate:
+ daysToKeep: '{build-days-to-keep}'
+ numToKeep: '{build-num-to-keep}'
+ artifactDaysToKeep: '{build-artifact-days-to-keep}'
+ artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+ scm:
+ - git-scm:
+ credentials-id: '{ssh-credentials}'
+ scm-url: 'ssh://jenkins-releng@git.opendaylight.org:29418/integration.git'
+ refspec: ''
+ branch: '{branch}'
+
+ parameters:
+ - integration-bundleurl
+ - integration-controller-features:
+ controller-features: 'config,standard,region,package,kar,ssh,management,odl-openflowplugin-flow-services-ui,odl-nsf-all,odl-adsal-compatibility,odl-netconf-connector-ssh'
+
+ wrappers:
+ - integration-jclouds-controller-mininet
+ - ssh-agent-credentials:
+ user: '{ssh-credentials}'
+
+ builders:
+ - integration-get-slave-addresses
+ - inject:
+ properties-file: 'slave_addresses.txt'
+ - intergration-deploy-controller-compatible-min
+ - integration-helium-csit-compatible-min
+
+ publishers:
+ - integration-robot
+ - archive:
+ artifacts: 'karaf.log'
+ - email-notification:
+ email-prefix: '[integration]'
--- /dev/null
+- parameter:
+ name: integration-bundleurl
+ parameters:
+ - string:
+ name: BUNDLEURL
+ default: 'http://nexus.opendaylight.org/content/repositories/opendaylight.release/org/op
+endaylight/integration/distribution-karaf/0.2.0-Helium/distribution-karaf-0.2.0-Helium.zip'
+ description: 'URL to karaf-distribution zip'
+
+- parameter:
+ name: integration-controller-features
+ parameters:
+ - string:
+ name: CONTROLLER_FEATURES
+ default: '{controller-features}'
+ description: |
+ Features to install in the controller
+
+ This is a comma seperated list of karaf features that
+ should be installed. This list will be passed to the
+ "featuresBoot=" parameter in the config file.
+
+- wrapper:
+ name: integration-jclouds-controller-mininet
+ wrappers:
+ - jclouds:
+ instances:
+ - rk-c-el6-java:
+ cloud-name: 'Rackspace DFW - Integration'
+ count: 1
+ stop-on-terminate: False
+ - rk-c-el6-mininet:
+ cloud-name: 'Rackspace DFW - Integration'
+ count: 1
+ stop-on-terminate: False
+
+#################
+# Shell Scripts #
+#################
+
+- builder:
+ name: integration-get-slave-addresses
+ builders:
+ - shell:
+ !include-raw include-raw-integration-get-slave-addresses.sh
+
+- builder:
+ name: intergration-deploy-controller-compatible-min
+ builders:
+ - shell:
+ !include-raw include-raw-integration-deploy-controller-min.sh
+
+- builder:
+ name: integration-helium-csit-compatible-min
+ builders:
+ - shell:
+ !include-raw include-raw-integration-helium-csit-compatible-min.sh
+
+##############
+# Publishers #
+##############
+
+- publisher:
+ name: integration-robot
+ publishers:
+ - robot:
+ output-path: ''
+ other-files: ''
+ unstable-threshold: 97.0
+ pass-threshold: 100.0
+ only-critical: false