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-infra-stack-4-type
331 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
332 # up csit lab using openstack-heat.
333 # Used by: {project}-csit-* job templates
336 name: integration-infra-stack-4-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}
354 vm_3_count: {vm_3_count}
355 vm_3_flavor: {vm_3_flavor}
356 vm_3_image: {vm_3_image}
358 echo "Contents of opendaylight-infra-environment.yaml ..."
359 cat $WORKSPACE/opendaylight-infra-environment.yaml
360 - opendaylight-infra-stack:
361 stack-template: 'csit-4-instance-type.yaml'
363 # Macro: integration-get-slave-addresses
364 # Operation: this macro gets the IP addresses of the dynamic vms
365 # Used by: {project}-csit-* job templates
368 name: integration-get-slave-addresses
370 - shell: !include-raw: integration-get-slave-addresses.sh
373 name: integration-set-variables
374 # Operation: Construct variables not requiring online detection and export using set_variables.env
375 # Required bash variables:
376 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
378 - shell: !include-raw: integration-set-variables.sh
380 properties-file: set_variables.env
383 name: integration-detect-variables
384 # Operation: Construct variables including online detection and export using detect_variables.env
385 # This calls integration-set-variables internally.
386 # Required bash variables:
387 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
389 - integration-set-variables
390 - shell: !include-raw: integration-detect-variables.sh
392 properties-file: detect_variables.env
394 # Macro: integration-deply-controller-run-test
395 # Operation: this macro deploys single contoller and runs test
396 # Used by: {project}-csit-1node-* job templates
399 name: integration-deploy-controller-run-test
401 - shell: !include-raw: integration-deploy-controller-run-test.sh
403 # Macro: integration-configure-clustering
404 # Operation: this macro configures the clustering
405 # Used by: {project}-csit-3node-* job templates
408 name: integration-configure-clustering
410 - shell: !include-raw: integration-configure-clustering.sh
412 # Macro: integration-start-cluster-run-test
413 # Operation: this macro starts the 3-node cluster and runs test
414 # Used by: {project}-csit-3node-* job templates
417 name: integration-start-cluster-run-test
419 - shell: !include-raw: integration-start-cluster-run-test.sh
421 # Macro: integration-install-robotframework
422 # Operation: Installs robotframework using pip to a virtualenv
423 # Used by: {project}-csit-* job templates
426 name: integration-install-robotframework
428 - shell: !include-raw: integration-install-robotframework.sh
430 # Macro: integration-cleanup-tmp
431 # Operation: Cleans up temporary files created by build
432 # Used by: {project}-csit-* job templates
435 name: integration-cleanup-tmp
437 - shell: !include-raw: integration-cleanup-tmp.sh
439 # Macro: integration-multipatch-builder
440 # Operation: checks out multiple patches and builds custom distribution
441 # Used by: integration-multipatch-test-* job templates
444 name: integration-multipatch-builder
446 - shell: !include-raw: multipatch-distribution.sh
448 # Macro: integration-cleanup-workspace
449 # Operation: Cleans up files possibly left there by the previous build
450 # Used by: {project}-csit-* job templates
453 name: integration-cleanup-workspace
455 - shell: !include-raw: integration-cleanup-workspace.sh
457 # Macro: integration-rebase-patch
458 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
459 # Used by: integration-patch-distribution-* job template
462 name: integration-rebase-gerrit-patch
464 - shell: !include-raw: integration-rebase-gerrit-patch.sh
466 # Macro: integration-install-common-functions
467 # Operation: Copy the common-functions.sh script to csit nodes
468 # Used by: {project}-csit-* job templates
470 name: integration-install-common-functions
472 - shell: !include-raw:
473 - copy-common-functions.sh
474 - common-functions.sh
477 name: integration-deploy-openstack-run-test
479 - shell: !include-raw:
480 - integration-deploy-openstack-run-test.sh
483 name: integration-compare-distributions
484 # Operation: will compare an already created distribtion (probably last
485 # published to nexus) to the current distribution being created.
486 # The comparison is done to find the list of patches that are new to the
487 # current distribution.
488 # Required bash variables:
489 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
491 - shell: !include-raw: integration-compare-distributions.sh
494 name: integration-upload-distribution
495 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
497 # {dist-pom} path to pom file containing the version
498 # Required bash variables:
499 # KARAF_VERSION: 'karaf4' or 'karaf3'.
500 # Use distribution-karaf-version macro to customize.
502 - config-file-provider:
504 - file-id: global-settings
505 variable: GLOBAL_SETTINGS_FILE
506 - file-id: integration-settings
507 variable: SETTINGS_FILE
508 - integration-set-variables
510 properties-content: BUNDLE_POM={dist-pom}
511 - shell: !include-raw-escape: integration-upload-distribution.sh
513 properties-file: integration-upload-distribution.env
519 # Macro: integration-robot
520 # Operation: this macro publishes robot results
521 # Used by: {project}-csit-* job templates
524 name: integration-robot
529 unstable-threshold: '{unstable-if}'
530 pass-threshold: '{pass-if}'
534 name: integration-robot-tempest
539 - tempest_results.html
540 unstable-threshold: '{unstable-if}'
541 pass-threshold: '{pass-if}'
545 name: integration-csit-archive-build
561 for i in `seq 1 ${NUM_ODL_SYSTEM}`; do
562 NODE_FOLDER="./archives/odl_${i}"
563 mkdir -p ${NODE_FOLDER}
564 mv odl${i}_karaf* ${NODE_FOLDER} || true
565 mv karaf_${i}_*_threads* ${NODE_FOLDER} || true
566 mv *_${i}.png ${NODE_FOLDER} || true
568 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
569 unzip -d ./archives robot-plugin.zip
570 mv *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
571 # TODO: Can the following line ever fail?
572 find . -type f -name *.hprof -print0 \
573 | tar -cvf - --null -T - | xz --threads=0 > ./archives/hprof.tar.xz
574 # TODO: Tweak the compression level if better ratio (or speed) is needed.
575 mark-unstable-if-failed: true
579 name: integration-csit-run-postscript
591 - config-file-provider:
593 - file-id: 'odl-elastic-cloud'
594 target: '${HOME}/.netrc'
597 #The following script runs any configurable postplan stored in test/csit/postplans.
598 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
599 echo "postplan exists!!!"
600 echo "Changing the postplan path..."
601 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
602 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
604 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
605 echo "Executing ${line}..."
610 mark-unstable-if-failed: true
613 name: integration-csit-collect-netvirt-logs
626 properties-file: 'slave_addresses.txt'
629 source /tmp/common-functions.sh ${BUNDLEFOLDER}
631 mark-unstable-if-failed: true