X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-macros.yaml;h=198f7b30f855f8c2d81aa524c038144f8953b916;hb=df0f32f924e9a71436df812ae5f446e32c6e717f;hp=cef6c7b383b1a5a12d038ffd26a9a08f7d0c4db0;hpb=211308aaebe77e278388e19cc449b7aa86bc232a;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-macros.yaml b/jjb/integration/integration-macros.yaml index cef6c7b38..198f7b30f 100644 --- a/jjb/integration/integration-macros.yaml +++ b/jjb/integration/integration-macros.yaml @@ -14,6 +14,14 @@ 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: @@ -30,13 +38,29 @@ 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 @@ -70,7 +94,7 @@ name: integration-gerrit-scm scm: - git: - credentials-id: '{credentials-id}' + credentials-id: 'opendaylight-jenkins-ssh' url: '$GIT_BASE' basedir: '{basedir}' refspec: '{refspec}' @@ -87,7 +111,7 @@ name: integration-distribution-scm scm: - git: - credentials-id: '{credentials-id}' + credentials-id: 'opendaylight-jenkins-ssh' basedir: 'distribution' url: '$DISTROGITURL' refspec: '' @@ -150,6 +174,26 @@ - compare-type: 'ANT' pattern: '{pattern}' +# Macro: integration-csit-only +# Operation: this macro sets a trigger on reverse job list +# Used by: csit -only- job templates + +- trigger: + name: integration-csit-only + triggers: + - 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 # Used by: {project}-csit-* job templates @@ -159,19 +203,100 @@ wrappers: - jclouds: instances: - - rk-c7-java: - cloud-name: 'Rackspace DFW - Integration Dynamic Lab' + - '{controller-image}': + cloud-name: 'ODLPUB' count: '{controller-vms}' - stop-on-terminate: False - '{mininet-image}': - cloud-name: '{mininet-cloud-name}' + 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 @@ -194,9 +319,20 @@ !include-raw: - include-raw-integration-get-bundle-vars.sh +# Macro: integration-distribution-check +# Operation: this macro deploys the controller with all fetures +# Used by: {project}-distribution-check-{stream} job template + +- builder: + name: integration-distribution-check + builders: + - shell: + !include-raw: + - include-raw-integration-distribution-check.sh + # Macro: integration-deploy-controller-verify # Operation: this macro deploys the controller with all fetures -# Used by: integration-distrbution-deploy-{stream} job template +# Used by: integration-distribution-deploy-{stream} job template - builder: name: integration-deploy-controller-verify @@ -227,17 +363,6 @@ !include-raw: - include-raw-integration-deploy-controller-run-test.sh -# Macro: integration-deploy-controller -# Operation: this macro prepares 3-node cluster controller -# Used by: {project}-csit-3node-* job templates - -- builder: - name: integration-deploy-controller - builders: - - shell: - !include-raw: - - include-raw-integration-deploy-controller.sh - # Macro: integration-configure-clustering # Operation: this macro configures the clustering # Used by: {project}-csit-3node-* job templates @@ -337,6 +462,12 @@ !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 # ############## @@ -354,3 +485,18 @@ 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