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 (ex. integration/test/csit/suites/openstack/connectivity/01_l2_tests.robot
99 integration/test/csit/suites/netvirt/ElanService/).
102 name: integration-test-options
106 default: '{test-options}'
107 description: 'Robot command options'
110 name: integration-distribution-git-url
114 default: '{git-url}/integration/distribution'
115 description: 'Distribution GIT URL (do not modify)'
118 name: integration-patch-refspec
123 description: 'Integration Patch Refspec'
125 # Macro: integration-gerrit-scm
126 # Operation: this macro downloads a project gerrit
127 # Used by: all csit jobs
130 name: integration-gerrit-scm
133 credentials-id: 'opendaylight-jenkins-ssh'
140 choosing-strategy: 'gerrit'
142 # Macro: integration-distribution-scm
143 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
144 # Used by: integration-patch-test-{stream} job template
147 name: integration-distribution-scm
150 credentials-id: 'opendaylight-jenkins-ssh'
151 basedir: 'distribution'
158 # Macro: integration-trigger-patch-submitted
159 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
160 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
161 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
162 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
164 # server: name of gerrit server to listen to
165 # project: pattern to match triggering projects
166 # branch: triggering branch name
167 # files: pattern to match triggering filepaths
169 name: integration-trigger-patch-submitted
172 server-name: '{server}'
174 - patchset-created-event:
176 exclude-trivial-rebase: false
177 exclude-no-code-change: false
178 - draft-published-event
179 - comment-added-contains-event:
180 comment-contains-value: recheck
182 gerrit-build-unstable-verified-value: +1
183 gerrit-build-unstable-codereview-value: 0
185 - project-compare-type: ANT
186 project-pattern: '{project}'
188 - branch-compare-type: ANT
189 branch-pattern: '**/{branch}'
194 # Macro: integration-csit-only
195 # Operation: this macro sets a trigger on reverse job list
196 # Used by: csit -only- job templates
199 name: integration-csit-trigger
205 # Macro: integration-openstack-controller-mininet
206 # Operation: this macro will spin the controller and mininet vms
207 # Used by: {project}-csit-* job templates
210 name: integration-openstack-controller-mininet
214 - cloud-name: 'ODLRPC'
215 template-name: '{controller-image}'
216 count: '{controller-vms}'
217 - cloud-name: 'ODLRPC'
218 template-name: '{mininet-image}'
219 count: '{mininet-vms}'
221 # Macro: integration-openstack-controller-devstack
222 # Operation: this macro will spin the controller and devstack vms
223 # Used by: {project}-csit-openstack job templates
225 name: integration-openstack-controller-devstack
229 - cloud-name: 'ODLRPC'
230 template-name: '{controller-image}'
231 count: '{controller-vms}'
232 - cloud-name: 'ODLRPC'
233 template-name: '{openstack-image}'
234 count: '{openstack-vms}'
240 # Macro: integration-infra-stack
241 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
242 # up csit lab using openstack-heat.
243 # Used by: {project}-csit-* job templates
246 name: integration-infra-stack
248 - integration-cleanup-workspace
251 # Setup openstack envirnoment file for use by
252 # the opendaylight-infra-stack macro
253 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
255 vm_0_count: {vm_0_count}
256 vm_0_flavor: {vm_0_flavor}
257 vm_0_image: {vm_0_image}
258 vm_1_count: {vm_1_count}
259 vm_1_flavor: {vm_1_flavor}
260 vm_1_image: {vm_1_image}
262 echo "Contents of opendaylight-infra-environment.yaml ..."
263 cat $WORKSPACE/opendaylight-infra-environment.yaml
264 - opendaylight-infra-stack:
265 stack-template: '{stack-template}'
267 # Macro: integration-infra-stack-3-type
268 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
269 # up csit lab using openstack-heat.
270 # Used by: {project}-csit-* job templates
273 name: integration-infra-stack-3-type
275 - integration-cleanup-workspace
278 # Setup openstack envirnoment file for use by
279 # the opendaylight-infra-stack macro
280 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
282 vm_0_count: {vm_0_count}
283 vm_0_flavor: {vm_0_flavor}
284 vm_0_image: {vm_0_image}
285 vm_1_count: {vm_1_count}
286 vm_1_flavor: {vm_1_flavor}
287 vm_1_image: {vm_1_image}
288 vm_2_count: {vm_2_count}
289 vm_2_flavor: {vm_2_flavor}
290 vm_2_image: {vm_2_image}
292 echo "Contents of opendaylight-infra-environment.yaml ..."
293 cat $WORKSPACE/opendaylight-infra-environment.yaml
294 - opendaylight-infra-stack:
295 stack-template: 'csit-3-instance-type.yaml'
297 # Macro: integration-infra-stack-4-type
298 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
299 # up csit lab using openstack-heat.
300 # Used by: {project}-csit-* job templates
303 name: integration-infra-stack-4-type
305 - integration-cleanup-workspace
308 # Setup openstack envirnoment file for use by
309 # the opendaylight-infra-stack macro
310 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
312 vm_0_count: {vm_0_count}
313 vm_0_flavor: {vm_0_flavor}
314 vm_0_image: {vm_0_image}
315 vm_1_count: {vm_1_count}
316 vm_1_flavor: {vm_1_flavor}
317 vm_1_image: {vm_1_image}
318 vm_2_count: {vm_2_count}
319 vm_2_flavor: {vm_2_flavor}
320 vm_2_image: {vm_2_image}
321 vm_3_count: {vm_3_count}
322 vm_3_flavor: {vm_3_flavor}
323 vm_3_image: {vm_3_image}
325 echo "Contents of opendaylight-infra-environment.yaml ..."
326 cat $WORKSPACE/opendaylight-infra-environment.yaml
327 - opendaylight-infra-stack:
328 stack-template: 'csit-4-instance-type.yaml'
330 # Macro: integration-get-slave-addresses
331 # Operation: this macro gets the IP addresses of the dynamic vms
332 # Used by: {project}-csit-* job templates
335 name: integration-get-slave-addresses
337 - shell: !include-raw: integration-get-slave-addresses.sh
340 name: integration-set-variables
341 # Operation: Construct variables not requiring online detection and export using set_variables.env
342 # Required bash variables:
343 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
345 - shell: !include-raw: integration-set-variables.sh
347 properties-file: set_variables.env
350 name: integration-detect-variables
351 # Operation: Construct variables including online detection and export using detect_variables.env
352 # This calls integration-set-variables internally.
353 # Required bash variables:
354 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
356 - integration-set-variables
357 - shell: !include-raw: integration-detect-variables.sh
359 properties-file: detect_variables.env
362 name: integration-distribution-check
363 # Operation: Locally deploy ODL with all fetures, check it is not broken.
364 # Required bash variables:
365 # KARAF_VERSION: 'karaf4' or 'karaf3'.
366 # Use distribution-karaf-version macro to customize.
368 - integration-set-variables
369 - shell: !include-raw: integration-distribution-check.sh
372 name: distribution-deploy-verify
373 # Operation: Deploy ODL with all fetures and check it is not broken.
374 # Required bash variables:
375 # KARAF_VERSION: 'karaf4' or 'karaf3'.
376 # Use distribution-karaf-version macro to customize.
378 - integration-detect-variables
379 - shell: !include-raw: distribution-deploy-verify.sh
382 name: distribution-deploy-offline
383 # Operation: Deploys ODL on the current system, with no external repo configuration, check it works.
384 # Required bash variables:
385 # KARAF_VERSION: 'karaf4' or 'karaf3'.
386 # Use distribution-karaf-version macro to customize.
388 - integration-detect-variables
389 - shell: !include-raw: distribution-deploy-offline.sh
391 # Macro: integration-deply-controller-run-test
392 # Operation: this macro deploys single contoller and runs test
393 # Used by: {project}-csit-1node-* job templates
396 name: integration-deploy-controller-run-test
398 - shell: !include-raw: integration-deploy-controller-run-test.sh
400 # Macro: integration-configure-clustering
401 # Operation: this macro configures the clustering
402 # Used by: {project}-csit-3node-* job templates
405 name: integration-configure-clustering
407 - shell: !include-raw: integration-configure-clustering.sh
409 # Macro: integration-start-cluster-run-test
410 # Operation: this macro starts the 3-node cluster and runs test
411 # Used by: {project}-csit-3node-* job templates
414 name: integration-start-cluster-run-test
416 - shell: !include-raw: integration-start-cluster-run-test.sh
418 # Macro: integration-install-robotframework
419 # Operation: Installs robotframework using pip to a virtualenv
420 # Used by: {project}-csit-* job templates
423 name: integration-install-robotframework
425 - shell: !include-raw: integration-install-robotframework.sh
427 # Macro: integration-cleanup-tmp
428 # Operation: Cleans up temporary files created by build
429 # Used by: {project}-csit-* job templates
432 name: integration-cleanup-tmp
434 - shell: !include-raw: integration-cleanup-tmp.sh
436 # Macro: integration-multipatch-builder
437 # Operation: checks out multiple patches and builds custom distribution
438 # Used by: integration-multipatch-test-* job templates
441 name: integration-multipatch-builder
443 - shell: !include-raw: multipatch-distribution.sh
445 # Macro: integration-cleanup-workspace
446 # Operation: Cleans up files possibly left there by the previous build
447 # Used by: {project}-csit-* job templates
450 name: integration-cleanup-workspace
452 - shell: !include-raw: integration-cleanup-workspace.sh
454 # Macro: integration-rebase-patch
455 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
456 # Used by: integration-patch-distribution-* job template
459 name: integration-rebase-gerrit-patch
461 - shell: !include-raw: integration-rebase-gerrit-patch.sh
464 name: integration-deploy-openstack-run-test
466 - shell: !include-raw: integration-deploy-openstack-run-test.sh
469 name: integration-compare-distributions
470 # Operation: will compare an already created distribtion (probably last
471 # published to nexus) to the current distribution being created.
472 # The comparison is done to find the list of patches that are new to the
473 # current distribution.
474 # Required bash variables:
475 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
477 - shell: !include-raw: integration-compare-distributions.sh
480 name: integration-upload-distribution
481 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
483 # {dist-pom} path to pom file containing the version
484 # Required bash variables:
485 # KARAF_VERSION: 'karaf4' or 'karaf3'.
486 # Use distribution-karaf-version macro to customize.
488 - config-file-provider:
490 - file-id: global-settings
491 variable: GLOBAL_SETTINGS_FILE
492 - file-id: integration-settings
493 variable: SETTINGS_FILE
494 - integration-set-variables
496 properties-content: BUNDLE_POM={dist-pom}
497 - shell: !include-raw-escape: integration-upload-distribution.sh
499 properties-file: integration-upload-distribution.env
505 # Macro: integration-robot
506 # Operation: this macro publishes robot results
507 # Used by: {project}-csit-* job templates
510 name: integration-robot
515 unstable-threshold: '{unstable-if}'
516 pass-threshold: '{pass-if}'
520 name: integration-robot-tempest
525 - tempest_results.html
526 unstable-threshold: '{unstable-if}'
527 pass-threshold: '{pass-if}'
531 name: integration-csit-archive-build
539 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
540 unzip -d ./archives robot-plugin.zip
541 mv *log* *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
542 # TODO: Can the following line ever fail?
543 find . -type f -name *.hprof -print0 | tar -cvf - --null -T - | xz -9 > ./archives/hprof.tar.xz
544 # TODO: Tweak the compression level if better ratio (or speed) is needed.
545 script-only-if-succeeded: 'False'
546 script-only-if-failed: 'False'
547 mark-unstable-if-failed: 'True'
550 name: integration-csit-run-postscript
554 - config-file-provider:
556 - file-id: 'odl-elastic-cloud'
557 target: '${HOME}/.netrc'
560 #The following script runs any configurable postplan stored in test/csit/postplans.
561 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
562 echo "postplan exists!!!"
563 echo "Changing the postplan path..."
564 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
565 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
567 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
568 echo "Executing ${line}..."
573 script-only-if-succeeded: 'False'
574 script-only-if-failed: 'False'
575 mark-unstable-if-failed: 'True'