Add JJB CSIT compatible min job 35/12835/6
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 14 Nov 2014 05:12:29 +0000 (00:12 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 20 Nov 2014 03:28:10 +0000 (22:28 -0500)
Change-Id: Idf4063e490fb4db3de6765563e4d670ebff4fdd7
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/integration/include-raw-integration-deploy-controller-min.sh [new file with mode: 0644]
jjb/integration/include-raw-integration-get-slave-addresses.sh [new file with mode: 0644]
jjb/integration/include-raw-integration-helium-csit-compatible-min.sh [new file with mode: 0644]
jjb/integration/integration-csit.yaml [new file with mode: 0644]
jjb/integration/integration-macros.yaml [new file with mode: 0644]

diff --git a/jjb/integration/include-raw-integration-deploy-controller-min.sh b/jjb/integration/include-raw-integration-deploy-controller-min.sh
new file mode 100644 (file)
index 0000000..e6c649c
--- /dev/null
@@ -0,0 +1,54 @@
+# 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 :
diff --git a/jjb/integration/include-raw-integration-get-slave-addresses.sh b/jjb/integration/include-raw-integration-get-slave-addresses.sh
new file mode 100644 (file)
index 0000000..bef59ca
--- /dev/null
@@ -0,0 +1,28 @@
+# 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 :
diff --git a/jjb/integration/include-raw-integration-helium-csit-compatible-min.sh b/jjb/integration/include-raw-integration-helium-csit-compatible-min.sh
new file mode 100644 (file)
index 0000000..f124bec
--- /dev/null
@@ -0,0 +1,9 @@
+# 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 :
diff --git a/jjb/integration/integration-csit.yaml b/jjb/integration/integration-csit.yaml
new file mode 100644 (file)
index 0000000..90b8632
--- /dev/null
@@ -0,0 +1,56 @@
+- 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]'
diff --git a/jjb/integration/integration-macros.yaml b/jjb/integration/integration-macros.yaml
new file mode 100644 (file)
index 0000000..3c106a5
--- /dev/null
@@ -0,0 +1,71 @@
+- 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