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}'
22 - integration-controller-scope:
23 controller-scope: '{controller-scope}'
24 - integration-controller-debug-map:
25 controller-debug-map: '{debug-map}'
26 - integration-controller-features:
27 controller-features: '{install-features}'
28 - integration-use-features-boot:
29 use-features-boot: '{use-features-boot}'
33 name: integration-distribution-branch
38 description: 'Distribution GIT branch'
41 name: distribution-karaf-version
43 # karaf-version: Provide, otherwise defaults.yaml value is used.
47 default: '{karaf-version}'
48 description: 'karaf3, karaf4, odl, affects ODL deploy scripts'
51 name: integration-bundle-url
55 default: '{bundle-url}'
56 description: 'URL to karaf distribution zip'
59 name: integration-repo-url
64 description: 'URL to feature repo artifact'
67 name: integration-jdk-version
71 default: '{jdkversion}'
72 description: 'Parameter to indicate JAVA Version'
75 name: integration-controller-scope
79 default: '{controller-scope}'
80 description: 'Feature Only or Feature All test'
83 name: integration-controller-features
86 name: CONTROLLERFEATURES
87 default: '{controller-features}'
88 description: 'Features to install in the controller separated by comma'
91 name: integration-controller-debug-map
94 name: CONTROLLERDEBUGMAP
95 default: '{controller-debug-map}'
97 Key:Value map of debugs to enable on the controller separated by spaces.
98 The module should not include org.opendaylight.
99 The levels must be one of: ERROR, WARN, INFO, DEBUG, TRACE.
100 (ex. ovsdb.lib:ERROR netvirt.vpnservice:INFO)
103 name: integration-distribution-stream
108 description: 'Distribution stream string, for suites to know which behavior to expect'
111 name: integration-script-plan
115 default: '{script-plan}'
116 description: 'Script plan we will run before downloading and un-archiving am ODL distribution'
119 name: integration-config-plan
123 default: '{config-plan}'
124 description: 'Config plan we will run after un-archiving and starting an ODL distribution'
127 name: integration-stream-test-plan
131 default: '{stream-test-plan}'
132 description: 'Stream-specific test plan we will run'
135 name: integration-test-plan
139 default: '{test-plan}'
140 description: 'General test plan we will run unless stream-specific one is found'
143 name: integration-test-suites
147 default: '{test-suites}'
149 List of space-separated suites. Useful when running specific suites within a testplan.
150 Do not include ${{WORKSPACE}}/test/csit/suites/ in the values:
151 (ex. openstack/connectivity/l2.robot openstack/clustering/ha_l2.robot
152 openstack/tempest/tempest.robot netvirt/elan/elan.robot).
155 name: integration-test-options
159 default: '{test-options}'
160 description: 'Robot command options'
163 name: integration-distribution-git-url
167 default: '{git-url}/integration/distribution'
168 description: 'Distribution GIT URL (do not modify)'
171 name: integration-patch-refspec
176 description: 'Integration Patch Refspec'
179 name: integration-use-features-boot
182 name: USEFEATURESBOOT
183 default: '{use-features-boot}'
184 description: 'Boolean to toggle whether featuresBoot is appended or ignored'
186 # Macro: integration-gerrit-scm
187 # Operation: this macro downloads a project gerrit
188 # Used by: all csit jobs
191 name: integration-gerrit-scm
194 credentials-id: 'opendaylight-jenkins-ssh'
201 choosing-strategy: 'gerrit'
203 # Macro: integration-distribution-scm
204 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
205 # Used by: integration-patch-test-{stream} job template
208 name: integration-distribution-scm
211 credentials-id: 'opendaylight-jenkins-ssh'
212 basedir: 'distribution'
219 # Macro: integration-trigger-patch-submitted
220 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
221 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
222 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
223 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
225 # gerrit-server-name: name of gerrit server to listen to
226 # project: pattern to match triggering projects
227 # branch: triggering branch name
228 # files: pattern to match triggering filepaths
230 name: integration-trigger-patch-submitted
233 server-name: '{gerrit-server-name}'
235 - patchset-created-event:
237 exclude-trivial-rebase: false
238 exclude-no-code-change: false
239 - draft-published-event
240 - comment-added-contains-event:
241 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
243 gerrit-build-unstable-verified-value: +1
244 gerrit-build-unstable-codereview-value: 0
246 - project-compare-type: ANT
247 project-pattern: '{project}'
249 - branch-compare-type: ANT
250 branch-pattern: '**/{branch}'
255 # Macro: integration-csit-only
256 # Operation: this macro sets a trigger on reverse job list
257 # Used by: csit -only- job templates
260 name: integration-csit-trigger
266 # Macro: integration-openstack-controller-mininet
267 # Operation: this macro will spin the controller and mininet vms
268 # Used by: {project}-csit-* job templates
271 name: integration-openstack-controller-mininet
275 - cloud-name: 'ODLRPC'
276 template-name: '{controller-image}'
277 count: '{controller-vms}'
278 - cloud-name: 'ODLRPC'
279 template-name: '{mininet-image}'
280 count: '{mininet-vms}'
282 # Macro: integration-openstack-controller-devstack
283 # Operation: this macro will spin the controller and devstack vms
284 # Used by: {project}-csit-openstack job templates
286 name: integration-openstack-controller-devstack
290 - cloud-name: 'ODLRPC'
291 template-name: '{controller-image}'
292 count: '{controller-vms}'
293 - cloud-name: 'ODLRPC'
294 template-name: '{openstack-image}'
295 count: '{openstack-vms}'
301 # Macro: integration-infra-stack
302 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
303 # up csit lab using openstack-heat.
304 # Used by: {project}-csit-* job templates
307 name: integration-infra-stack
309 - integration-cleanup-workspace
312 # Setup openstack envirnoment file for use by
313 # the opendaylight-infra-stack macro
314 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
316 vm_0_count: {vm_0_count}
317 vm_0_flavor: {vm_0_flavor}
318 vm_0_image: {vm_0_image}
319 vm_1_count: {vm_1_count}
320 vm_1_flavor: {vm_1_flavor}
321 vm_1_image: {vm_1_image}
323 echo "Contents of opendaylight-infra-environment.yaml ..."
324 cat $WORKSPACE/opendaylight-infra-environment.yaml
325 - opendaylight-infra-stack:
326 stack-template: '{stack-template}'
328 # Macro: integration-infra-stack-3-type
329 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
330 # up csit lab using openstack-heat.
331 # Used by: {project}-csit-* job templates
334 name: integration-infra-stack-3-type
336 - integration-cleanup-workspace
339 # Setup openstack envirnoment file for use by
340 # the opendaylight-infra-stack macro
341 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
343 vm_0_count: {vm_0_count}
344 vm_0_flavor: {vm_0_flavor}
345 vm_0_image: {vm_0_image}
346 vm_1_count: {vm_1_count}
347 vm_1_flavor: {vm_1_flavor}
348 vm_1_image: {vm_1_image}
349 vm_2_count: {vm_2_count}
350 vm_2_flavor: {vm_2_flavor}
351 vm_2_image: {vm_2_image}
353 echo "Contents of opendaylight-infra-environment.yaml ..."
354 cat $WORKSPACE/opendaylight-infra-environment.yaml
355 - opendaylight-infra-stack:
356 stack-template: 'csit-3-instance-type.yaml'
358 # Macro: integration-apex-stack-3-type
359 # Operation: Sets environment and then calls opendaylight-apex-stack to spin
360 # up csit lab using openstack-heat.
361 # Used by: {project}-csit-* apex related job templates
364 name: integration-apex-stack-3-type
366 - integration-cleanup-workspace
369 # Setup openstack envirnoment file for use by
370 # the opendaylight-infra-stack macro
371 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
373 vm_0_count: {vm_0_count}
374 vm_0_flavor: {vm_0_flavor}
375 vm_0_image: {vm_0_image}
376 vm_1_count: {vm_1_count}
377 vm_1_flavor: {vm_1_flavor}
378 vm_1_image: {vm_1_image}
379 vm_2_count: {vm_2_count}
380 vm_2_flavor: {vm_2_flavor}
381 vm_2_image: {vm_2_image}
383 echo "Contents of opendaylight-infra-environment.yaml ..."
384 cat $WORKSPACE/opendaylight-infra-environment.yaml
385 - opendaylight-apex-stack:
386 stack-template: 'csit-apex-3-instance-type.yaml'
388 # Macro: integration-infra-stack-4-type
389 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
390 # up csit lab using openstack-heat.
391 # Used by: {project}-csit-* job templates
394 name: integration-infra-stack-4-type
396 - integration-cleanup-workspace
399 # Setup openstack envirnoment file for use by
400 # the opendaylight-infra-stack macro
401 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
403 vm_0_count: {vm_0_count}
404 vm_0_flavor: {vm_0_flavor}
405 vm_0_image: {vm_0_image}
406 vm_1_count: {vm_1_count}
407 vm_1_flavor: {vm_1_flavor}
408 vm_1_image: {vm_1_image}
409 vm_2_count: {vm_2_count}
410 vm_2_flavor: {vm_2_flavor}
411 vm_2_image: {vm_2_image}
412 vm_3_count: {vm_3_count}
413 vm_3_flavor: {vm_3_flavor}
414 vm_3_image: {vm_3_image}
416 echo "Contents of opendaylight-infra-environment.yaml ..."
417 cat $WORKSPACE/opendaylight-infra-environment.yaml
418 - opendaylight-infra-stack:
419 stack-template: 'csit-4-instance-type.yaml'
421 # Macro: integration-get-apex-addresses
422 # Operation: this macro gets the IP addresses of the dynamic vms from apex snapshots
423 # Used by: {project}-csit-* apex related job templates
426 name: integration-get-apex-addresses
428 - shell: !include-raw: integration-get-apex-addresses.sh
430 # Macro: integration-apex-run-tests
431 # Operation: this macro just runs the robot suites
432 # Used by: {project}-csit-* apex related job templates
435 name: integration-apex-run-tests
437 - shell: !include-raw: integration-apex-run-tests.sh
439 # Macro: integration-get-slave-addresses
440 # Operation: this macro gets the IP addresses of the dynamic vms
441 # Used by: {project}-csit-* job templates
444 name: integration-get-slave-addresses
446 - shell: !include-raw: integration-get-slave-addresses.sh
449 name: integration-set-variables
450 # Operation: Construct variables not requiring online detection and export using set_variables.env
451 # Required bash variables:
452 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
454 - shell: !include-raw: integration-set-variables.sh
456 properties-file: set_variables.env
459 name: integration-detect-variables
460 # Operation: Construct variables including online detection and export using detect_variables.env
461 # This calls integration-set-variables internally.
462 # Required bash variables:
463 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
465 - integration-set-variables
466 - shell: !include-raw: integration-detect-variables.sh
468 properties-file: detect_variables.env
470 # Macro: integration-deply-controller-run-test
471 # Operation: this macro deploys single contoller and runs test
472 # Used by: {project}-csit-1node-* job templates
475 name: integration-deploy-controller-run-test
477 - shell: !include-raw: integration-deploy-controller-run-test.sh
479 # Macro: integration-configure-clustering
480 # Operation: this macro configures the clustering
481 # Used by: {project}-csit-3node-* job templates
484 name: integration-configure-clustering
486 - shell: !include-raw: integration-configure-clustering.sh
488 # Macro: integration-start-cluster-run-test
489 # Operation: this macro starts the 3-node cluster and runs test
490 # Used by: {project}-csit-3node-* job templates
493 name: integration-start-cluster-run-test
495 - shell: !include-raw: integration-start-cluster-run-test.sh
497 # Macro: integration-install-robotframework
498 # Operation: Installs robotframework using pip to a virtualenv
499 # Used by: {project}-csit-* job templates
502 name: integration-install-robotframework
504 - shell: !include-raw: integration-install-robotframework.sh
506 # Macro: integration-cleanup-tmp
507 # Operation: Cleans up temporary files created by build
508 # Used by: {project}-csit-* job templates
511 name: integration-cleanup-tmp
513 - shell: !include-raw: integration-cleanup-tmp.sh
515 # Macro: integration-multipatch-builder
516 # Operation: checks out multiple patches and builds custom distribution
517 # Used by: integration-multipatch-test-* job templates
520 name: integration-multipatch-builder
522 - shell: !include-raw: multipatch-distribution.sh
524 # Macro: integration-cleanup-workspace
525 # Operation: Cleans up files possibly left there by the previous build
526 # Used by: {project}-csit-* job templates
529 name: integration-cleanup-workspace
531 - shell: !include-raw: integration-cleanup-workspace.sh
533 # Macro: integration-rebase-patch
534 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
535 # Used by: integration-patch-distribution-* job template
538 name: integration-rebase-gerrit-patch
540 - shell: !include-raw: integration-rebase-gerrit-patch.sh
542 # Macro: integration-install-common-functions
543 # Operation: Copy the common-functions.sh script to csit nodes
544 # Used by: {project}-csit-* job templates
546 name: integration-install-common-functions
548 - shell: !include-raw:
549 - copy-common-functions.sh
550 - common-functions.sh
553 name: integration-deploy-openstack-run-test
555 - shell: !include-raw:
556 - integration-deploy-openstack-run-test.sh
559 name: integration-apex-image-manager
561 - shell: !include-raw:
562 - ../opendaylight-infra-apex-image-management.sh
565 name: integration-compare-distributions
566 # Operation: will compare an already created distribtion (probably last
567 # published to nexus) to the current distribution being created.
568 # The comparison is done to find the list of patches that are new to the
569 # current distribution.
570 # Required bash variables:
571 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
573 - shell: !include-raw: integration-compare-distributions.sh
576 name: integration-upload-distribution
577 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
579 # {dist-pom} path to pom file containing the version
580 # Required bash variables:
581 # KARAF_VERSION: 'karaf4' or 'karaf3'.
582 # Use distribution-karaf-version macro to customize.
584 - config-file-provider:
586 - file-id: global-settings
587 variable: GLOBAL_SETTINGS_FILE
588 - file-id: integration-settings
589 variable: SETTINGS_FILE
590 - integration-set-variables
592 properties-content: BUNDLE_POM={dist-pom}
593 - shell: !include-raw-escape: integration-upload-distribution.sh
595 properties-file: integration-upload-distribution.env
602 name: integration-csit-publish
606 other-files: '{obj:robot_other_files}'
607 unstable-threshold: '{robot-unstable-threshold}'
608 pass-threshold: '{robot-pass-threshold}'
610 - integration-csit-archive-build
611 - integration-csit-run-postscript
612 - releng-openstack-stack-delete
615 name: integration-csit-archive-build
629 echo "Archiving csit artifacts"
632 for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
633 NODE_FOLDER="./archives/odl_${i}"
634 mkdir -p ${NODE_FOLDER}
635 mv odl${i}_* ${NODE_FOLDER} || true
636 mv karaf_${i}_*_threads* ${NODE_FOLDER} || true
637 mv *_${i}.png ${NODE_FOLDER} || true
638 mv /tmp/odl${i}_* ${NODE_FOLDER} || true
640 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
641 unzip -d ./archives robot-plugin.zip
642 mv *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
643 # TODO: Can the following line ever fail?
644 find . -type f -name *.hprof -print0 \
645 | tar -cvf - --null -T - | xz --threads=0 > ./archives/hprof.tar.xz
646 # TODO: Tweak the compression level if better ratio (or speed) is needed.
647 mark-unstable-if-failed: true
651 name: integration-csit-run-postscript
663 - config-file-provider:
665 - file-id: 'odl-elastic-cloud'
666 target: '${HOME}/.netrc'
669 #The following script runs any configurable postplan stored in test/csit/postplans.
670 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
671 echo "postplan exists!!!"
672 echo "Changing the postplan path..."
673 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
674 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
676 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
677 echo "Executing ${line}..."
682 mark-unstable-if-failed: true
685 name: integration-csit-collect-netvirt-logs
698 properties-file: 'slave_addresses.txt'
701 source /tmp/common-functions.sh ${BUNDLEFOLDER}
703 mark-unstable-if-failed: true