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 defaults.yaml value is used.
19 default: '{karaf-version}'
20 description: 'karaf3, karaf4, odl, affects ODL deploy scripts'
23 name: integration-bundle-url
27 default: '{bundle-url}'
28 description: 'URL to karaf distribution zip'
31 name: integration-repo-url
36 description: 'URL to feature repo artifact'
39 name: integration-jdk-version
43 default: '{jdkversion}'
44 description: 'Parameter to indicate JAVA Version'
47 name: integration-controller-scope
51 default: '{controller-scope}'
52 description: 'Feature Only or Feature All test'
55 name: integration-controller-features
58 name: CONTROLLERFEATURES
59 default: '{controller-features}'
60 description: 'Features to install in the controller separated by comma'
63 name: integration-controller-debug-map
66 name: CONTROLLERDEBUGMAP
67 default: '{controller-debug-map}'
69 Key:Value map of debugs to enable on the controller separated by spaces.
70 The module should not include org.opendaylight.
71 The levels must be one of: ERROR, WARN, INFO, DEBUG, TRACE.
72 (ex. ovsdb.lib:ERROR netvirt.vpnservice:INFO)
75 name: integration-distribution-stream
80 description: 'Distribution stream string, for suites to know which behavior to expect'
83 name: integration-script-plan
87 default: '{script-plan}'
88 description: 'Script plan we will run before downloading and un-archiving am ODL distribution'
91 name: integration-config-plan
95 default: '{config-plan}'
96 description: 'Config plan we will run after un-archiving and starting an ODL distribution'
99 name: integration-stream-test-plan
103 default: '{stream-test-plan}'
104 description: 'Stream-specific test plan we will run'
107 name: integration-test-plan
111 default: '{test-plan}'
112 description: 'General test plan we will run unless stream-specific one is found'
115 name: integration-test-suites
119 default: '{test-suites}'
121 List of space-separated suites. Useful when running specific suites within a testplan.
122 Do not include ${{WORKSPACE}}/test/csit/suites/ in the values:
123 (ex. openstack/connectivity/l2.robot openstack/clustering/ha_l2.robot
124 openstack/tempest/tempest.robot netvirt/elan/elan.robot).
127 name: integration-test-options
131 default: '{test-options}'
132 description: 'Robot command options'
135 name: integration-distribution-git-url
139 default: '{git-url}/integration/distribution'
140 description: 'Distribution GIT URL (do not modify)'
143 name: integration-patch-refspec
148 description: 'Integration Patch Refspec'
151 name: integration-use-features-boot
154 name: USEFEATURESBOOT
155 default: '{use-features-boot}'
156 description: 'Boolean to toggle whether featuresBoot is appended or ignored'
158 # Macro: integration-gerrit-scm
159 # Operation: this macro downloads a project gerrit
160 # Used by: all csit jobs
163 name: integration-gerrit-scm
166 credentials-id: 'opendaylight-jenkins-ssh'
173 choosing-strategy: 'gerrit'
175 # Macro: integration-distribution-scm
176 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
177 # Used by: integration-patch-test-{stream} job template
180 name: integration-distribution-scm
183 credentials-id: 'opendaylight-jenkins-ssh'
184 basedir: 'distribution'
191 # Macro: integration-trigger-patch-submitted
192 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
193 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
194 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
195 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
197 # gerrit-server-name: name of gerrit server to listen to
198 # project: pattern to match triggering projects
199 # branch: triggering branch name
200 # files: pattern to match triggering filepaths
202 name: integration-trigger-patch-submitted
205 server-name: '{gerrit-server-name}'
207 - patchset-created-event:
209 exclude-trivial-rebase: false
210 exclude-no-code-change: false
211 - draft-published-event
212 - comment-added-contains-event:
213 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
215 gerrit-build-unstable-verified-value: +1
216 gerrit-build-unstable-codereview-value: 0
218 - project-compare-type: ANT
219 project-pattern: '{project}'
221 - branch-compare-type: ANT
222 branch-pattern: '**/{branch}'
227 # Macro: integration-csit-only
228 # Operation: this macro sets a trigger on reverse job list
229 # Used by: csit -only- job templates
232 name: integration-csit-trigger
238 # Macro: integration-openstack-controller-mininet
239 # Operation: this macro will spin the controller and mininet vms
240 # Used by: {project}-csit-* job templates
243 name: integration-openstack-controller-mininet
247 - cloud-name: 'ODLRPC'
248 template-name: '{controller-image}'
249 count: '{controller-vms}'
250 - cloud-name: 'ODLRPC'
251 template-name: '{mininet-image}'
252 count: '{mininet-vms}'
254 # Macro: integration-openstack-controller-devstack
255 # Operation: this macro will spin the controller and devstack vms
256 # Used by: {project}-csit-openstack job templates
258 name: integration-openstack-controller-devstack
262 - cloud-name: 'ODLRPC'
263 template-name: '{controller-image}'
264 count: '{controller-vms}'
265 - cloud-name: 'ODLRPC'
266 template-name: '{openstack-image}'
267 count: '{openstack-vms}'
273 # Macro: integration-infra-stack
274 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
275 # up csit lab using openstack-heat.
276 # Used by: {project}-csit-* job templates
279 name: integration-infra-stack
281 - integration-cleanup-workspace
284 # Setup openstack envirnoment file for use by
285 # the opendaylight-infra-stack macro
286 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
288 vm_0_count: {vm_0_count}
289 vm_0_flavor: {vm_0_flavor}
290 vm_0_image: {vm_0_image}
291 vm_1_count: {vm_1_count}
292 vm_1_flavor: {vm_1_flavor}
293 vm_1_image: {vm_1_image}
295 echo "Contents of opendaylight-infra-environment.yaml ..."
296 cat $WORKSPACE/opendaylight-infra-environment.yaml
297 - opendaylight-infra-stack:
298 stack-template: '{stack-template}'
300 # Macro: integration-infra-stack-3-type
301 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
302 # up csit lab using openstack-heat.
303 # Used by: {project}-csit-* job templates
306 name: integration-infra-stack-3-type
308 - integration-cleanup-workspace
311 # Setup openstack envirnoment file for use by
312 # the opendaylight-infra-stack macro
313 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
315 vm_0_count: {vm_0_count}
316 vm_0_flavor: {vm_0_flavor}
317 vm_0_image: {vm_0_image}
318 vm_1_count: {vm_1_count}
319 vm_1_flavor: {vm_1_flavor}
320 vm_1_image: {vm_1_image}
321 vm_2_count: {vm_2_count}
322 vm_2_flavor: {vm_2_flavor}
323 vm_2_image: {vm_2_image}
325 echo "Contents of opendaylight-infra-environment.yaml ..."
326 cat $WORKSPACE/opendaylight-infra-environment.yaml
327 - opendaylight-infra-stack:
328 stack-template: 'csit-3-instance-type.yaml'
330 # Macro: integration-apex-stack-3-type
331 # Operation: Sets environment and then calls opendaylight-apex-stack to spin
332 # up csit lab using openstack-heat.
333 # Used by: {project}-csit-* apex related job templates
336 name: integration-apex-stack-3-type
338 - integration-cleanup-workspace
341 # Setup openstack envirnoment file for use by
342 # the opendaylight-infra-stack macro
343 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
345 vm_0_count: {vm_0_count}
346 vm_0_flavor: {vm_0_flavor}
347 vm_0_image: {vm_0_image}
348 vm_1_count: {vm_1_count}
349 vm_1_flavor: {vm_1_flavor}
350 vm_1_image: {vm_1_image}
351 vm_2_count: {vm_2_count}
352 vm_2_flavor: {vm_2_flavor}
353 vm_2_image: {vm_2_image}
355 echo "Contents of opendaylight-infra-environment.yaml ..."
356 cat $WORKSPACE/opendaylight-infra-environment.yaml
357 - opendaylight-apex-stack:
358 stack-template: 'csit-apex-3-instance-type.yaml'
360 # Macro: integration-infra-stack-4-type
361 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
362 # up csit lab using openstack-heat.
363 # Used by: {project}-csit-* job templates
366 name: integration-infra-stack-4-type
368 - integration-cleanup-workspace
371 # Setup openstack envirnoment file for use by
372 # the opendaylight-infra-stack macro
373 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
375 vm_0_count: {vm_0_count}
376 vm_0_flavor: {vm_0_flavor}
377 vm_0_image: {vm_0_image}
378 vm_1_count: {vm_1_count}
379 vm_1_flavor: {vm_1_flavor}
380 vm_1_image: {vm_1_image}
381 vm_2_count: {vm_2_count}
382 vm_2_flavor: {vm_2_flavor}
383 vm_2_image: {vm_2_image}
384 vm_3_count: {vm_3_count}
385 vm_3_flavor: {vm_3_flavor}
386 vm_3_image: {vm_3_image}
388 echo "Contents of opendaylight-infra-environment.yaml ..."
389 cat $WORKSPACE/opendaylight-infra-environment.yaml
390 - opendaylight-infra-stack:
391 stack-template: 'csit-4-instance-type.yaml'
393 # Macro: integration-get-apex-addresses
394 # Operation: this macro gets the IP addresses of the dynamic vms from apex snapshots
395 # Used by: {project}-csit-* apex related job templates
398 name: integration-get-apex-addresses
400 - shell: !include-raw: integration-get-apex-addresses.sh
402 # Macro: integration-apex-run-tests
403 # Operation: this macro just runs the robot suites
404 # Used by: {project}-csit-* apex related job templates
407 name: integration-apex-run-tests
409 - shell: !include-raw: integration-apex-run-tests.sh
411 # Macro: integration-get-slave-addresses
412 # Operation: this macro gets the IP addresses of the dynamic vms
413 # Used by: {project}-csit-* job templates
416 name: integration-get-slave-addresses
418 - shell: !include-raw: integration-get-slave-addresses.sh
421 name: integration-set-variables
422 # Operation: Construct variables not requiring online detection and export using set_variables.env
423 # Required bash variables:
424 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
426 - shell: !include-raw: integration-set-variables.sh
428 properties-file: set_variables.env
431 name: integration-detect-variables
432 # Operation: Construct variables including online detection and export using detect_variables.env
433 # This calls integration-set-variables internally.
434 # Required bash variables:
435 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
437 - integration-set-variables
438 - shell: !include-raw: integration-detect-variables.sh
440 properties-file: detect_variables.env
442 # Macro: integration-deply-controller-run-test
443 # Operation: this macro deploys single contoller and runs test
444 # Used by: {project}-csit-1node-* job templates
447 name: integration-deploy-controller-run-test
449 - shell: !include-raw: integration-deploy-controller-run-test.sh
451 # Macro: integration-configure-clustering
452 # Operation: this macro configures the clustering
453 # Used by: {project}-csit-3node-* job templates
456 name: integration-configure-clustering
458 - shell: !include-raw: integration-configure-clustering.sh
460 # Macro: integration-start-cluster-run-test
461 # Operation: this macro starts the 3-node cluster and runs test
462 # Used by: {project}-csit-3node-* job templates
465 name: integration-start-cluster-run-test
467 - shell: !include-raw: integration-start-cluster-run-test.sh
469 # Macro: integration-install-robotframework
470 # Operation: Installs robotframework using pip to a virtualenv
471 # Used by: {project}-csit-* job templates
474 name: integration-install-robotframework
476 - shell: !include-raw: integration-install-robotframework.sh
478 # Macro: integration-cleanup-tmp
479 # Operation: Cleans up temporary files created by build
480 # Used by: {project}-csit-* job templates
483 name: integration-cleanup-tmp
485 - shell: !include-raw: integration-cleanup-tmp.sh
487 # Macro: integration-multipatch-builder
488 # Operation: checks out multiple patches and builds custom distribution
489 # Used by: integration-multipatch-test-* job templates
492 name: integration-multipatch-builder
494 - shell: !include-raw: multipatch-distribution.sh
496 # Macro: integration-cleanup-workspace
497 # Operation: Cleans up files possibly left there by the previous build
498 # Used by: {project}-csit-* job templates
501 name: integration-cleanup-workspace
503 - shell: !include-raw: integration-cleanup-workspace.sh
505 # Macro: integration-rebase-patch
506 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
507 # Used by: integration-patch-distribution-* job template
510 name: integration-rebase-gerrit-patch
512 - shell: !include-raw: integration-rebase-gerrit-patch.sh
514 # Macro: integration-install-common-functions
515 # Operation: Copy the common-functions.sh script to csit nodes
516 # Used by: {project}-csit-* job templates
518 name: integration-install-common-functions
520 - shell: !include-raw:
521 - copy-common-functions.sh
522 - common-functions.sh
525 name: integration-deploy-openstack-run-test
527 - shell: !include-raw:
528 - integration-deploy-openstack-run-test.sh
531 name: integration-apex-image-manager
533 - shell: !include-raw:
534 - ../opendaylight-infra-apex-image-management.sh
537 name: integration-compare-distributions
538 # Operation: will compare an already created distribtion (probably last
539 # published to nexus) to the current distribution being created.
540 # The comparison is done to find the list of patches that are new to the
541 # current distribution.
542 # Required bash variables:
543 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
545 - shell: !include-raw: integration-compare-distributions.sh
548 name: integration-upload-distribution
549 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
551 # {dist-pom} path to pom file containing the version
552 # Required bash variables:
553 # KARAF_VERSION: 'karaf4' or 'karaf3'.
554 # Use distribution-karaf-version macro to customize.
556 - config-file-provider:
558 - file-id: global-settings
559 variable: GLOBAL_SETTINGS_FILE
560 - file-id: integration-settings
561 variable: SETTINGS_FILE
562 - integration-set-variables
564 properties-content: BUNDLE_POM={dist-pom}
565 - shell: !include-raw-escape: integration-upload-distribution.sh
567 properties-file: integration-upload-distribution.env
573 # Macro: integration-robot
574 # Operation: this macro publishes robot results
575 # Used by: {project}-csit-* job templates
578 name: integration-robot
583 unstable-threshold: '{unstable-if}'
584 pass-threshold: '{pass-if}'
588 name: integration-robot-tempest
593 - tempest_results.html
594 unstable-threshold: '{unstable-if}'
595 pass-threshold: '{pass-if}'
599 name: integration-csit-archive-build
613 echo "Archiving csit artifacts"
616 for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
617 NODE_FOLDER="./archives/odl_${i}"
618 mkdir -p ${NODE_FOLDER}
619 mv odl${i}_* ${NODE_FOLDER} || true
620 mv karaf_${i}_*_threads* ${NODE_FOLDER} || true
621 mv *_${i}.png ${NODE_FOLDER} || true
622 mv /tmp/odl${i}_* ${NODE_FOLDER} || true
624 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
625 unzip -d ./archives robot-plugin.zip
626 mv *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
627 # TODO: Can the following line ever fail?
628 find . -type f -name *.hprof -print0 \
629 | tar -cvf - --null -T - | xz --threads=0 > ./archives/hprof.tar.xz
630 # TODO: Tweak the compression level if better ratio (or speed) is needed.
631 mark-unstable-if-failed: true
635 name: integration-csit-run-postscript
647 - config-file-provider:
649 - file-id: 'odl-elastic-cloud'
650 target: '${HOME}/.netrc'
653 #The following script runs any configurable postplan stored in test/csit/postplans.
654 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
655 echo "postplan exists!!!"
656 echo "Changing the postplan path..."
657 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
658 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
660 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
661 echo "Executing ${line}..."
666 mark-unstable-if-failed: true
669 name: integration-csit-collect-netvirt-logs
682 properties-file: 'slave_addresses.txt'
685 source /tmp/common-functions.sh ${BUNDLEFOLDER}
687 mark-unstable-if-failed: true