2 # TODO: Make all bash constants more readable.
3 # e.g.: DISTRIBUTION_BRANCH instead of DISTROBRANCH.
6 name: integration-csit-parameters
8 - opendaylight-infra-parameters:
10 project: 'integration/test'
12 refspec: 'refs/heads/{branch}'
13 artifacts: '{archive-artifacts}'
15 - integration-bundle-url:
16 bundle-url: '{bundle-url}'
17 - integration-repo-url:
18 repo-url: '{repo-url}'
19 - integration-test-options:
20 test-options: '{robot-options}'
21 - integration-controller-parameters:
22 controller-debug-map: '{debug-map}'
23 controller-features: '{install-features}'
24 controller-scope: '{controller-scope}'
25 controller-use-features-boot: '{use-features-boot}'
28 name: integration-controller-parameters
32 default: '{controller-scope}'
33 description: 'Feature Only or Feature All test'
36 name: CONTROLLERFEATURES
37 default: '{controller-features}'
38 description: 'Features to install in the controller separated by comma'
41 name: CONTROLLERDEBUGMAP
42 default: '{controller-debug-map}'
44 Key:Value map of debugs to enable on the controller separated by spaces.
45 The module should not include org.opendaylight.
46 The levels must be one of: ERROR, WARN, INFO, DEBUG, TRACE.
47 (ex. ovsdb.lib:ERROR netvirt.vpnservice:INFO)
51 default: '{controller-use-features-boot}'
52 description: 'Boolean to toggle whether featuresBoot is appended or ignored'
56 name: integration-distribution-branch
61 description: 'Distribution GIT branch'
64 name: distribution-karaf-version
66 # karaf-version: Provide, otherwise defaults.yaml value is used.
70 default: '{karaf-version}'
71 description: 'karaf3, karaf4, odl, affects ODL deploy scripts'
74 name: integration-bundle-url
78 default: '{bundle-url}'
79 description: 'URL to karaf distribution zip'
82 name: integration-repo-url
87 description: 'URL to feature repo artifact'
90 name: integration-jdk-version
94 default: '{jdkversion}'
95 description: 'Parameter to indicate JAVA Version'
98 name: integration-distribution-stream
103 description: 'Distribution stream string, for suites to know which behavior to expect'
106 name: integration-script-plan
110 default: '{script-plan}'
111 description: 'Script plan we will run before downloading and un-archiving am ODL distribution'
114 name: integration-config-plan
118 default: '{config-plan}'
119 description: 'Config plan we will run after un-archiving and starting an ODL distribution'
122 name: integration-stream-test-plan
126 default: '{stream-test-plan}'
127 description: 'Stream-specific test plan we will run'
130 name: integration-test-plan
134 default: '{test-plan}'
135 description: 'General test plan we will run unless stream-specific one is found'
138 name: integration-test-suites
142 default: '{test-suites}'
144 List of space-separated suites. Useful when running specific suites within a testplan.
145 Do not include ${{WORKSPACE}}/test/csit/suites/ in the values:
146 (ex. openstack/connectivity/l2.robot openstack/clustering/ha_l2.robot
147 openstack/tempest/tempest.robot netvirt/elan/elan.robot).
150 name: integration-test-options
154 default: '{test-options}'
155 description: 'Robot command options'
158 name: integration-distribution-git-url
162 default: '{git-url}/integration/distribution'
163 description: 'Distribution GIT URL (do not modify)'
166 name: integration-patch-refspec
171 description: 'Integration Patch Refspec'
173 # Macro: integration-gerrit-scm
174 # Operation: this macro downloads a project gerrit
175 # Used by: all csit jobs
178 name: integration-gerrit-scm
181 credentials-id: 'opendaylight-jenkins-ssh'
188 choosing-strategy: 'gerrit'
190 # Macro: integration-distribution-scm
191 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
192 # Used by: integration-patch-test-{stream} job template
195 name: integration-distribution-scm
198 credentials-id: 'opendaylight-jenkins-ssh'
199 basedir: 'distribution'
206 # Macro: integration-trigger-patch-submitted
207 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
208 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
209 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
210 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
212 # gerrit-server-name: name of gerrit server to listen to
213 # project: pattern to match triggering projects
214 # branch: triggering branch name
215 # files: pattern to match triggering filepaths
217 name: integration-trigger-patch-submitted
220 server-name: '{gerrit-server-name}'
222 - patchset-created-event:
224 exclude-trivial-rebase: false
225 exclude-no-code-change: false
226 - draft-published-event
227 - comment-added-contains-event:
228 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
230 gerrit-build-unstable-verified-value: +1
231 gerrit-build-unstable-codereview-value: 0
233 - project-compare-type: ANT
234 project-pattern: '{project}'
236 - branch-compare-type: ANT
237 branch-pattern: '**/{branch}'
242 # Macro: integration-csit-only
243 # Operation: this macro sets a trigger on reverse job list
244 # Used by: csit -only- job templates
247 name: integration-csit-trigger
253 # Macro: integration-openstack-controller-mininet
254 # Operation: this macro will spin the controller and mininet vms
255 # Used by: {project}-csit-* job templates
258 name: integration-openstack-controller-mininet
262 - cloud-name: 'ODLRPC'
263 template-name: '{controller-image}'
264 count: '{controller-vms}'
265 - cloud-name: 'ODLRPC'
266 template-name: '{mininet-image}'
267 count: '{mininet-vms}'
269 # Macro: integration-openstack-controller-devstack
270 # Operation: this macro will spin the controller and devstack vms
271 # Used by: {project}-csit-openstack job templates
273 name: integration-openstack-controller-devstack
277 - cloud-name: 'ODLRPC'
278 template-name: '{controller-image}'
279 count: '{controller-vms}'
280 - cloud-name: 'ODLRPC'
281 template-name: '{openstack-image}'
282 count: '{openstack-vms}'
288 # Macro: integration-infra-stack
289 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
290 # up csit lab using openstack-heat.
291 # Used by: {project}-csit-* job templates
294 name: integration-infra-stack
296 - integration-cleanup-workspace
299 # Setup openstack envirnoment file for use by
300 # the opendaylight-infra-stack macro
301 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
303 vm_0_count: {vm_0_count}
304 vm_0_flavor: {vm_0_flavor}
305 vm_0_image: {vm_0_image}
306 vm_1_count: {vm_1_count}
307 vm_1_flavor: {vm_1_flavor}
308 vm_1_image: {vm_1_image}
310 echo "Contents of opendaylight-infra-environment.yaml ..."
311 cat $WORKSPACE/opendaylight-infra-environment.yaml
312 - opendaylight-infra-stack:
313 stack-template: '{stack-template}'
315 # Macro: integration-infra-stack-3-type
316 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
317 # up csit lab using openstack-heat.
318 # Used by: {project}-csit-* job templates
321 name: integration-infra-stack-3-type
323 - integration-cleanup-workspace
326 # Setup openstack envirnoment file for use by
327 # the opendaylight-infra-stack macro
328 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
330 vm_0_count: {vm_0_count}
331 vm_0_flavor: {vm_0_flavor}
332 vm_0_image: {vm_0_image}
333 vm_1_count: {vm_1_count}
334 vm_1_flavor: {vm_1_flavor}
335 vm_1_image: {vm_1_image}
336 vm_2_count: {vm_2_count}
337 vm_2_flavor: {vm_2_flavor}
338 vm_2_image: {vm_2_image}
340 echo "Contents of opendaylight-infra-environment.yaml ..."
341 cat $WORKSPACE/opendaylight-infra-environment.yaml
342 - opendaylight-infra-stack:
343 stack-template: 'csit-3-instance-type.yaml'
345 # Macro: integration-apex-stack-3-type
346 # Operation: Sets environment and then calls opendaylight-apex-stack to spin
347 # up csit lab using openstack-heat.
348 # Used by: {project}-csit-* apex related job templates
351 name: integration-apex-stack-3-type
353 - integration-cleanup-workspace
356 # Setup openstack envirnoment file for use by
357 # the opendaylight-infra-stack macro
358 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
360 vm_0_count: {vm_0_count}
361 vm_0_flavor: {vm_0_flavor}
362 vm_0_image: {vm_0_image}
363 vm_1_count: {vm_1_count}
364 vm_1_flavor: {vm_1_flavor}
365 vm_1_image: {vm_1_image}
366 vm_2_count: {vm_2_count}
367 vm_2_flavor: {vm_2_flavor}
368 vm_2_image: {vm_2_image}
370 echo "Contents of opendaylight-infra-environment.yaml ..."
371 cat $WORKSPACE/opendaylight-infra-environment.yaml
372 - opendaylight-apex-stack:
373 stack-template: 'csit-apex-3-instance-type.yaml'
375 # Macro: integration-infra-stack-4-type
376 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
377 # up csit lab using openstack-heat.
378 # Used by: {project}-csit-* job templates
381 name: integration-infra-stack-4-type
383 - integration-cleanup-workspace
386 # Setup openstack envirnoment file for use by
387 # the opendaylight-infra-stack macro
388 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
390 vm_0_count: {vm_0_count}
391 vm_0_flavor: {vm_0_flavor}
392 vm_0_image: {vm_0_image}
393 vm_1_count: {vm_1_count}
394 vm_1_flavor: {vm_1_flavor}
395 vm_1_image: {vm_1_image}
396 vm_2_count: {vm_2_count}
397 vm_2_flavor: {vm_2_flavor}
398 vm_2_image: {vm_2_image}
399 vm_3_count: {vm_3_count}
400 vm_3_flavor: {vm_3_flavor}
401 vm_3_image: {vm_3_image}
403 echo "Contents of opendaylight-infra-environment.yaml ..."
404 cat $WORKSPACE/opendaylight-infra-environment.yaml
405 - opendaylight-infra-stack:
406 stack-template: 'csit-4-instance-type.yaml'
408 # Macro: integration-get-apex-addresses
409 # Operation: this macro gets the IP addresses of the dynamic vms from apex snapshots
410 # Used by: {project}-csit-* apex related job templates
413 name: integration-get-apex-addresses
415 - shell: !include-raw: integration-get-apex-addresses.sh
417 # Macro: integration-apex-run-tests
418 # Operation: this macro just runs the robot suites
419 # Used by: {project}-csit-* apex related job templates
422 name: integration-apex-run-tests
424 - shell: !include-raw: integration-apex-run-tests.sh
426 # Macro: integration-get-slave-addresses
427 # Operation: this macro gets the IP addresses of the dynamic vms
428 # Used by: {project}-csit-* job templates
431 name: integration-get-slave-addresses
433 - shell: !include-raw: integration-get-slave-addresses.sh
436 name: integration-set-variables
437 # Operation: Construct variables not requiring online detection and export using set_variables.env
438 # Required bash variables:
439 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
441 - shell: !include-raw: integration-set-variables.sh
443 properties-file: set_variables.env
446 name: integration-detect-variables
447 # Operation: Construct variables including online detection and export using detect_variables.env
448 # This calls integration-set-variables internally.
449 # Required bash variables:
450 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
452 - integration-set-variables
453 - shell: !include-raw: integration-detect-variables.sh
455 properties-file: detect_variables.env
457 # Macro: integration-deply-controller-run-test
458 # Operation: this macro deploys single contoller and runs test
459 # Used by: {project}-csit-1node-* job templates
462 name: integration-deploy-controller-run-test
464 - shell: !include-raw: integration-deploy-controller-run-test.sh
466 # Macro: integration-configure-clustering
467 # Operation: this macro configures the clustering
468 # Used by: {project}-csit-3node-* job templates
471 name: integration-configure-clustering
473 - shell: !include-raw: integration-configure-clustering.sh
475 # Macro: integration-start-cluster-run-test
476 # Operation: this macro starts the 3-node cluster and runs test
477 # Used by: {project}-csit-3node-* job templates
480 name: integration-start-cluster-run-test
482 - shell: !include-raw: integration-start-cluster-run-test.sh
484 # Macro: integration-install-robotframework
485 # Operation: Installs robotframework using pip to a virtualenv
486 # Used by: {project}-csit-* job templates
489 name: integration-install-robotframework
491 - shell: !include-raw: integration-install-robotframework.sh
493 # Macro: integration-cleanup-tmp
494 # Operation: Cleans up temporary files created by build
495 # Used by: {project}-csit-* job templates
498 name: integration-cleanup-tmp
500 - shell: !include-raw: integration-cleanup-tmp.sh
502 # Macro: integration-multipatch-builder
503 # Operation: checks out multiple patches and builds custom distribution
504 # Used by: integration-multipatch-test-* job templates
507 name: integration-multipatch-builder
509 - shell: !include-raw: multipatch-distribution.sh
511 # Macro: integration-cleanup-workspace
512 # Operation: Cleans up files possibly left there by the previous build
513 # Used by: {project}-csit-* job templates
516 name: integration-cleanup-workspace
518 - shell: !include-raw: integration-cleanup-workspace.sh
520 # Macro: integration-rebase-patch
521 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
522 # Used by: integration-patch-distribution-* job template
525 name: integration-rebase-gerrit-patch
527 - shell: !include-raw: integration-rebase-gerrit-patch.sh
529 # Macro: integration-install-common-functions
530 # Operation: Copy the common-functions.sh script to csit nodes
531 # Used by: {project}-csit-* job templates
533 name: integration-install-common-functions
535 - shell: !include-raw:
536 - copy-common-functions.sh
537 - common-functions.sh
540 name: integration-deploy-openstack-run-test
542 - shell: !include-raw:
543 - integration-deploy-openstack-run-test.sh
546 name: integration-apex-image-manager
548 - shell: !include-raw:
549 - ../opendaylight-infra-apex-image-management.sh
552 name: integration-compare-distributions
553 # Operation: will compare an already created distribtion (probably last
554 # published to nexus) to the current distribution being created.
555 # The comparison is done to find the list of patches that are new to the
556 # current distribution.
557 # Required bash variables:
558 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
560 - shell: !include-raw: integration-compare-distributions.sh
563 name: integration-upload-distribution
564 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
566 # {dist-pom} path to pom file containing the version
567 # Required bash variables:
568 # KARAF_VERSION: 'karaf4' or 'karaf3'.
569 # Use distribution-karaf-version macro to customize.
571 - config-file-provider:
573 - file-id: global-settings
574 variable: GLOBAL_SETTINGS_FILE
575 - file-id: integration-settings
576 variable: SETTINGS_FILE
577 - integration-set-variables
579 properties-content: BUNDLE_POM={dist-pom}
580 - shell: !include-raw-escape: integration-upload-distribution.sh
582 properties-file: integration-upload-distribution.env
589 name: integration-csit-publish
593 other-files: '{obj:robot_other_files}'
594 unstable-threshold: '{robot-unstable-threshold}'
595 pass-threshold: '{robot-pass-threshold}'
597 - integration-csit-archive-build
598 - integration-csit-run-postscript
599 - releng-openstack-stack-delete
602 name: integration-csit-archive-build
616 echo "Archiving csit artifacts"
619 for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
620 NODE_FOLDER="./archives/odl_${i}"
621 mkdir -p ${NODE_FOLDER}
622 mv odl${i}_* ${NODE_FOLDER} || true
623 mv karaf_${i}_*_threads* ${NODE_FOLDER} || true
624 mv *_${i}.png ${NODE_FOLDER} || true
625 mv /tmp/odl${i}_* ${NODE_FOLDER} || true
627 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
628 unzip -d ./archives robot-plugin.zip
629 mv *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
630 # TODO: Can the following line ever fail?
631 find . -type f -name *.hprof -print0 \
632 | tar -cvf - --null -T - | xz --threads=0 > ./archives/hprof.tar.xz
633 # TODO: Tweak the compression level if better ratio (or speed) is needed.
634 mark-unstable-if-failed: true
638 name: integration-csit-run-postscript
650 - config-file-provider:
652 - file-id: 'odl-elastic-cloud'
653 target: '${HOME}/.netrc'
656 #The following script runs any configurable postplan stored in test/csit/postplans.
657 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
658 echo "postplan exists!!!"
659 echo "Changing the postplan path..."
660 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
661 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
663 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
664 echo "Executing ${line}..."
669 mark-unstable-if-failed: true
672 name: integration-csit-collect-netvirt-logs
685 properties-file: 'slave_addresses.txt'
688 source /tmp/common-functions.sh ${BUNDLEFOLDER}
690 mark-unstable-if-failed: true