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-infra-stack-4-type
275 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
276 # up csit lab using openstack-heat.
277 # Used by: {project}-csit-* job templates
280 name: integration-infra-stack-4-type
282 - integration-cleanup-workspace
285 # Setup openstack envirnoment file for use by
286 # the opendaylight-infra-stack macro
287 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
289 vm_0_count: {vm_0_count}
290 vm_0_flavor: {vm_0_flavor}
291 vm_0_image: {vm_0_image}
292 vm_1_count: {vm_1_count}
293 vm_1_flavor: {vm_1_flavor}
294 vm_1_image: {vm_1_image}
295 vm_2_count: {vm_2_count}
296 vm_2_flavor: {vm_2_flavor}
297 vm_2_image: {vm_2_image}
298 vm_3_count: {vm_3_count}
299 vm_3_flavor: {vm_3_flavor}
300 vm_3_image: {vm_3_image}
302 echo "Contents of opendaylight-infra-environment.yaml ..."
303 cat $WORKSPACE/opendaylight-infra-environment.yaml
304 - opendaylight-infra-stack:
305 stack-template: 'csit-4-instance-type.yaml'
307 # Macro: integration-get-slave-addresses
308 # Operation: this macro gets the IP addresses of the dynamic vms
309 # Used by: {project}-csit-* job templates
312 name: integration-get-slave-addresses
314 - shell: !include-raw: include-raw-integration-get-slave-addresses.sh
317 name: integration-set-variables
318 # Operation: Construct variables not requiring online detection and export using set_variables.env
319 # Required bash variables:
320 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
322 - shell: !include-raw: integration-set-variables.sh
324 properties-file: set_variables.env
327 name: integration-detect-variables
328 # Operation: Construct variables including online detection and export using detect_variables.env
329 # This calls integration-set-variables internally.
330 # Required bash variables:
331 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
333 - integration-set-variables
334 - shell: !include-raw: integration-detect-variables.sh
336 properties-file: detect_variables.env
339 name: integration-distribution-check
340 # Operation: Locally deploy ODL with all fetures, check it is not broken.
341 # Required bash variables:
342 # KARAF_VERSION: 'karaf4' or 'karaf3'.
343 # Use distribution-karaf-version macro to customize.
345 - integration-set-variables
346 - shell: !include-raw: integration-distribution-check.sh
349 name: distribution-deploy-verify
350 # Operation: Deploy ODL with all fetures and check it is not broken.
351 # Required bash variables:
352 # KARAF_VERSION: 'karaf4' or 'karaf3'.
353 # Use distribution-karaf-version macro to customize.
355 - integration-detect-variables
356 - shell: !include-raw: distribution-deploy-verify.sh
359 name: distribution-deploy-offline
360 # Operation: Deploys ODL on the current system, with no external repo configuration, check it works.
361 # Required bash variables:
362 # KARAF_VERSION: 'karaf4' or 'karaf3'.
363 # Use distribution-karaf-version macro to customize.
365 - integration-detect-variables
366 - shell: !include-raw: distribution-deploy-offline.sh
368 # Macro: integration-deply-controller-run-test
369 # Operation: this macro deploys single contoller and runs test
370 # Used by: {project}-csit-1node-* job templates
373 name: integration-deploy-controller-run-test
375 - shell: !include-raw: include-raw-integration-deploy-controller-run-test.sh
377 # Macro: integration-configure-clustering
378 # Operation: this macro configures the clustering
379 # Used by: {project}-csit-3node-* job templates
382 name: integration-configure-clustering
384 - shell: !include-raw: include-raw-integration-configure-clustering.sh
386 # Macro: integration-start-cluster-run-test
387 # Operation: this macro starts the 3-node cluster and runs test
388 # Used by: {project}-csit-3node-* job templates
391 name: integration-start-cluster-run-test
393 - shell: !include-raw: include-raw-integration-start-cluster-run-test.sh
395 # Macro: integration-install-robotframework
396 # Operation: Installs robotframework using pip to a virtualenv
397 # Used by: {project}-csit-* job templates
400 name: integration-install-robotframework
402 - shell: !include-raw: include-raw-integration-install-robotframework.sh
404 # Macro: integration-cleanup-tmp
405 # Operation: Cleans up temporary files created by build
406 # Used by: {project}-csit-* job templates
409 name: integration-cleanup-tmp
411 - shell: !include-raw: include-raw-integration-cleanup-tmp.sh
413 # Macro: integration-multipatch-builder
414 # Operation: checks out multiple patches and builds custom distribution
415 # Used by: integration-multipatch-test-* job templates
418 name: integration-multipatch-builder
420 - shell: !include-raw: multipatch-distribution.sh
422 # Macro: integration-cleanup-workspace
423 # Operation: Cleans up files possibly left there by the previous build
424 # Used by: {project}-csit-* job templates
427 name: integration-cleanup-workspace
429 - shell: !include-raw: include-raw-integration-cleanup-workspace.sh
431 # Macro: integration-rebase-patch
432 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
433 # Used by: integration-patch-distribution-* job template
436 name: integration-rebase-gerrit-patch
438 - shell: !include-raw: include-raw-integration-rebase-gerrit-patch.sh
441 name: integration-deploy-openstack-run-test
443 - shell: !include-raw: include-raw-integration-deploy-openstack-run-test.sh
445 # Macro: integration-list-jobs
446 # Operation: queries Jenkins jobs from jenkins.opendaylight.org and
447 # writes a list of the jobs corresponding to the search terms to a file.
448 # Used by: builder-merge job template
450 # This script requires the following JJB variables to be passed in:
451 # {search_string} Job type to act as a primary filter (e.g. csit)
452 # {blacklist} List of sub-projects to filter out (e.g. longevity)
453 # {stream} Development release name (e.g. boron)
454 # {jobs-filename} Filename to write list into (e.g. carbon-jobs.lst)
455 # NOTE: Requires xmlstarlet installed on node.
458 name: integration-list-jobs
460 - shell: !include-raw: include-raw-integration-list-jobs.sh
462 # Macro: integration-replace-block-text
463 # Operation: using starting and ending regex to
464 # replace a block of text in a file with the text in
465 # another file. Regex should be basic and work with sed
466 # Used by: builder-merge job template
468 # This script requires the following JJB variables to be passed in:
471 # {file-with-changes-to-insert}
475 name: integration-replace-block-text
477 - shell: !include-raw: include-raw-integration-replace-block-text.sh
481 name: integration-compare-distributions
482 # Operation: will compare an already created distribtion (probably last
483 # published to nexus) to the current distribution being created.
484 # The comparison is done to find the list of patches that are new to the
485 # current distribution.
486 # Required bash variables:
487 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
489 - shell: !include-raw: include-raw-integration-compare-distributions.sh
492 name: integration-upload-distribution
493 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
495 # {dist-pom} path to pom file containing the version
496 # Required bash variables:
497 # KARAF_VERSION: 'karaf4' or 'karaf3'.
498 # Use distribution-karaf-version macro to customize.
500 - config-file-provider:
502 - file-id: global-settings
503 variable: GLOBAL_SETTINGS_FILE
504 - file-id: integration-settings
505 variable: SETTINGS_FILE
506 - integration-set-variables
508 properties-content: BUNDLE_POM={dist-pom}
509 - shell: !include-raw-escape: integration-upload-distribution.sh
511 properties-file: integration-upload-distribution.env
517 # Macro: integration-robot
518 # Operation: this macro publishes robot results
519 # Used by: {project}-csit-* job templates
522 name: integration-robot
527 unstable-threshold: '{unstable-if}'
528 pass-threshold: '{pass-if}'
532 name: integration-robot-tempest
537 - tempest_results.html
538 unstable-threshold: '{unstable-if}'
539 pass-threshold: '{pass-if}'
543 name: integration-csit-archive-build
549 mkdir -p $WORKSPACE/archives
550 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
551 unzip -d $WORKSPACE/archives robot-plugin.zip
552 mv *log* *.log *.log.gz *.csv *.png $WORKSPACE/archives || true # Don't fail if file missing
553 script-only-if-succeeded: 'False'
554 script-only-if-failed: 'False'
555 mark-unstable-if-failed: 'True'
558 name: integration-csit-run-postscript
562 - config-file-provider:
564 - file-id: 'odl-elastic-cloud'
565 target: '${HOME}/.netrc'
568 #The following script runs any configurable postplan stored in test/csit/postplans.
569 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
570 echo "postplan exists!!!"
571 echo "Changing the postplan path..."
572 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
573 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
575 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
576 echo "Executing ${line}..."
581 script-only-if-succeeded: 'False'
582 script-only-if-failed: 'False'
583 mark-unstable-if-failed: 'True'