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-controller-debug-map
58 name: CONTROLLERDEBUGMAP
59 default: '{controller-debug-map}'
61 Key:Value map of debugs to enable on the controller separated by spaces.
62 The module should not include org.opendaylight.
63 The levels must be one of: ERROR, WARN, INFO, DEBUG, TRACE.
64 (ex. ovsdb.lib:ERROR netvirt.vpnservice:INFO)
67 name: integration-distribution-stream
72 description: 'Distribution stream string, for suites to know which behavior to expect'
75 name: integration-stream-test-plan
79 default: '{stream-test-plan}'
80 description: 'Stream-specific test plan we will run'
83 name: integration-test-plan
87 default: '{test-plan}'
88 description: 'General test plan we will run unless stream-specific one is found'
91 name: integration-test-options
95 default: '{test-options}'
96 description: 'Robot command options'
99 name: integration-distribution-git-url
103 default: '{git-url}/integration/distribution'
104 description: 'Distribution GIT URL (do not modify)'
107 name: integration-patch-refspec
112 description: 'Integration Patch Refspec'
114 # Macro: integration-gerrit-scm
115 # Operation: this macro downloads a project gerrit
116 # Used by: all csit jobs
119 name: integration-gerrit-scm
122 credentials-id: 'opendaylight-jenkins-ssh'
129 choosing-strategy: 'gerrit'
131 # Macro: integration-distribution-scm
132 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
133 # Used by: integration-patch-test-{stream} job template
136 name: integration-distribution-scm
139 credentials-id: 'opendaylight-jenkins-ssh'
140 basedir: 'distribution'
147 # Macro: integration-trigger-patch-submitted
148 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
149 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
150 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
151 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
153 # server: name of gerrit server to listen to
154 # project: pattern to match triggering projects
155 # branch: triggering branch name
156 # files: pattern to match triggering filepaths
158 name: integration-trigger-patch-submitted
161 server-name: '{server}'
163 - patchset-created-event:
165 exclude-trivial-rebase: false
166 exclude-no-code-change: false
167 - draft-published-event
168 - comment-added-contains-event:
169 comment-contains-value: recheck
171 gerrit-build-unstable-verified-value: +1
172 gerrit-build-unstable-codereview-value: 0
174 - project-compare-type: ANT
175 project-pattern: '{project}'
177 - branch-compare-type: ANT
178 branch-pattern: '**/{branch}'
183 # Macro: integration-csit-only
184 # Operation: this macro sets a trigger on reverse job list
185 # Used by: csit -only- job templates
188 name: integration-csit-trigger
194 # Macro: integration-openstack-controller-mininet
195 # Operation: this macro will spin the controller and mininet vms
196 # Used by: {project}-csit-* job templates
199 name: integration-openstack-controller-mininet
203 - cloud-name: 'ODLRPC'
204 template-name: '{controller-image}'
205 count: '{controller-vms}'
206 - cloud-name: 'ODLRPC'
207 template-name: '{mininet-image}'
208 count: '{mininet-vms}'
210 # Macro: integration-openstack-controller-devstack
211 # Operation: this macro will spin the controller and devstack vms
212 # Used by: {project}-csit-openstack job templates
214 name: integration-openstack-controller-devstack
218 - cloud-name: 'ODLRPC'
219 template-name: '{controller-image}'
220 count: '{controller-vms}'
221 - cloud-name: 'ODLRPC'
222 template-name: '{openstack-image}'
223 count: '{openstack-vms}'
229 # Macro: integration-infra-stack
230 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
231 # up csit lab using openstack-heat.
232 # Used by: {project}-csit-* job templates
235 name: integration-infra-stack
237 - integration-cleanup-workspace
240 # Setup openstack envirnoment file for use by
241 # the opendaylight-infra-stack macro
242 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
244 vm_0_count: {vm_0_count}
245 vm_0_flavor: {vm_0_flavor}
246 vm_0_image: {vm_0_image}
247 vm_1_count: {vm_1_count}
248 vm_1_flavor: {vm_1_flavor}
249 vm_1_image: {vm_1_image}
251 echo "Contents of opendaylight-infra-environment.yaml ..."
252 cat $WORKSPACE/opendaylight-infra-environment.yaml
253 - opendaylight-infra-stack:
254 stack-template: '{stack-template}'
256 # Macro: integration-infra-stack-3-type
257 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
258 # up csit lab using openstack-heat.
259 # Used by: {project}-csit-* job templates
262 name: integration-infra-stack-3-type
264 - integration-cleanup-workspace
267 # Setup openstack envirnoment file for use by
268 # the opendaylight-infra-stack macro
269 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
271 vm_0_count: {vm_0_count}
272 vm_0_flavor: {vm_0_flavor}
273 vm_0_image: {vm_0_image}
274 vm_1_count: {vm_1_count}
275 vm_1_flavor: {vm_1_flavor}
276 vm_1_image: {vm_1_image}
277 vm_2_count: {vm_2_count}
278 vm_2_flavor: {vm_2_flavor}
279 vm_2_image: {vm_2_image}
281 echo "Contents of opendaylight-infra-environment.yaml ..."
282 cat $WORKSPACE/opendaylight-infra-environment.yaml
283 - opendaylight-infra-stack:
284 stack-template: 'csit-3-instance-type.yaml'
286 # Macro: integration-infra-stack-4-type
287 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
288 # up csit lab using openstack-heat.
289 # Used by: {project}-csit-* job templates
292 name: integration-infra-stack-4-type
294 - integration-cleanup-workspace
297 # Setup openstack envirnoment file for use by
298 # the opendaylight-infra-stack macro
299 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
301 vm_0_count: {vm_0_count}
302 vm_0_flavor: {vm_0_flavor}
303 vm_0_image: {vm_0_image}
304 vm_1_count: {vm_1_count}
305 vm_1_flavor: {vm_1_flavor}
306 vm_1_image: {vm_1_image}
307 vm_2_count: {vm_2_count}
308 vm_2_flavor: {vm_2_flavor}
309 vm_2_image: {vm_2_image}
310 vm_3_count: {vm_3_count}
311 vm_3_flavor: {vm_3_flavor}
312 vm_3_image: {vm_3_image}
314 echo "Contents of opendaylight-infra-environment.yaml ..."
315 cat $WORKSPACE/opendaylight-infra-environment.yaml
316 - opendaylight-infra-stack:
317 stack-template: 'csit-4-instance-type.yaml'
319 # Macro: integration-get-slave-addresses
320 # Operation: this macro gets the IP addresses of the dynamic vms
321 # Used by: {project}-csit-* job templates
324 name: integration-get-slave-addresses
326 - shell: !include-raw: integration-get-slave-addresses.sh
329 name: integration-set-variables
330 # Operation: Construct variables not requiring online detection and export using set_variables.env
331 # Required bash variables:
332 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
334 - shell: !include-raw: integration-set-variables.sh
336 properties-file: set_variables.env
339 name: integration-detect-variables
340 # Operation: Construct variables including online detection and export using detect_variables.env
341 # This calls integration-set-variables internally.
342 # Required bash variables:
343 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
345 - integration-set-variables
346 - shell: !include-raw: integration-detect-variables.sh
348 properties-file: detect_variables.env
351 name: integration-distribution-check
352 # Operation: Locally deploy ODL with all fetures, check it is not broken.
353 # Required bash variables:
354 # KARAF_VERSION: 'karaf4' or 'karaf3'.
355 # Use distribution-karaf-version macro to customize.
357 - integration-set-variables
358 - shell: !include-raw: integration-distribution-check.sh
361 name: distribution-deploy-verify
362 # Operation: Deploy ODL with all fetures and check it is not broken.
363 # Required bash variables:
364 # KARAF_VERSION: 'karaf4' or 'karaf3'.
365 # Use distribution-karaf-version macro to customize.
367 - integration-detect-variables
368 - shell: !include-raw: distribution-deploy-verify.sh
371 name: distribution-deploy-offline
372 # Operation: Deploys ODL on the current system, with no external repo configuration, check it works.
373 # Required bash variables:
374 # KARAF_VERSION: 'karaf4' or 'karaf3'.
375 # Use distribution-karaf-version macro to customize.
377 - integration-detect-variables
378 - shell: !include-raw: distribution-deploy-offline.sh
380 # Macro: integration-deply-controller-run-test
381 # Operation: this macro deploys single contoller and runs test
382 # Used by: {project}-csit-1node-* job templates
385 name: integration-deploy-controller-run-test
387 - shell: !include-raw: integration-deploy-controller-run-test.sh
389 # Macro: integration-configure-clustering
390 # Operation: this macro configures the clustering
391 # Used by: {project}-csit-3node-* job templates
394 name: integration-configure-clustering
396 - shell: !include-raw: integration-configure-clustering.sh
398 # Macro: integration-start-cluster-run-test
399 # Operation: this macro starts the 3-node cluster and runs test
400 # Used by: {project}-csit-3node-* job templates
403 name: integration-start-cluster-run-test
405 - shell: !include-raw: integration-start-cluster-run-test.sh
407 # Macro: integration-install-robotframework
408 # Operation: Installs robotframework using pip to a virtualenv
409 # Used by: {project}-csit-* job templates
412 name: integration-install-robotframework
414 - shell: !include-raw: integration-install-robotframework.sh
416 # Macro: integration-cleanup-tmp
417 # Operation: Cleans up temporary files created by build
418 # Used by: {project}-csit-* job templates
421 name: integration-cleanup-tmp
423 - shell: !include-raw: integration-cleanup-tmp.sh
425 # Macro: integration-multipatch-builder
426 # Operation: checks out multiple patches and builds custom distribution
427 # Used by: integration-multipatch-test-* job templates
430 name: integration-multipatch-builder
432 - shell: !include-raw: multipatch-distribution.sh
434 # Macro: integration-cleanup-workspace
435 # Operation: Cleans up files possibly left there by the previous build
436 # Used by: {project}-csit-* job templates
439 name: integration-cleanup-workspace
441 - shell: !include-raw: integration-cleanup-workspace.sh
443 # Macro: integration-rebase-patch
444 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
445 # Used by: integration-patch-distribution-* job template
448 name: integration-rebase-gerrit-patch
450 - shell: !include-raw: integration-rebase-gerrit-patch.sh
453 name: integration-deploy-openstack-run-test
455 - shell: !include-raw: integration-deploy-openstack-run-test.sh
458 name: integration-compare-distributions
459 # Operation: will compare an already created distribtion (probably last
460 # published to nexus) to the current distribution being created.
461 # The comparison is done to find the list of patches that are new to the
462 # current distribution.
463 # Required bash variables:
464 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
466 - shell: !include-raw: integration-compare-distributions.sh
469 name: integration-upload-distribution
470 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
472 # {dist-pom} path to pom file containing the version
473 # Required bash variables:
474 # KARAF_VERSION: 'karaf4' or 'karaf3'.
475 # Use distribution-karaf-version macro to customize.
477 - config-file-provider:
479 - file-id: global-settings
480 variable: GLOBAL_SETTINGS_FILE
481 - file-id: integration-settings
482 variable: SETTINGS_FILE
483 - integration-set-variables
485 properties-content: BUNDLE_POM={dist-pom}
486 - shell: !include-raw-escape: integration-upload-distribution.sh
488 properties-file: integration-upload-distribution.env
494 # Macro: integration-robot
495 # Operation: this macro publishes robot results
496 # Used by: {project}-csit-* job templates
499 name: integration-robot
504 unstable-threshold: '{unstable-if}'
505 pass-threshold: '{pass-if}'
509 name: integration-robot-tempest
514 - tempest_results.html
515 unstable-threshold: '{unstable-if}'
516 pass-threshold: '{pass-if}'
520 name: integration-csit-archive-build
526 mkdir -p $WORKSPACE/archives
527 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
528 unzip -d $WORKSPACE/archives robot-plugin.zip
529 mv *log* *.log *.log.gz *.csv *.png $WORKSPACE/archives || true # Don't fail if file missing
530 script-only-if-succeeded: 'False'
531 script-only-if-failed: 'False'
532 mark-unstable-if-failed: 'True'
535 name: integration-csit-run-postscript
539 - config-file-provider:
541 - file-id: 'odl-elastic-cloud'
542 target: '${HOME}/.netrc'
545 #The following script runs any configurable postplan stored in test/csit/postplans.
546 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
547 echo "postplan exists!!!"
548 echo "Changing the postplan path..."
549 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
550 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
552 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
553 echo "Executing ${line}..."
558 script-only-if-succeeded: 'False'
559 script-only-if-failed: 'False'
560 mark-unstable-if-failed: 'True'