- string:
name: BRANCH
default: '{branch}'
- description: 'GIT branch'
+ description: 'Distribution GIT branch'
- parameter:
name: integration-bundleurl
default: '{bundleurl}'
description: 'URL to karaf distribution zip'
+- parameter:
+ name: integration-jdk-version
+ parameters:
+ - string:
+ name: JDKVERSION
+ default: '{jdkversion}'
+ description: 'Parameter to indicate JAVA Version'
+
- parameter:
name: integration-controller-scope
parameters:
default: '{controller-features}'
description: 'Features to install in the controller separated by comma'
+- parameter:
+ name: integration-distribution-stream
+ parameters:
+ - string:
+ name: DISTROSTREAM
+ default: '{stream}'
+ description: 'Distribution stream string, for suites to know which behavior to expect'
+
+- parameter:
+ name: integration-stream-test-plan
+ parameters:
+ - string:
+ name: STREAMTESTPLAN
+ default: '{stream-test-plan}'
+ description: 'Stream-specific test plan we will run'
+
- parameter:
name: integration-test-plan
parameters:
- string:
name: TESTPLAN
default: '{test-plan}'
- description: 'Test plan we will run'
+ description: 'General test plan we will run unless stream-specific one is found'
- parameter:
name: integration-test-options
description: 'Integration Patch Refspec'
# Macro: integration-gerrit-scm
-# Operation: this macro downloads a gerrit from any project and uses the project as basedir
-# Used by: integration-patch-test-{stream} job template
+# Operation: this macro downloads a project gerrit
+# Used by: all csit jobs
- scm:
name: integration-gerrit-scm
scm:
- git:
- credentials-id: '{credentials-id}'
+ credentials-id: 'opendaylight-jenkins-ssh'
url: '$GIT_BASE'
- basedir: '$GERRIT_PROJECT'
- refspec: '$GERRIT_REFSPEC'
+ basedir: '{basedir}'
+ refspec: '{refspec}'
branches:
- 'origin/{branch}'
skip-tag: true
choosing-strategy: 'gerrit'
# Macro: integration-distribution-scm
-# Operation: this macro downloads the integration/distribution repo and uses distribution as basedir
-# Used by: {project}-csit-* and integration-patch-test-{stream} job templates
+# Operation: this macro downloads the integration/distribution repo using distribution as basedir
+# Used by: integration-patch-test-{stream} job template
- scm:
name: integration-distribution-scm
scm:
- git:
- credentials-id: '{credentials-id}'
+ credentials-id: 'opendaylight-jenkins-ssh'
basedir: 'distribution'
url: '$DISTROGITURL'
refspec: ''
- 'origin/{branch}'
skip-tag: true
-# Macro: integration-patch-scm
-# Operation: this macro downloads a test patch that can be used to debug in the sandbox
-# Used by: {project}-csit-* job templates
-
-- scm:
- name: integration-patch-scm
- scm:
- - git:
- credentials-id: '{credentials-id}'
- url: '$GIT_BASE'
- refspec: '$PATCHREFSPEC'
- branches:
- - 'origin/{branch}'
- skip-tag: true
- choosing-strategy: 'gerrit'
-
-# Macro: integration-test-gerrit-trigger-patch-submitted
-# Operation: this macro sets a trigger for patch submit on test/csit/suites/{project}/**
+# Macro: integration-trigger-patch-submitted
+# Operation: this macro sets a trigger for patch submitted on a path pattern
# Used by: {project}-verify-csit-* job templates
- trigger:
- name: integration-test-gerrit-trigger-patch-submitted
+ name: integration-trigger-patch-submitted
triggers:
- gerrit:
server-name: 'OpenDaylight'
comment-contains-value: 'recheck'
- comment-added-contains-event:
comment-contains-value: 'reverify'
+ override-votes: true
+ gerrit-build-unstable-verified-value: +1
+ gerrit-build-unstable-codereview-value: 0
projects:
- project-compare-type: 'ANT'
project-pattern: '{name}'
branch-pattern: '**/{branch}'
file-paths:
- compare-type: 'ANT'
- pattern: 'test/csit/suites/{project}/**'
+ pattern: '{pattern}'
-# Macro: integration-csit-gerrit-trigger-patch-submitted
-# Operation: this macro sets a trigger for patch submit on test/csit/**
-# Used by: integration-verify-csit-1node-{stream} job template
+# Macro: integration-trigger-patch-merged
+# Operation: this macro sets a trigger for patch merged on a path pattern
+# Used by: not used yet
- trigger:
- name: integration-csit-gerrit-trigger-patch-submitted
+ name: integration-trigger-patch-merged
triggers:
- gerrit:
server-name: 'OpenDaylight'
trigger-on:
- - patchset-created-event:
- exclude-drafts: 'true'
- exclude-trivial-rebase: 'false'
- exclude-no-code-change: 'true'
- - draft-published-event
- - comment-added-contains-event:
- comment-contains-value: 'recheck'
+ - change-merged-event
- comment-added-contains-event:
- comment-contains-value: 'reverify'
+ comment-contains-value: 'remerge'
projects:
- project-compare-type: 'ANT'
project-pattern: '{name}'
branch-pattern: '**/{branch}'
file-paths:
- compare-type: 'ANT'
- pattern: 'test/csit/**'
+ pattern: '{pattern}'
-# Macro: integration-csit-gerrit-trigger-patch-merged
-# Operation: this macro sets a trigger for patch merged on test/csit/**
-# Used by: not used yet
+# Macro: integration-csit-only
+# Operation: this macro sets a trigger on reverse job list
+# Used by: csit -only- job templates
- trigger:
- name: integration-csit-gerrit-trigger-patch-merged
+ name: integration-csit-only
triggers:
- - gerrit:
- server-name: 'OpenDaylight'
- trigger-on:
- - change-merged-event
- - comment-added-contains-event:
- comment-contains-value: 'remerge'
- projects:
- - project-compare-type: 'ANT'
- project-pattern: '{name}'
- branches:
- - branch-compare-type: 'ANT'
- branch-pattern: '**/{branch}'
- file-paths:
- - compare-type: 'ANT'
- pattern: 'test/csit/**'
+ - reverse:
+ jobs: '{jobs}'
+ result: 'success'
+
+# Macro: integration-csit-all
+# Operation: this macro sets a periodic trigger
+# Used by: csit -all- job teamplates
+
+- trigger:
+ name: integration-csit-all
+ triggers:
+ - timed: 'H H * * *'
# Macro: integration-jclouds-controller-mininet
# Operation: this macro will spin the controller and mininet vms
wrappers:
- jclouds:
instances:
- - rk-c-el6-java:
- cloud-name: 'Rackspace DFW - Integration Dynamic Lab'
+ - '{controller-image}':
+ cloud-name: 'ODLPUB'
count: '{controller-vms}'
- stop-on-terminate: False
- '{mininet-image}':
- cloud-name: 'Rackspace DFW - Integration Dynamic Lab'
+ cloud-name: 'ODLPUB'
count: '{mininet-vms}'
- stop-on-terminate: False
+
+# Macro: integration-openstack-controller-mininet
+# Operation: this macro will spin the controller and mininet vms
+# Used by: {project}-csit-* job templates
+
+- wrapper:
+ name: integration-openstack-controller-mininet
+ wrappers:
+ - openstack:
+ instances:
+ - cloud-name: 'ODLRPC'
+ template-name: '{controller-image}'
+ count: '{controller-vms}'
+ - cloud-name: 'ODLRPC'
+ template-name: '{mininet-image}'
+ count: '{mininet-vms}'
+
+# Macro: integration-jclouds-controller-devstack
+# Operation: this macro will spin the controller and devstack vms
+# Used by: {project}-csit-openstack job templates
+- wrapper:
+ name: integration-jclouds-controller-devstack
+ wrappers:
+ - jclouds:
+ instances:
+ - '{controller-image}':
+ cloud-name: 'ODLPUB'
+ count: '{controller-vms}'
+ - '{openstack-image}':
+ cloud-name: 'ODLPUB'
+ count: '{openstack-vms}'
+
+# Macro: integration-openstack-controller-devstack
+# Operation: this macro will spin the controller and devstack vms
+# Used by: {project}-csit-openstack job templates
+- wrapper:
+ name: integration-openstack-controller-devstack
+ wrappers:
+ - openstack:
+ instances:
+ - cloud-name: 'ODLRPC'
+ template-name: '{controller-image}'
+ count: '{controller-vms}'
+ - cloud-name: 'ODLRPC'
+ template-name: '{openstack-image}'
+ count: '{openstack-vms}'
#################
# Shell Scripts #
#################
+# Macro: integration-copy-ssh-keys
+# Operation: Copy ssh public key used as authentication for robot
+# Used by: {project}-csit-* job templates
+
+- builder:
+ name: integration-copy-ssh-keys
+ builders:
+ - shell: |
+ #!/bin/bash
+ function copy-ssh-keys-to-slave() {
+ RETRIES=30
+ for j in $(seq 1 $RETRIES); do
+ if `ssh-copy-id -i /home/jenkins/.ssh/id_rsa.pub "jenkins@${i}" > /dev/null 2>&1`; then
+ ssh jenkins@${i} 'echo "$(facter ipaddress_eth0) $(/bin/hostname)" | sudo tee -a /etc/hosts'
+ echo "Successfully copied public keys to slave ${i}"
+ break
+ elif [ $j -eq $RETRIES ]; then
+ echo "SSH not responding on ${i} after $RETIRES tries. Giving up."
+ exit 1
+ else
+ echo "SSH not responding on ${i}. Retrying in 10 seconds..."
+ sleep 10
+ fi
+ done
+ }
+
+ echo "OpenStack IPS are ${JCLOUDS_IPS}"
+
+ IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}"
+
+ for i in "${ADDR[@]}"; do
+ copy-ssh-keys-to-slave &
+ done
+
+ wait
+ echo "Copying ssh keys complete."
+
# Macro: integration-get-slave-addresses
# Operation: this macro gets the IP addresses of the dynamic vms
# Used by: {project}-csit-* job templates
name: integration-get-slave-addresses
builders:
- shell:
- !include-raw include-raw-integration-get-slave-addresses.sh
+ !include-raw:
+ - include-raw-integration-get-slave-addresses.sh
# Macro: integration-get-bundle-vars
# Operation: this macro gets all bundle related variables
name: integration-get-bundle-vars
builders:
- shell:
- !include-raw include-raw-integration-get-bundle-vars.sh
+ !include-raw:
+ - include-raw-integration-get-bundle-vars.sh
-# Macro: integration-deply-controller-run-test
-# Operation: this macro deployes single contoller and runs test
-# Used by: {project}-csit-1node-* job templates
+# Macro: integration-distribution-check
+# Operation: this macro deploys the controller with all fetures
+# Used by: {project}-distribution-check-{stream} job template
- builder:
- name: integration-deploy-controller-run-test
+ name: integration-distribution-check
builders:
- shell:
- !include-raw include-raw-integration-deploy-controller-run-test.sh
+ !include-raw:
+ - include-raw-integration-distribution-check.sh
-# Macro: integration-deploy-controller
-# Operation: this macro prepares 3-node cluster controller
-# Used by: {project}-csit-3node-* job templates
+# Macro: integration-deploy-controller-verify
+# Operation: this macro deploys the controller with all fetures
+# Used by: integration-distribution-deploy-{stream} job template
- builder:
- name: integration-deploy-controller
+ name: integration-deploy-controller-verify
builders:
- shell:
- !include-raw include-raw-integration-deploy-controller.sh
+ !include-raw:
+ - include-raw-integration-deploy-controller-verify.sh
+
+# Macro: integration-deploy-controller-offline
+# Operation: this macro deploys the controller with no external repo configuration
+# Used by: integration-distrbution-offline-{stream} job template
+
+- builder:
+ name: integration-deploy-controller-offline
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-deploy-controller-offline.sh
+
+# Macro: integration-deply-controller-run-test
+# Operation: this macro deploys single contoller and runs test
+# Used by: {project}-csit-1node-* job templates
+
+- builder:
+ name: integration-deploy-controller-run-test
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-deploy-controller-run-test.sh
# Macro: integration-configure-clustering
# Operation: this macro configures the clustering
name: integration-configure-clustering
builders:
- shell:
- !include-raw include-raw-integration-configure-clustering.sh
+ !include-raw:
+ - include-raw-integration-configure-clustering.sh
# Macro: integration-start-cluster-run-test
# Operation: this macro starts the 3-node cluster and runs test
name: integration-start-cluster-run-test
builders:
- shell:
- !include-raw include-raw-integration-start-cluster-run-test.sh
+ !include-raw:
+ - include-raw-integration-start-cluster-run-test.sh
-# Macro: integration-deploy-controller-offline
-# Operation: this macro deployes the controller with no external repo configuration
-# Used by: integration-distrbution-offline-{stream} job template
+# Macro: integration-get-bundle-url
+# Operation: this macro gets the job generated distribution URL from distribution pom.xml
+# Used by: integration-patch-test-{stream} job template
- builder:
- name: integration-deploy-controller-offline
+ name: integration-get-bundle-url
builders:
- shell:
- !include-raw include-raw-integration-deploy-controller-offline.sh
+ !include-raw:
+ - include-raw-integration-get-bundle-url.sh
-# Macro: integration-get-bundle-url
-# Operation: this macro gets the distribution bundle URL
-# Used by: integration-patch-test-{stream} job template
+# Macro: integration-get-bundle-url-root
+# Operation: this macro gets the job generated distribution URL from root pom.xml
+# Used by: integration-distribution-verify-{stream} job template
- builder:
- name: integration-get-bundle-url
+ name: integration-get-bundle-url-root
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-get-bundle-url-root.sh
+
+# Macro: integration-install-robotframework
+# Operation: Installs robotframework using pip to a virtualenv
+# Used by: {project}-csit-* job templates
+
+- builder:
+ name: integration-install-robotframework
builders:
- shell:
- !include-raw include-raw-integration-get-bundle-url.sh
+ !include-raw:
+ - include-raw-integration-install-robotframework.sh
+# Macro: integration-cleanup-tmp
+# Operation: Cleans up temporary files created by build
+# Used by: {project}-csit-* job templates
+
+- builder:
+ name: integration-cleanup-tmp
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-cleanup-tmp.sh
+
+# Macro: integration-multipatch-builder
+# Operation: checks out multiple patches and builds custom distribution
+# Used by: integration-multipatch-test-* job templates
+
+- builder:
+ name: integration-multipatch-builder
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-multipatch-distribution-test.sh
+
+# Macro: integration-cleanup-worspace
+# Operation: Cleans up files possibly left there by the previous build
+# Used by: {project}-csit-* job templates
+
+- builder:
+ name: integration-cleanup-workspace
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-cleanup-workspace.sh
+
+# Macro: integration-rebase-patch
+# Operation: For cloned project, rebase checked-out Gerrit patch onto $BRANCH.
+# Used by: integration-patch-distribution-* job template
+
+- builder:
+ name: integration-rebase-gerrit-patch
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-rebase-gerrit-patch.sh
+
+- builder:
+ name: integration-deploy-openstack-run-test
+ builders:
+ - shell:
+ !include-raw:
+ - include-raw-integration-deploy-openstack-run-test.sh
##############
# Publishers #
##############
unstable-threshold: '{unstable-if}'
pass-threshold: '{pass-if}'
only-critical: false
+
+- publisher:
+ name: integration-robot-tempest
+ publishers:
+ - robot:
+ output-path: ''
+ other-files:
+ - tempest_results.html
+ unstable-threshold: '{unstable-if}'
+ pass-threshold: '{pass-if}'
+ only-critical: false
+
+- publisher:
+ name: integration-csit-archive-build
+ publishers:
+ - postbuildscript:
+ builders:
+ - shell: |
+ #!/bin/bash
+ mkdir $WORKSPACE/archives
+ curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
+ unzip -d $WORKSPACE/archives robot-plugin.zip
+ mv *log* *.log *.csv *.png $WORKSPACE/archives || true # Don't fail if file missing
+ script-only-if-succeeded: False
+ script-only-if-failed: False
+ mark-unstable-if-failed: True