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 releng-defaults value is used.
19 default: '{karaf-version}'
20 description: 'karaf3 or karaf4, affects ODL deploy scripts'
23 name: integration-bundle-url
27 default: '{bundle-url}'
28 description: 'URL to karaf distribution zip'
31 name: integration-jdk-version
35 default: '{jdkversion}'
36 description: 'Parameter to indicate JAVA Version'
39 name: integration-controller-scope
43 default: '{controller-scope}'
44 description: 'Feature Only or Feature All test'
47 name: integration-controller-features
50 name: CONTROLLERFEATURES
51 default: '{controller-features}'
52 description: 'Features to install in the controller separated by comma'
55 name: integration-controller-debug-map
58 name: CONTROLLERDEBUGMAP
59 default: '{controller-debug-map}'
61 Key:Value map of debugs to enable on the controller separated by spaces.
62 The module should not include org.opendaylight.
63 The levels must be one of: ERROR, WARN, INFO, DEBUG, TRACE.
64 (ex. ovsdb.lib:ERROR netvirt.vpnservice:INFO)
67 name: integration-distribution-stream
72 description: 'Distribution stream string, for suites to know which behavior to expect'
75 name: integration-stream-test-plan
79 default: '{stream-test-plan}'
80 description: 'Stream-specific test plan we will run'
83 name: integration-test-plan
87 default: '{test-plan}'
88 description: 'General test plan we will run unless stream-specific one is found'
91 name: integration-test-suites
95 default: '{test-suites}'
97 List of space-separated suites. Useful when running specific suites within a testplan.
98 Do not include ${{WORKSPACE}}/test/csit/suites/ in the values:
99 (ex. openstack/connectivity/l2.robot openstack/tempest/tempest.robot
100 integration/test/csit/suites/netvirt/ElanService/).
103 name: integration-test-options
107 default: '{test-options}'
108 description: 'Robot command options'
111 name: integration-distribution-git-url
115 default: '{git-url}/integration/distribution'
116 description: 'Distribution GIT URL (do not modify)'
119 name: integration-patch-refspec
124 description: 'Integration Patch Refspec'
127 name: integration-use-features-boot
130 name: USEFEATURESBOOT
131 default: '{use-features-boot}'
132 description: 'Boolean to toggle whether featuresBoot is appended or ignored'
134 # Macro: integration-gerrit-scm
135 # Operation: this macro downloads a project gerrit
136 # Used by: all csit jobs
139 name: integration-gerrit-scm
142 credentials-id: 'opendaylight-jenkins-ssh'
149 choosing-strategy: 'gerrit'
151 # Macro: integration-distribution-scm
152 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
153 # Used by: integration-patch-test-{stream} job template
156 name: integration-distribution-scm
159 credentials-id: 'opendaylight-jenkins-ssh'
160 basedir: 'distribution'
167 # Macro: integration-trigger-patch-submitted
168 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
169 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
170 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
171 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
173 # gerrit-server-name: name of gerrit server to listen to
174 # project: pattern to match triggering projects
175 # branch: triggering branch name
176 # files: pattern to match triggering filepaths
178 name: integration-trigger-patch-submitted
181 server-name: '{gerrit-server-name}'
183 - patchset-created-event:
185 exclude-trivial-rebase: false
186 exclude-no-code-change: false
187 - draft-published-event
188 - comment-added-contains-event:
189 comment-contains-value: 'recheck$'
191 gerrit-build-unstable-verified-value: +1
192 gerrit-build-unstable-codereview-value: 0
194 - project-compare-type: ANT
195 project-pattern: '{project}'
197 - branch-compare-type: ANT
198 branch-pattern: '**/{branch}'
203 # Macro: integration-csit-only
204 # Operation: this macro sets a trigger on reverse job list
205 # Used by: csit -only- job templates
208 name: integration-csit-trigger
214 # Macro: integration-openstack-controller-mininet
215 # Operation: this macro will spin the controller and mininet vms
216 # Used by: {project}-csit-* job templates
219 name: integration-openstack-controller-mininet
223 - cloud-name: 'ODLRPC'
224 template-name: '{controller-image}'
225 count: '{controller-vms}'
226 - cloud-name: 'ODLRPC'
227 template-name: '{mininet-image}'
228 count: '{mininet-vms}'
230 # Macro: integration-openstack-controller-devstack
231 # Operation: this macro will spin the controller and devstack vms
232 # Used by: {project}-csit-openstack job templates
234 name: integration-openstack-controller-devstack
238 - cloud-name: 'ODLRPC'
239 template-name: '{controller-image}'
240 count: '{controller-vms}'
241 - cloud-name: 'ODLRPC'
242 template-name: '{openstack-image}'
243 count: '{openstack-vms}'
249 # Macro: integration-infra-stack
250 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
251 # up csit lab using openstack-heat.
252 # Used by: {project}-csit-* job templates
255 name: integration-infra-stack
257 - integration-cleanup-workspace
260 # Setup openstack envirnoment file for use by
261 # the opendaylight-infra-stack macro
262 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
264 vm_0_count: {vm_0_count}
265 vm_0_flavor: {vm_0_flavor}
266 vm_0_image: {vm_0_image}
267 vm_1_count: {vm_1_count}
268 vm_1_flavor: {vm_1_flavor}
269 vm_1_image: {vm_1_image}
271 echo "Contents of opendaylight-infra-environment.yaml ..."
272 cat $WORKSPACE/opendaylight-infra-environment.yaml
273 - opendaylight-infra-stack:
274 stack-template: '{stack-template}'
276 # Macro: integration-infra-stack-3-type
277 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
278 # up csit lab using openstack-heat.
279 # Used by: {project}-csit-* job templates
282 name: integration-infra-stack-3-type
284 - integration-cleanup-workspace
287 # Setup openstack envirnoment file for use by
288 # the opendaylight-infra-stack macro
289 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
291 vm_0_count: {vm_0_count}
292 vm_0_flavor: {vm_0_flavor}
293 vm_0_image: {vm_0_image}
294 vm_1_count: {vm_1_count}
295 vm_1_flavor: {vm_1_flavor}
296 vm_1_image: {vm_1_image}
297 vm_2_count: {vm_2_count}
298 vm_2_flavor: {vm_2_flavor}
299 vm_2_image: {vm_2_image}
301 echo "Contents of opendaylight-infra-environment.yaml ..."
302 cat $WORKSPACE/opendaylight-infra-environment.yaml
303 - opendaylight-infra-stack:
304 stack-template: 'csit-3-instance-type.yaml'
306 # Macro: integration-infra-stack-4-type
307 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
308 # up csit lab using openstack-heat.
309 # Used by: {project}-csit-* job templates
312 name: integration-infra-stack-4-type
314 - integration-cleanup-workspace
317 # Setup openstack envirnoment file for use by
318 # the opendaylight-infra-stack macro
319 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
321 vm_0_count: {vm_0_count}
322 vm_0_flavor: {vm_0_flavor}
323 vm_0_image: {vm_0_image}
324 vm_1_count: {vm_1_count}
325 vm_1_flavor: {vm_1_flavor}
326 vm_1_image: {vm_1_image}
327 vm_2_count: {vm_2_count}
328 vm_2_flavor: {vm_2_flavor}
329 vm_2_image: {vm_2_image}
330 vm_3_count: {vm_3_count}
331 vm_3_flavor: {vm_3_flavor}
332 vm_3_image: {vm_3_image}
334 echo "Contents of opendaylight-infra-environment.yaml ..."
335 cat $WORKSPACE/opendaylight-infra-environment.yaml
336 - opendaylight-infra-stack:
337 stack-template: 'csit-4-instance-type.yaml'
339 # Macro: integration-get-slave-addresses
340 # Operation: this macro gets the IP addresses of the dynamic vms
341 # Used by: {project}-csit-* job templates
344 name: integration-get-slave-addresses
346 - shell: !include-raw: integration-get-slave-addresses.sh
349 name: integration-set-variables
350 # Operation: Construct variables not requiring online detection and export using set_variables.env
351 # Required bash variables:
352 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
354 - shell: !include-raw: integration-set-variables.sh
356 properties-file: set_variables.env
359 name: integration-detect-variables
360 # Operation: Construct variables including online detection and export using detect_variables.env
361 # This calls integration-set-variables internally.
362 # Required bash variables:
363 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
365 - integration-set-variables
366 - shell: !include-raw: integration-detect-variables.sh
368 properties-file: detect_variables.env
370 # Macro: integration-deply-controller-run-test
371 # Operation: this macro deploys single contoller and runs test
372 # Used by: {project}-csit-1node-* job templates
375 name: integration-deploy-controller-run-test
377 - shell: !include-raw: integration-deploy-controller-run-test.sh
379 # Macro: integration-configure-clustering
380 # Operation: this macro configures the clustering
381 # Used by: {project}-csit-3node-* job templates
384 name: integration-configure-clustering
386 - shell: !include-raw: integration-configure-clustering.sh
388 # Macro: integration-start-cluster-run-test
389 # Operation: this macro starts the 3-node cluster and runs test
390 # Used by: {project}-csit-3node-* job templates
393 name: integration-start-cluster-run-test
395 - shell: !include-raw: integration-start-cluster-run-test.sh
397 # Macro: integration-install-robotframework
398 # Operation: Installs robotframework using pip to a virtualenv
399 # Used by: {project}-csit-* job templates
402 name: integration-install-robotframework
404 - shell: !include-raw: integration-install-robotframework.sh
406 # Macro: integration-cleanup-tmp
407 # Operation: Cleans up temporary files created by build
408 # Used by: {project}-csit-* job templates
411 name: integration-cleanup-tmp
413 - shell: !include-raw: integration-cleanup-tmp.sh
415 # Macro: integration-multipatch-builder
416 # Operation: checks out multiple patches and builds custom distribution
417 # Used by: integration-multipatch-test-* job templates
420 name: integration-multipatch-builder
422 - shell: !include-raw: multipatch-distribution.sh
424 # Macro: integration-cleanup-workspace
425 # Operation: Cleans up files possibly left there by the previous build
426 # Used by: {project}-csit-* job templates
429 name: integration-cleanup-workspace
431 - shell: !include-raw: integration-cleanup-workspace.sh
433 # Macro: integration-rebase-patch
434 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
435 # Used by: integration-patch-distribution-* job template
438 name: integration-rebase-gerrit-patch
440 - shell: !include-raw: integration-rebase-gerrit-patch.sh
442 # Macro: integration-install-common-functions
443 # Operation: Copy the common-functions.sh script to csit nodes
444 # Used by: {project}-csit-* job templates
446 name: integration-install-common-functions
448 - shell: !include-raw:
449 - copy-common-functions.sh
450 - common-functions.sh
453 name: integration-deploy-openstack-run-test
455 - shell: !include-raw:
456 - integration-deploy-openstack-run-test.sh
459 name: integration-compare-distributions
460 # Operation: will compare an already created distribtion (probably last
461 # published to nexus) to the current distribution being created.
462 # The comparison is done to find the list of patches that are new to the
463 # current distribution.
464 # Required bash variables:
465 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
467 - shell: !include-raw: integration-compare-distributions.sh
470 name: integration-upload-distribution
471 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
473 # {dist-pom} path to pom file containing the version
474 # Required bash variables:
475 # KARAF_VERSION: 'karaf4' or 'karaf3'.
476 # Use distribution-karaf-version macro to customize.
478 - config-file-provider:
480 - file-id: global-settings
481 variable: GLOBAL_SETTINGS_FILE
482 - file-id: integration-settings
483 variable: SETTINGS_FILE
484 - integration-set-variables
486 properties-content: BUNDLE_POM={dist-pom}
487 - shell: !include-raw-escape: integration-upload-distribution.sh
489 properties-file: integration-upload-distribution.env
495 # Macro: integration-robot
496 # Operation: this macro publishes robot results
497 # Used by: {project}-csit-* job templates
500 name: integration-robot
505 unstable-threshold: '{unstable-if}'
506 pass-threshold: '{pass-if}'
510 name: integration-robot-tempest
515 - tempest_results.html
516 unstable-threshold: '{unstable-if}'
517 pass-threshold: '{pass-if}'
521 name: integration-csit-archive-build
537 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
538 unzip -d ./archives robot-plugin.zip
539 mv *.log *.log.gz *.csv *.png ./archives || true # Don't fail if file missing
540 # TODO: Can the following line ever fail?
541 find . -type f -name *.hprof -print0 \
542 | tar -cvf - --null -T - | xz --threads=0 > ./archives/hprof.tar.xz
543 # TODO: Tweak the compression level if better ratio (or speed) is needed.
544 mark-unstable-if-failed: true
548 name: integration-csit-run-postscript
560 - config-file-provider:
562 - file-id: 'odl-elastic-cloud'
563 target: '${HOME}/.netrc'
566 #The following script runs any configurable postplan stored in test/csit/postplans.
567 if [ -f "${WORKSPACE}/test/csit/postplans/${TESTPLAN}" ]; then
568 echo "postplan exists!!!"
569 echo "Changing the postplan path..."
570 script_name=${WORKSPACE}/test/csit/postplans/${TESTPLAN}
571 cat ${script_name} | sed "s:integration:${WORKSPACE}:" > postplan.txt
573 egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' postplan.txt | while read -r line ; do
574 echo "Executing ${line}..."
579 mark-unstable-if-failed: true