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'
139 default: '{gate-job}'
140 description: 'Flag to indicate if job is for gating or not'
143 name: integration-distribution-git-url
147 default: '{git-url}/integration/distribution'
148 description: 'Distribution GIT URL (do not modify)'
151 name: integration-patch-refspec
156 description: 'Integration Patch Refspec'
159 name: integration-use-features-boot
162 name: USEFEATURESBOOT
163 default: '{use-features-boot}'
164 description: 'Boolean to toggle whether featuresBoot is appended or ignored'
166 # Macro: integration-gerrit-scm
167 # Operation: this macro downloads a project gerrit
168 # Used by: all csit jobs
171 name: integration-gerrit-scm
174 credentials-id: 'opendaylight-jenkins-ssh'
181 choosing-strategy: 'gerrit'
183 # Macro: integration-distribution-scm
184 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
185 # Used by: integration-patch-test-{stream} job template
188 name: integration-distribution-scm
191 credentials-id: 'opendaylight-jenkins-ssh'
192 basedir: 'distribution'
199 # Macro: integration-trigger-patch-submitted
200 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
201 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
202 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
203 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
205 # gerrit-server-name: name of gerrit server to listen to
206 # project: pattern to match triggering projects
207 # branch: triggering branch name
208 # files: pattern to match triggering filepaths
210 name: integration-trigger-patch-submitted
213 server-name: '{gerrit-server-name}'
215 - patchset-created-event:
217 exclude-trivial-rebase: false
218 exclude-no-code-change: false
219 - draft-published-event
220 - comment-added-contains-event:
221 comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
223 gerrit-build-unstable-verified-value: +1
224 gerrit-build-unstable-codereview-value: 0
226 - project-compare-type: ANT
227 project-pattern: '{project}'
229 - branch-compare-type: ANT
230 branch-pattern: '**/{branch}'
235 # Macro: integration-csit-only
236 # Operation: this macro sets a trigger on reverse job list
237 # Used by: csit -only- job templates
240 name: integration-csit-trigger
246 # Macro: integration-openstack-controller-mininet
247 # Operation: this macro will spin the controller and mininet vms
248 # Used by: {project}-csit-* job templates
251 name: integration-openstack-controller-mininet
255 - cloud-name: 'ODLRPC'
256 template-name: '{controller-image}'
257 count: '{controller-vms}'
258 - cloud-name: 'ODLRPC'
259 template-name: '{mininet-image}'
260 count: '{mininet-vms}'
262 # Macro: integration-openstack-controller-devstack
263 # Operation: this macro will spin the controller and devstack vms
264 # Used by: {project}-csit-openstack job templates
266 name: integration-openstack-controller-devstack
270 - cloud-name: 'ODLRPC'
271 template-name: '{controller-image}'
272 count: '{controller-vms}'
273 - cloud-name: 'ODLRPC'
274 template-name: '{openstack-image}'
275 count: '{openstack-vms}'
281 # Macro: integration-infra-stack
282 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
283 # up csit lab using openstack-heat.
284 # Used by: {project}-csit-* job templates
287 name: integration-infra-stack
289 - integration-cleanup-workspace
292 # Setup openstack envirnoment file for use by
293 # the opendaylight-infra-stack macro
294 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
296 vm_0_count: {vm_0_count}
297 vm_0_flavor: {vm_0_flavor}
298 vm_0_image: {vm_0_image}
299 vm_1_count: {vm_1_count}
300 vm_1_flavor: {vm_1_flavor}
301 vm_1_image: {vm_1_image}
303 echo "Contents of opendaylight-infra-environment.yaml ..."
304 cat $WORKSPACE/opendaylight-infra-environment.yaml
305 - opendaylight-infra-stack:
306 stack-template: '{stack-template}'
308 # Macro: integration-infra-stack-3-type
309 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
310 # up csit lab using openstack-heat.
311 # Used by: {project}-csit-* job templates
314 name: integration-infra-stack-3-type
316 - integration-cleanup-workspace
319 # Setup openstack envirnoment file for use by
320 # the opendaylight-infra-stack macro
321 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
323 vm_0_count: {vm_0_count}
324 vm_0_flavor: {vm_0_flavor}
325 vm_0_image: {vm_0_image}
326 vm_1_count: {vm_1_count}
327 vm_1_flavor: {vm_1_flavor}
328 vm_1_image: {vm_1_image}
329 vm_2_count: {vm_2_count}
330 vm_2_flavor: {vm_2_flavor}
331 vm_2_image: {vm_2_image}
333 echo "Contents of opendaylight-infra-environment.yaml ..."
334 cat $WORKSPACE/opendaylight-infra-environment.yaml
335 - opendaylight-infra-stack:
336 stack-template: 'csit-3-instance-type.yaml'
338 # Macro: integration-apex-stack-3-type
339 # Operation: Sets environment and then calls opendaylight-apex-stack to spin
340 # up csit lab using openstack-heat.
341 # Used by: {project}-csit-* apex related job templates
344 name: integration-apex-stack-3-type
346 - integration-cleanup-workspace
349 # Setup openstack envirnoment file for use by
350 # the opendaylight-infra-stack macro
351 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
353 vm_0_count: {vm_0_count}
354 vm_0_flavor: {vm_0_flavor}
355 vm_0_image: {vm_0_image}
356 vm_1_count: {vm_1_count}
357 vm_1_flavor: {vm_1_flavor}
358 vm_1_image: {vm_1_image}
359 vm_2_count: {vm_2_count}
360 vm_2_flavor: {vm_2_flavor}
361 vm_2_image: {vm_2_image}
363 echo "Contents of opendaylight-infra-environment.yaml ..."
364 cat $WORKSPACE/opendaylight-infra-environment.yaml
365 - opendaylight-apex-stack:
366 stack-template: 'csit-apex-3-instance-type.yaml'
368 # Macro: integration-infra-stack-4-type
369 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
370 # up csit lab using openstack-heat.
371 # Used by: {project}-csit-* job templates
374 name: integration-infra-stack-4-type
376 - integration-cleanup-workspace
379 # Setup openstack envirnoment file for use by
380 # the opendaylight-infra-stack macro
381 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
383 vm_0_count: {vm_0_count}
384 vm_0_flavor: {vm_0_flavor}
385 vm_0_image: {vm_0_image}
386 vm_1_count: {vm_1_count}
387 vm_1_flavor: {vm_1_flavor}
388 vm_1_image: {vm_1_image}
389 vm_2_count: {vm_2_count}
390 vm_2_flavor: {vm_2_flavor}
391 vm_2_image: {vm_2_image}
392 vm_3_count: {vm_3_count}
393 vm_3_flavor: {vm_3_flavor}
394 vm_3_image: {vm_3_image}
396 echo "Contents of opendaylight-infra-environment.yaml ..."
397 cat $WORKSPACE/opendaylight-infra-environment.yaml
398 - opendaylight-infra-stack:
399 stack-template: 'csit-4-instance-type.yaml'
401 # Macro: integration-get-apex-addresses
402 # Operation: this macro gets the IP addresses of the dynamic vms from apex snapshots
403 # Used by: {project}-csit-* apex related job templates
406 name: integration-get-apex-addresses
408 - shell: !include-raw: integration-get-apex-addresses.sh
410 # Macro: integration-apex-run-tests
411 # Operation: this macro just runs the robot suites
412 # Used by: {project}-csit-* apex related job templates
415 name: integration-apex-run-tests
417 - shell: !include-raw: integration-apex-run-tests.sh
419 # Macro: integration-get-slave-addresses
420 # Operation: this macro gets the IP addresses of the dynamic vms
421 # Used by: {project}-csit-* job templates
424 name: integration-get-slave-addresses
426 - shell: !include-raw: integration-get-slave-addresses.sh
429 name: integration-set-variables
430 # Operation: Construct variables not requiring online detection and export using set_variables.env
431 # Required bash variables:
432 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
434 - shell: !include-raw: integration-set-variables.sh
436 properties-file: set_variables.env
439 name: integration-detect-variables
440 # Operation: Construct variables including online detection and export using detect_variables.env
441 # This calls integration-set-variables internally.
442 # Required bash variables:
443 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
445 - integration-set-variables
446 - shell: !include-raw: integration-detect-variables.sh
448 properties-file: detect_variables.env
450 # Macro: integration-deply-controller-run-test
451 # Operation: this macro deploys single contoller and runs test
452 # Used by: {project}-csit-1node-* job templates
455 name: integration-deploy-controller-run-test
457 - shell: !include-raw: integration-deploy-controller-run-test.sh
459 # Macro: integration-configure-clustering
460 # Operation: this macro configures the clustering
461 # Used by: {project}-csit-3node-* job templates
464 name: integration-configure-clustering
466 - shell: !include-raw: integration-configure-clustering.sh
468 # Macro: integration-start-cluster-run-test
469 # Operation: this macro starts the 3-node cluster and runs test
470 # Used by: {project}-csit-3node-* job templates
473 name: integration-start-cluster-run-test
475 - shell: !include-raw: integration-start-cluster-run-test.sh
477 # Macro: integration-install-robotframework
478 # Operation: Installs robotframework using pip to a virtualenv
479 # Used by: {project}-csit-* job templates
482 name: integration-install-robotframework
484 - shell: !include-raw: integration-install-robotframework.sh
486 # Macro: integration-cleanup-tmp
487 # Operation: Cleans up temporary files created by build
488 # Used by: {project}-csit-* job templates
491 name: integration-cleanup-tmp
493 - shell: !include-raw: integration-cleanup-tmp.sh
495 # Macro: integration-multipatch-builder
496 # Operation: checks out multiple patches and builds custom distribution
497 # Used by: integration-multipatch-test-* job templates
500 name: integration-multipatch-builder
502 - shell: !include-raw: multipatch-distribution.sh
504 # Macro: integration-cleanup-workspace
505 # Operation: Cleans up files possibly left there by the previous build
506 # Used by: {project}-csit-* job templates
509 name: integration-cleanup-workspace
511 - shell: !include-raw: integration-cleanup-workspace.sh
513 # Macro: integration-rebase-patch
514 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
515 # Used by: integration-patch-distribution-* job template
518 name: integration-rebase-gerrit-patch
520 - shell: !include-raw: integration-rebase-gerrit-patch.sh
522 # Macro: integration-install-common-functions
523 # Operation: Copy the common-functions.sh script to csit nodes
524 # Used by: {project}-csit-* job templates
526 name: integration-install-common-functions
528 - shell: !include-raw:
529 - copy-common-functions.sh
530 - common-functions.sh
533 name: integration-deploy-openstack-run-test
535 - shell: !include-raw:
536 - integration-deploy-openstack-run-test.sh
539 name: integration-apex-image-manager
541 - shell: !include-raw:
542 - ../opendaylight-infra-apex-image-management.sh
545 name: integration-compare-distributions
546 # Operation: will compare an already created distribtion (probably last
547 # published to nexus) to the current distribution being created.
548 # The comparison is done to find the list of patches that are new to the
549 # current distribution.
550 # Required bash variables:
551 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
553 - shell: !include-raw: integration-compare-distributions.sh
556 name: integration-upload-distribution
557 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
559 # {dist-pom} path to pom file containing the version
560 # Required bash variables:
561 # KARAF_VERSION: 'karaf4' or 'karaf3'.
562 # Use distribution-karaf-version macro to customize.
564 - config-file-provider:
566 - file-id: global-settings
567 variable: GLOBAL_SETTINGS_FILE
568 - file-id: integration-settings
569 variable: SETTINGS_FILE
570 - integration-set-variables
572 properties-content: BUNDLE_POM={dist-pom}
573 - shell: !include-raw-escape: integration-upload-distribution.sh
575 properties-file: integration-upload-distribution.env
581 # Macro: integration-robot
582 # Operation: this macro publishes robot results
583 # Used by: {project}-csit-* job templates
586 name: integration-robot
591 unstable-threshold: '{unstable-if}'
592 pass-threshold: '{pass-if}'
596 name: integration-robot-tempest
601 - tempest_results.html
602 unstable-threshold: '{unstable-if}'
603 pass-threshold: '{pass-if}'
607 name: integration-csit-archive-build
621 echo "Archiving csit artifacts"
624 for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
625 NODE_FOLDER="./archives/odl_${i}"
626 mkdir -p ${NODE_FOLDER}
627 mv odl${i}_* ${NODE_FOLDER} || true
628 mv karaf_${i}_*_threads* ${NODE_FOLDER} || true
629 mv *_${i}.png ${NODE_FOLDER} || true
630 mv /tmp/odl${i}_* ${NODE_FOLDER} || true
632 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
633 unzip -d ./archives robot-plugin.zip
634 mv *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
635 # TODO: Can the following line ever fail?
636 find . -type f -name *.hprof -print0 \
637 | tar -cvf - --null -T - | xz --threads=0 > ./archives/hprof.tar.xz
638 # TODO: Tweak the compression level if better ratio (or speed) is needed.
639 mark-unstable-if-failed: true
643 name: integration-csit-run-postscript
655 - config-file-provider:
657 - file-id: 'odl-elastic-cloud'
658 target: '${HOME}/.netrc'
661 #The following script runs any configurable postplan stored in test/csit/postplans.
662 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
663 echo "postplan exists!!!"
664 echo "Changing the postplan path..."
665 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
666 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
668 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
669 echo "Executing ${line}..."
674 mark-unstable-if-failed: true
677 name: integration-csit-collect-netvirt-logs
690 properties-file: 'slave_addresses.txt'
693 source /tmp/common-functions.sh ${BUNDLEFOLDER}
695 mark-unstable-if-failed: true