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-suites
95 default: '{test-suites}'
97 List of space-separated suites. Useful when running specific suites within a testplan.
98 Do not include ${{WORKSPACE}}/test/csit/suites/ in the values:
99 (ex. openstack/connectivity/l2.robot openstack/tempest/tempest.robot
100 integration/test/csit/suites/netvirt/ElanService/).
103 name: integration-test-options
107 default: '{test-options}'
108 description: 'Robot command options'
111 name: integration-distribution-git-url
115 default: '{git-url}/integration/distribution'
116 description: 'Distribution GIT URL (do not modify)'
119 name: integration-patch-refspec
124 description: 'Integration Patch Refspec'
126 # Macro: integration-gerrit-scm
127 # Operation: this macro downloads a project gerrit
128 # Used by: all csit jobs
131 name: integration-gerrit-scm
134 credentials-id: 'opendaylight-jenkins-ssh'
141 choosing-strategy: 'gerrit'
143 # Macro: integration-distribution-scm
144 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
145 # Used by: integration-patch-test-{stream} job template
148 name: integration-distribution-scm
151 credentials-id: 'opendaylight-jenkins-ssh'
152 basedir: 'distribution'
159 # Macro: integration-trigger-patch-submitted
160 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
161 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
162 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
163 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
165 # gerrit-server-name: name of gerrit server to listen to
166 # project: pattern to match triggering projects
167 # branch: triggering branch name
168 # files: pattern to match triggering filepaths
170 name: integration-trigger-patch-submitted
173 server-name: '{gerrit-server-name}'
175 - patchset-created-event:
177 exclude-trivial-rebase: false
178 exclude-no-code-change: false
179 - draft-published-event
180 - comment-added-contains-event:
181 comment-contains-value: recheck
183 gerrit-build-unstable-verified-value: +1
184 gerrit-build-unstable-codereview-value: 0
186 - project-compare-type: ANT
187 project-pattern: '{project}'
189 - branch-compare-type: ANT
190 branch-pattern: '**/{branch}'
195 # Macro: integration-csit-only
196 # Operation: this macro sets a trigger on reverse job list
197 # Used by: csit -only- job templates
200 name: integration-csit-trigger
206 # Macro: integration-openstack-controller-mininet
207 # Operation: this macro will spin the controller and mininet vms
208 # Used by: {project}-csit-* job templates
211 name: integration-openstack-controller-mininet
215 - cloud-name: 'ODLRPC'
216 template-name: '{controller-image}'
217 count: '{controller-vms}'
218 - cloud-name: 'ODLRPC'
219 template-name: '{mininet-image}'
220 count: '{mininet-vms}'
222 # Macro: integration-openstack-controller-devstack
223 # Operation: this macro will spin the controller and devstack vms
224 # Used by: {project}-csit-openstack job templates
226 name: integration-openstack-controller-devstack
230 - cloud-name: 'ODLRPC'
231 template-name: '{controller-image}'
232 count: '{controller-vms}'
233 - cloud-name: 'ODLRPC'
234 template-name: '{openstack-image}'
235 count: '{openstack-vms}'
241 # Macro: integration-infra-stack
242 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
243 # up csit lab using openstack-heat.
244 # Used by: {project}-csit-* job templates
247 name: integration-infra-stack
249 - integration-cleanup-workspace
252 # Setup openstack envirnoment file for use by
253 # the opendaylight-infra-stack macro
254 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
256 vm_0_count: {vm_0_count}
257 vm_0_flavor: {vm_0_flavor}
258 vm_0_image: {vm_0_image}
259 vm_1_count: {vm_1_count}
260 vm_1_flavor: {vm_1_flavor}
261 vm_1_image: {vm_1_image}
263 echo "Contents of opendaylight-infra-environment.yaml ..."
264 cat $WORKSPACE/opendaylight-infra-environment.yaml
265 - opendaylight-infra-stack:
266 stack-template: '{stack-template}'
268 # Macro: integration-infra-stack-3-type
269 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
270 # up csit lab using openstack-heat.
271 # Used by: {project}-csit-* job templates
274 name: integration-infra-stack-3-type
276 - integration-cleanup-workspace
279 # Setup openstack envirnoment file for use by
280 # the opendaylight-infra-stack macro
281 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
283 vm_0_count: {vm_0_count}
284 vm_0_flavor: {vm_0_flavor}
285 vm_0_image: {vm_0_image}
286 vm_1_count: {vm_1_count}
287 vm_1_flavor: {vm_1_flavor}
288 vm_1_image: {vm_1_image}
289 vm_2_count: {vm_2_count}
290 vm_2_flavor: {vm_2_flavor}
291 vm_2_image: {vm_2_image}
293 echo "Contents of opendaylight-infra-environment.yaml ..."
294 cat $WORKSPACE/opendaylight-infra-environment.yaml
295 - opendaylight-infra-stack:
296 stack-template: 'csit-3-instance-type.yaml'
298 # Macro: integration-infra-stack-4-type
299 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
300 # up csit lab using openstack-heat.
301 # Used by: {project}-csit-* job templates
304 name: integration-infra-stack-4-type
306 - integration-cleanup-workspace
309 # Setup openstack envirnoment file for use by
310 # the opendaylight-infra-stack macro
311 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
313 vm_0_count: {vm_0_count}
314 vm_0_flavor: {vm_0_flavor}
315 vm_0_image: {vm_0_image}
316 vm_1_count: {vm_1_count}
317 vm_1_flavor: {vm_1_flavor}
318 vm_1_image: {vm_1_image}
319 vm_2_count: {vm_2_count}
320 vm_2_flavor: {vm_2_flavor}
321 vm_2_image: {vm_2_image}
322 vm_3_count: {vm_3_count}
323 vm_3_flavor: {vm_3_flavor}
324 vm_3_image: {vm_3_image}
326 echo "Contents of opendaylight-infra-environment.yaml ..."
327 cat $WORKSPACE/opendaylight-infra-environment.yaml
328 - opendaylight-infra-stack:
329 stack-template: 'csit-4-instance-type.yaml'
331 # Macro: integration-get-slave-addresses
332 # Operation: this macro gets the IP addresses of the dynamic vms
333 # Used by: {project}-csit-* job templates
336 name: integration-get-slave-addresses
338 - shell: !include-raw: integration-get-slave-addresses.sh
341 name: integration-set-variables
342 # Operation: Construct variables not requiring online detection and export using set_variables.env
343 # Required bash variables:
344 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
346 - shell: !include-raw: integration-set-variables.sh
348 properties-file: set_variables.env
351 name: integration-detect-variables
352 # Operation: Construct variables including online detection and export using detect_variables.env
353 # This calls integration-set-variables internally.
354 # Required bash variables:
355 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
357 - integration-set-variables
358 - shell: !include-raw: integration-detect-variables.sh
360 properties-file: detect_variables.env
362 # Macro: integration-deply-controller-run-test
363 # Operation: this macro deploys single contoller and runs test
364 # Used by: {project}-csit-1node-* job templates
367 name: integration-deploy-controller-run-test
369 - shell: !include-raw: integration-deploy-controller-run-test.sh
371 # Macro: integration-configure-clustering
372 # Operation: this macro configures the clustering
373 # Used by: {project}-csit-3node-* job templates
376 name: integration-configure-clustering
378 - shell: !include-raw: integration-configure-clustering.sh
380 # Macro: integration-start-cluster-run-test
381 # Operation: this macro starts the 3-node cluster and runs test
382 # Used by: {project}-csit-3node-* job templates
385 name: integration-start-cluster-run-test
387 - shell: !include-raw: integration-start-cluster-run-test.sh
389 # Macro: integration-install-robotframework
390 # Operation: Installs robotframework using pip to a virtualenv
391 # Used by: {project}-csit-* job templates
394 name: integration-install-robotframework
396 - shell: !include-raw: integration-install-robotframework.sh
398 # Macro: integration-cleanup-tmp
399 # Operation: Cleans up temporary files created by build
400 # Used by: {project}-csit-* job templates
403 name: integration-cleanup-tmp
405 - shell: !include-raw: integration-cleanup-tmp.sh
407 # Macro: integration-multipatch-builder
408 # Operation: checks out multiple patches and builds custom distribution
409 # Used by: integration-multipatch-test-* job templates
412 name: integration-multipatch-builder
414 - shell: !include-raw: multipatch-distribution.sh
416 # Macro: integration-cleanup-workspace
417 # Operation: Cleans up files possibly left there by the previous build
418 # Used by: {project}-csit-* job templates
421 name: integration-cleanup-workspace
423 - shell: !include-raw: integration-cleanup-workspace.sh
425 # Macro: integration-rebase-patch
426 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
427 # Used by: integration-patch-distribution-* job template
430 name: integration-rebase-gerrit-patch
432 - shell: !include-raw: integration-rebase-gerrit-patch.sh
435 name: integration-deploy-openstack-run-test
437 - shell: !include-raw: integration-deploy-openstack-run-test.sh
440 name: integration-compare-distributions
441 # Operation: will compare an already created distribtion (probably last
442 # published to nexus) to the current distribution being created.
443 # The comparison is done to find the list of patches that are new to the
444 # current distribution.
445 # Required bash variables:
446 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
448 - shell: !include-raw: integration-compare-distributions.sh
451 name: integration-upload-distribution
452 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
454 # {dist-pom} path to pom file containing the version
455 # Required bash variables:
456 # KARAF_VERSION: 'karaf4' or 'karaf3'.
457 # Use distribution-karaf-version macro to customize.
459 - config-file-provider:
461 - file-id: global-settings
462 variable: GLOBAL_SETTINGS_FILE
463 - file-id: integration-settings
464 variable: SETTINGS_FILE
465 - integration-set-variables
467 properties-content: BUNDLE_POM={dist-pom}
468 - shell: !include-raw-escape: integration-upload-distribution.sh
470 properties-file: integration-upload-distribution.env
476 # Macro: integration-robot
477 # Operation: this macro publishes robot results
478 # Used by: {project}-csit-* job templates
481 name: integration-robot
486 unstable-threshold: '{unstable-if}'
487 pass-threshold: '{pass-if}'
491 name: integration-robot-tempest
496 - tempest_results.html
497 unstable-threshold: '{unstable-if}'
498 pass-threshold: '{pass-if}'
502 name: integration-csit-archive-build
510 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
511 unzip -d ./archives robot-plugin.zip
512 mv *log* *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
513 # TODO: Can the following line ever fail?
514 find . -type f -name *.hprof -print0 | tar -cvf - --null -T - | xz -9 > ./archives/hprof.tar.xz
515 # TODO: Tweak the compression level if better ratio (or speed) is needed.
516 script-only-if-succeeded: 'False'
517 script-only-if-failed: 'False'
518 mark-unstable-if-failed: 'True'
521 name: integration-csit-run-postscript
525 - config-file-provider:
527 - file-id: 'odl-elastic-cloud'
528 target: '${HOME}/.netrc'
531 #The following script runs any configurable postplan stored in test/csit/postplans.
532 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
533 echo "postplan exists!!!"
534 echo "Changing the postplan path..."
535 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
536 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
538 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
539 echo "Executing ${line}..."
544 script-only-if-succeeded: 'False'
545 script-only-if-failed: 'False'
546 mark-unstable-if-failed: 'True'