2 # TODO: Make all bash constants more readable.
3 # e.g.: DISTRIBUTION_BRANCH instead of DISTROBRANCH.
5 name: integration-distribution-branch
10 description: 'Distribution GIT branch'
13 name: distribution-karaf-version
15 # karaf-version: Provide, otherwise releng-defaults value is used.
19 default: '{karaf-version}'
20 description: 'karaf3 or karaf4, affects ODL deploy scripts'
23 name: integration-bundle-url
27 default: '{bundle-url}'
28 description: 'URL to karaf distribution zip'
31 name: integration-jdk-version
35 default: '{jdkversion}'
36 description: 'Parameter to indicate JAVA Version'
39 name: integration-controller-scope
43 default: '{controller-scope}'
44 description: 'Feature Only or Feature All test'
47 name: integration-controller-features
50 name: CONTROLLERFEATURES
51 default: '{controller-features}'
52 description: 'Features to install in the controller separated by comma'
55 name: integration-distribution-stream
60 description: 'Distribution stream string, for suites to know which behavior to expect'
63 name: integration-stream-test-plan
67 default: '{stream-test-plan}'
68 description: 'Stream-specific test plan we will run'
71 name: integration-test-plan
75 default: '{test-plan}'
76 description: 'General test plan we will run unless stream-specific one is found'
79 name: integration-test-options
83 default: '{test-options}'
84 description: 'Robot command options'
87 name: integration-distribution-git-url
91 default: '{git-url}/integration/distribution'
92 description: 'Distribution GIT URL (do not modify)'
95 name: integration-patch-refspec
100 description: 'Integration Patch Refspec'
102 # Macro: integration-gerrit-scm
103 # Operation: this macro downloads a project gerrit
104 # Used by: all csit jobs
107 name: integration-gerrit-scm
110 credentials-id: 'opendaylight-jenkins-ssh'
117 choosing-strategy: 'gerrit'
119 # Macro: integration-distribution-scm
120 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
121 # Used by: integration-patch-test-{stream} job template
124 name: integration-distribution-scm
127 credentials-id: 'opendaylight-jenkins-ssh'
128 basedir: 'distribution'
135 # Macro: integration-trigger-patch-submitted
136 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
137 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
138 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
139 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
141 # server: name of gerrit server to listen to
142 # project: pattern to match triggering projects
143 # branch: triggering branch name
144 # files: pattern to match triggering filepaths
146 name: integration-trigger-patch-submitted
149 server-name: '{server}'
151 - patchset-created-event:
153 exclude-trivial-rebase: false
154 exclude-no-code-change: false
155 - draft-published-event
156 - comment-added-contains-event:
157 comment-contains-value: recheck
159 gerrit-build-unstable-verified-value: +1
160 gerrit-build-unstable-codereview-value: 0
162 - project-compare-type: ANT
163 project-pattern: '{project}'
165 - branch-compare-type: ANT
166 branch-pattern: '**/{branch}'
171 # Macro: integration-csit-only
172 # Operation: this macro sets a trigger on reverse job list
173 # Used by: csit -only- job templates
176 name: integration-csit-trigger
182 # Macro: integration-openstack-controller-mininet
183 # Operation: this macro will spin the controller and mininet vms
184 # Used by: {project}-csit-* job templates
187 name: integration-openstack-controller-mininet
191 - cloud-name: 'ODLRPC'
192 template-name: '{controller-image}'
193 count: '{controller-vms}'
194 - cloud-name: 'ODLRPC'
195 template-name: '{mininet-image}'
196 count: '{mininet-vms}'
198 # Macro: integration-openstack-controller-devstack
199 # Operation: this macro will spin the controller and devstack vms
200 # Used by: {project}-csit-openstack job templates
202 name: integration-openstack-controller-devstack
206 - cloud-name: 'ODLRPC'
207 template-name: '{controller-image}'
208 count: '{controller-vms}'
209 - cloud-name: 'ODLRPC'
210 template-name: '{openstack-image}'
211 count: '{openstack-vms}'
217 # Macro: integration-infra-stack
218 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
219 # up csit lab using openstack-heat.
220 # Used by: {project}-csit-* job templates
223 name: integration-infra-stack
225 - integration-cleanup-workspace
228 # Setup openstack envirnoment file for use by
229 # the opendaylight-infra-stack macro
230 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
232 vm_0_count: {vm_0_count}
233 vm_0_flavor: {vm_0_flavor}
234 vm_0_image: {vm_0_image}
235 vm_1_count: {vm_1_count}
236 vm_1_flavor: {vm_1_flavor}
237 vm_1_image: {vm_1_image}
239 echo "Contents of opendaylight-infra-environment.yaml ..."
240 cat $WORKSPACE/opendaylight-infra-environment.yaml
241 - opendaylight-infra-stack:
242 stack-template: '{stack-template}'
244 # Macro: integration-infra-stack-3-type
245 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
246 # up csit lab using openstack-heat.
247 # Used by: {project}-csit-* job templates
250 name: integration-infra-stack-3-type
252 - integration-cleanup-workspace
255 # Setup openstack envirnoment file for use by
256 # the opendaylight-infra-stack macro
257 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
259 vm_0_count: {vm_0_count}
260 vm_0_flavor: {vm_0_flavor}
261 vm_0_image: {vm_0_image}
262 vm_1_count: {vm_1_count}
263 vm_1_flavor: {vm_1_flavor}
264 vm_1_image: {vm_1_image}
265 vm_2_count: {vm_2_count}
266 vm_2_flavor: {vm_2_flavor}
267 vm_2_image: {vm_2_image}
269 echo "Contents of opendaylight-infra-environment.yaml ..."
270 cat $WORKSPACE/opendaylight-infra-environment.yaml
271 - opendaylight-infra-stack:
272 stack-template: 'csit-3-instance-type.yaml'
274 # Macro: integration-get-slave-addresses
275 # Operation: this macro gets the IP addresses of the dynamic vms
276 # Used by: {project}-csit-* job templates
279 name: integration-get-slave-addresses
281 - shell: !include-raw: include-raw-integration-get-slave-addresses.sh
284 name: integration-set-variables
285 # Operation: Construct variables not requiring online detection and export using set_variables.env
286 # Required bash variables:
287 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
289 - shell: !include-raw: integration-set-variables.sh
291 properties-file: set_variables.env
294 name: integration-detect-variables
295 # Operation: Construct variables including online detection and export using detect_variables.env
296 # This calls integration-set-variables internally.
297 # Required bash variables:
298 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
300 - integration-set-variables
301 - shell: !include-raw: integration-detect-variables.sh
303 properties-file: detect_variables.env
306 name: integration-distribution-check
307 # Operation: Locally deploy ODL with all fetures, check it is not broken.
308 # Required bash variables:
309 # KARAF_VERSION: 'karaf4' or 'karaf3'.
310 # Use distribution-karaf-version macro to customize.
312 - integration-set-variables
313 - shell: !include-raw: integration-distribution-check.sh
316 name: distribution-deploy-verify
317 # Operation: Deploy ODL with all fetures and check it is not broken.
318 # Required bash variables:
319 # KARAF_VERSION: 'karaf4' or 'karaf3'.
320 # Use distribution-karaf-version macro to customize.
322 - integration-detect-variables
323 - shell: !include-raw: distribution-deploy-verify.sh
326 name: distribution-deploy-offline
327 # Operation: Deploys ODL on the current system, with no external repo configuration, check it works.
328 # Required bash variables:
329 # KARAF_VERSION: 'karaf4' or 'karaf3'.
330 # Use distribution-karaf-version macro to customize.
332 - integration-detect-variables
333 - shell: !include-raw: distribution-deploy-offline.sh
335 # Macro: integration-deply-controller-run-test
336 # Operation: this macro deploys single contoller and runs test
337 # Used by: {project}-csit-1node-* job templates
340 name: integration-deploy-controller-run-test
342 - shell: !include-raw: include-raw-integration-deploy-controller-run-test.sh
344 # Macro: integration-configure-clustering
345 # Operation: this macro configures the clustering
346 # Used by: {project}-csit-3node-* job templates
349 name: integration-configure-clustering
351 - shell: !include-raw: include-raw-integration-configure-clustering.sh
353 # Macro: integration-start-cluster-run-test
354 # Operation: this macro starts the 3-node cluster and runs test
355 # Used by: {project}-csit-3node-* job templates
358 name: integration-start-cluster-run-test
360 - shell: !include-raw: include-raw-integration-start-cluster-run-test.sh
362 # Macro: integration-install-robotframework
363 # Operation: Installs robotframework using pip to a virtualenv
364 # Used by: {project}-csit-* job templates
367 name: integration-install-robotframework
369 - shell: !include-raw: include-raw-integration-install-robotframework.sh
371 # Macro: integration-cleanup-tmp
372 # Operation: Cleans up temporary files created by build
373 # Used by: {project}-csit-* job templates
376 name: integration-cleanup-tmp
378 - shell: !include-raw: include-raw-integration-cleanup-tmp.sh
380 # Macro: integration-multipatch-builder
381 # Operation: checks out multiple patches and builds custom distribution
382 # Used by: integration-multipatch-test-* job templates
385 name: integration-multipatch-builder
387 - shell: !include-raw: include-raw-integration-multipatch-distribution-test.sh
389 # Macro: integration-cleanup-workspace
390 # Operation: Cleans up files possibly left there by the previous build
391 # Used by: {project}-csit-* job templates
394 name: integration-cleanup-workspace
396 - shell: !include-raw: include-raw-integration-cleanup-workspace.sh
398 # Macro: integration-rebase-patch
399 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
400 # Used by: integration-patch-distribution-* job template
403 name: integration-rebase-gerrit-patch
405 - shell: !include-raw: include-raw-integration-rebase-gerrit-patch.sh
408 name: integration-deploy-openstack-run-test
410 - shell: !include-raw: include-raw-integration-deploy-openstack-run-test.sh
412 # Macro: integration-list-jobs
413 # Operation: queries Jenkins jobs from jenkins.opendaylight.org and
414 # writes a list of the jobs corresponding to the search terms to a file.
415 # Used by: builder-merge job template
417 # This script requires the following JJB variables to be passed in:
418 # {search_string} Job type to act as a primary filter (e.g. csit)
419 # {blacklist} List of sub-projects to filter out (e.g. longevity)
420 # {stream} Development release name (e.g. boron)
421 # {jobs-filename} Filename to write list into (e.g. carbon-jobs.lst)
422 # NOTE: Requires xmlstarlet installed on node.
425 name: integration-list-jobs
427 - shell: !include-raw: include-raw-integration-list-jobs.sh
429 # Macro: integration-replace-block-text
430 # Operation: using starting and ending regex to
431 # replace a block of text in a file with the text in
432 # another file. Regex should be basic and work with sed
433 # Used by: builder-merge job template
435 # This script requires the following JJB variables to be passed in:
438 # {file-with-changes-to-insert}
442 name: integration-replace-block-text
444 - shell: !include-raw: include-raw-integration-replace-block-text.sh
448 name: integration-compare-distributions
449 # Operation: will compare an already created distribtion (probably last
450 # published to nexus) to the current distribution being created.
451 # The comparison is done to find the list of patches that are new to the
452 # current distribution.
453 # Required bash variables:
454 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
456 - shell: !include-raw: include-raw-integration-compare-distributions.sh
459 name: integration-upload-distribution
460 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
462 # {dist-pom} path to pom file containing the version
463 # Required bash variables:
464 # KARAF_VERSION: 'karaf4' or 'karaf3'.
465 # Use distribution-karaf-version macro to customize.
467 - config-file-provider:
469 - file-id: odl-global-settings
470 variable: GLOBAL_SETTINGS_FILE
471 - file-id: integration-settings
472 variable: SETTINGS_FILE
473 - integration-set-variables
475 properties-content: BUNDLE_POM={dist-pom}
476 - shell: !include-raw-escape: integration-upload-distribution.sh
478 properties-file: integration-upload-distribution.env
484 # Macro: integration-robot
485 # Operation: this macro publishes robot results
486 # Used by: {project}-csit-* job templates
489 name: integration-robot
494 unstable-threshold: '{unstable-if}'
495 pass-threshold: '{pass-if}'
499 name: integration-robot-tempest
504 - tempest_results.html
505 unstable-threshold: '{unstable-if}'
506 pass-threshold: '{pass-if}'
510 name: integration-csit-archive-build
516 mkdir -p $WORKSPACE/archives
517 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
518 unzip -d $WORKSPACE/archives robot-plugin.zip
519 mv *log* *.log *.log.gz *.csv *.png $WORKSPACE/archives || true # Don't fail if file missing
520 script-only-if-succeeded: 'False'
521 script-only-if-failed: 'False'
522 mark-unstable-if-failed: 'True'