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-stream-test-plan
87 default: '{stream-test-plan}'
88 description: 'Stream-specific test plan we will run'
91 name: integration-test-plan
95 default: '{test-plan}'
96 description: 'General test plan we will run unless stream-specific one is found'
99 name: integration-test-suites
103 default: '{test-suites}'
105 List of space-separated suites. Useful when running specific suites within a testplan.
106 Do not include ${{WORKSPACE}}/test/csit/suites/ in the values:
107 (ex. openstack/connectivity/l2.robot openstack/tempest/tempest.robot
108 integration/test/csit/suites/netvirt/ElanService/).
111 name: integration-test-options
115 default: '{test-options}'
116 description: 'Robot command options'
119 name: integration-distribution-git-url
123 default: '{git-url}/integration/distribution'
124 description: 'Distribution GIT URL (do not modify)'
127 name: integration-patch-refspec
132 description: 'Integration Patch Refspec'
135 name: integration-use-features-boot
138 name: USEFEATURESBOOT
139 default: '{use-features-boot}'
140 description: 'Boolean to toggle whether featuresBoot is appended or ignored'
142 # Macro: integration-gerrit-scm
143 # Operation: this macro downloads a project gerrit
144 # Used by: all csit jobs
147 name: integration-gerrit-scm
150 credentials-id: 'opendaylight-jenkins-ssh'
157 choosing-strategy: 'gerrit'
159 # Macro: integration-distribution-scm
160 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
161 # Used by: integration-patch-test-{stream} job template
164 name: integration-distribution-scm
167 credentials-id: 'opendaylight-jenkins-ssh'
168 basedir: 'distribution'
175 # Macro: integration-trigger-patch-submitted
176 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
177 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
178 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
179 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
181 # gerrit-server-name: name of gerrit server to listen to
182 # project: pattern to match triggering projects
183 # branch: triggering branch name
184 # files: pattern to match triggering filepaths
186 name: integration-trigger-patch-submitted
189 server-name: '{gerrit-server-name}'
191 - patchset-created-event:
193 exclude-trivial-rebase: false
194 exclude-no-code-change: false
195 - draft-published-event
196 - comment-added-contains-event:
197 comment-contains-value: 'recheck$'
199 gerrit-build-unstable-verified-value: +1
200 gerrit-build-unstable-codereview-value: 0
202 - project-compare-type: ANT
203 project-pattern: '{project}'
205 - branch-compare-type: ANT
206 branch-pattern: '**/{branch}'
211 # Macro: integration-csit-only
212 # Operation: this macro sets a trigger on reverse job list
213 # Used by: csit -only- job templates
216 name: integration-csit-trigger
222 # Macro: integration-openstack-controller-mininet
223 # Operation: this macro will spin the controller and mininet vms
224 # Used by: {project}-csit-* job templates
227 name: integration-openstack-controller-mininet
231 - cloud-name: 'ODLRPC'
232 template-name: '{controller-image}'
233 count: '{controller-vms}'
234 - cloud-name: 'ODLRPC'
235 template-name: '{mininet-image}'
236 count: '{mininet-vms}'
238 # Macro: integration-openstack-controller-devstack
239 # Operation: this macro will spin the controller and devstack vms
240 # Used by: {project}-csit-openstack job templates
242 name: integration-openstack-controller-devstack
246 - cloud-name: 'ODLRPC'
247 template-name: '{controller-image}'
248 count: '{controller-vms}'
249 - cloud-name: 'ODLRPC'
250 template-name: '{openstack-image}'
251 count: '{openstack-vms}'
257 # Macro: integration-infra-stack
258 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
259 # up csit lab using openstack-heat.
260 # Used by: {project}-csit-* job templates
263 name: integration-infra-stack
265 - integration-cleanup-workspace
268 # Setup openstack envirnoment file for use by
269 # the opendaylight-infra-stack macro
270 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
272 vm_0_count: {vm_0_count}
273 vm_0_flavor: {vm_0_flavor}
274 vm_0_image: {vm_0_image}
275 vm_1_count: {vm_1_count}
276 vm_1_flavor: {vm_1_flavor}
277 vm_1_image: {vm_1_image}
279 echo "Contents of opendaylight-infra-environment.yaml ..."
280 cat $WORKSPACE/opendaylight-infra-environment.yaml
281 - opendaylight-infra-stack:
282 stack-template: '{stack-template}'
284 # Macro: integration-infra-stack-3-type
285 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
286 # up csit lab using openstack-heat.
287 # Used by: {project}-csit-* job templates
290 name: integration-infra-stack-3-type
292 - integration-cleanup-workspace
295 # Setup openstack envirnoment file for use by
296 # the opendaylight-infra-stack macro
297 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
299 vm_0_count: {vm_0_count}
300 vm_0_flavor: {vm_0_flavor}
301 vm_0_image: {vm_0_image}
302 vm_1_count: {vm_1_count}
303 vm_1_flavor: {vm_1_flavor}
304 vm_1_image: {vm_1_image}
305 vm_2_count: {vm_2_count}
306 vm_2_flavor: {vm_2_flavor}
307 vm_2_image: {vm_2_image}
309 echo "Contents of opendaylight-infra-environment.yaml ..."
310 cat $WORKSPACE/opendaylight-infra-environment.yaml
311 - opendaylight-infra-stack:
312 stack-template: 'csit-3-instance-type.yaml'
314 # Macro: integration-infra-stack-4-type
315 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
316 # up csit lab using openstack-heat.
317 # Used by: {project}-csit-* job templates
320 name: integration-infra-stack-4-type
322 - integration-cleanup-workspace
325 # Setup openstack envirnoment file for use by
326 # the opendaylight-infra-stack macro
327 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
329 vm_0_count: {vm_0_count}
330 vm_0_flavor: {vm_0_flavor}
331 vm_0_image: {vm_0_image}
332 vm_1_count: {vm_1_count}
333 vm_1_flavor: {vm_1_flavor}
334 vm_1_image: {vm_1_image}
335 vm_2_count: {vm_2_count}
336 vm_2_flavor: {vm_2_flavor}
337 vm_2_image: {vm_2_image}
338 vm_3_count: {vm_3_count}
339 vm_3_flavor: {vm_3_flavor}
340 vm_3_image: {vm_3_image}
342 echo "Contents of opendaylight-infra-environment.yaml ..."
343 cat $WORKSPACE/opendaylight-infra-environment.yaml
344 - opendaylight-infra-stack:
345 stack-template: 'csit-4-instance-type.yaml'
347 # Macro: integration-get-slave-addresses
348 # Operation: this macro gets the IP addresses of the dynamic vms
349 # Used by: {project}-csit-* job templates
352 name: integration-get-slave-addresses
354 - shell: !include-raw: integration-get-slave-addresses.sh
357 name: integration-set-variables
358 # Operation: Construct variables not requiring online detection and export using set_variables.env
359 # Required bash variables:
360 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
362 - shell: !include-raw: integration-set-variables.sh
364 properties-file: set_variables.env
367 name: integration-detect-variables
368 # Operation: Construct variables including online detection and export using detect_variables.env
369 # This calls integration-set-variables internally.
370 # Required bash variables:
371 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
373 - integration-set-variables
374 - shell: !include-raw: integration-detect-variables.sh
376 properties-file: detect_variables.env
378 # Macro: integration-deply-controller-run-test
379 # Operation: this macro deploys single contoller and runs test
380 # Used by: {project}-csit-1node-* job templates
383 name: integration-deploy-controller-run-test
385 - shell: !include-raw: integration-deploy-controller-run-test.sh
387 # Macro: integration-configure-clustering
388 # Operation: this macro configures the clustering
389 # Used by: {project}-csit-3node-* job templates
392 name: integration-configure-clustering
394 - shell: !include-raw: integration-configure-clustering.sh
396 # Macro: integration-start-cluster-run-test
397 # Operation: this macro starts the 3-node cluster and runs test
398 # Used by: {project}-csit-3node-* job templates
401 name: integration-start-cluster-run-test
403 - shell: !include-raw: integration-start-cluster-run-test.sh
405 # Macro: integration-install-robotframework
406 # Operation: Installs robotframework using pip to a virtualenv
407 # Used by: {project}-csit-* job templates
410 name: integration-install-robotframework
412 - shell: !include-raw: integration-install-robotframework.sh
414 # Macro: integration-cleanup-tmp
415 # Operation: Cleans up temporary files created by build
416 # Used by: {project}-csit-* job templates
419 name: integration-cleanup-tmp
421 - shell: !include-raw: integration-cleanup-tmp.sh
423 # Macro: integration-multipatch-builder
424 # Operation: checks out multiple patches and builds custom distribution
425 # Used by: integration-multipatch-test-* job templates
428 name: integration-multipatch-builder
430 - shell: !include-raw: multipatch-distribution.sh
432 # Macro: integration-cleanup-workspace
433 # Operation: Cleans up files possibly left there by the previous build
434 # Used by: {project}-csit-* job templates
437 name: integration-cleanup-workspace
439 - shell: !include-raw: integration-cleanup-workspace.sh
441 # Macro: integration-rebase-patch
442 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
443 # Used by: integration-patch-distribution-* job template
446 name: integration-rebase-gerrit-patch
448 - shell: !include-raw: integration-rebase-gerrit-patch.sh
450 # Macro: integration-install-common-functions
451 # Operation: Copy the common-functions.sh script to csit nodes
452 # Used by: {project}-csit-* job templates
454 name: integration-install-common-functions
456 - shell: !include-raw:
457 - copy-common-functions.sh
458 - common-functions.sh
461 name: integration-deploy-openstack-run-test
463 - shell: !include-raw:
464 - integration-deploy-openstack-run-test.sh
467 name: integration-compare-distributions
468 # Operation: will compare an already created distribtion (probably last
469 # published to nexus) to the current distribution being created.
470 # The comparison is done to find the list of patches that are new to the
471 # current distribution.
472 # Required bash variables:
473 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
475 - shell: !include-raw: integration-compare-distributions.sh
478 name: integration-upload-distribution
479 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
481 # {dist-pom} path to pom file containing the version
482 # Required bash variables:
483 # KARAF_VERSION: 'karaf4' or 'karaf3'.
484 # Use distribution-karaf-version macro to customize.
486 - config-file-provider:
488 - file-id: global-settings
489 variable: GLOBAL_SETTINGS_FILE
490 - file-id: integration-settings
491 variable: SETTINGS_FILE
492 - integration-set-variables
494 properties-content: BUNDLE_POM={dist-pom}
495 - shell: !include-raw-escape: integration-upload-distribution.sh
497 properties-file: integration-upload-distribution.env
503 # Macro: integration-robot
504 # Operation: this macro publishes robot results
505 # Used by: {project}-csit-* job templates
508 name: integration-robot
513 unstable-threshold: '{unstable-if}'
514 pass-threshold: '{pass-if}'
518 name: integration-robot-tempest
523 - tempest_results.html
524 unstable-threshold: '{unstable-if}'
525 pass-threshold: '{pass-if}'
529 name: integration-csit-archive-build
545 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
546 unzip -d ./archives robot-plugin.zip
547 mv *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
548 # TODO: Can the following line ever fail?
549 find . -type f -name *.hprof -print0 \
550 | tar -cvf - --null -T - | xz --threads=0 > ./archives/hprof.tar.xz
551 # TODO: Tweak the compression level if better ratio (or speed) is needed.
552 mark-unstable-if-failed: true
556 name: integration-csit-run-postscript
568 - config-file-provider:
570 - file-id: 'odl-elastic-cloud'
571 target: '${HOME}/.netrc'
574 #The following script runs any configurable postplan stored in test/csit/postplans.
575 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
576 echo "postplan exists!!!"
577 echo "Changing the postplan path..."
578 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
579 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
581 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
582 echo "Executing ${line}..."
587 mark-unstable-if-failed: true
590 name: integration-csit-collect-netvirt-logs
603 properties-file: 'slave_addresses.txt'
606 source /tmp/common-functions.sh ${BUNDLEFOLDER}
608 mark-unstable-if-failed: true