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-distribution-stream
60 description: 'Distribution stream string, for suites to know which behavior to expect'
63 name: integration-stream-test-plan
67 default: '{stream-test-plan}'
68 description: 'Stream-specific test plan we will run'
71 name: integration-test-plan
75 default: '{test-plan}'
76 description: 'General test plan we will run unless stream-specific one is found'
79 name: integration-test-options
83 default: '{test-options}'
84 description: 'Robot command options'
87 name: integration-distribution-git-url
91 default: '{git-url}/integration/distribution'
92 description: 'Distribution GIT URL (do not modify)'
95 name: integration-patch-refspec
100 description: 'Integration Patch Refspec'
102 # Macro: integration-gerrit-scm
103 # Operation: this macro downloads a project gerrit
104 # Used by: all csit jobs
107 name: integration-gerrit-scm
110 credentials-id: 'opendaylight-jenkins-ssh'
117 choosing-strategy: 'gerrit'
119 # Macro: integration-distribution-scm
120 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
121 # Used by: integration-patch-test-{stream} job template
124 name: integration-distribution-scm
127 credentials-id: 'opendaylight-jenkins-ssh'
128 basedir: 'distribution'
135 # Macro: integration-trigger-patch-submitted
136 # This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
137 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
138 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
139 # Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
141 # server: name of gerrit server to listen to
142 # project: pattern to match triggering projects
143 # branch: triggering branch name
144 # files: pattern to match triggering filepaths
146 name: integration-trigger-patch-submitted
149 server-name: '{server}'
151 - patchset-created-event:
153 exclude-trivial-rebase: false
154 exclude-no-code-change: false
155 - draft-published-event
156 - comment-added-contains-event:
157 comment-contains-value: recheck
159 gerrit-build-unstable-verified-value: +1
160 gerrit-build-unstable-codereview-value: 0
162 - project-compare-type: ANT
163 project-pattern: '{project}'
165 - branch-compare-type: ANT
166 branch-pattern: '**/{branch}'
171 # Macro: integration-openstack-controller-mininet
172 # Operation: this macro will spin the controller and mininet vms
173 # Used by: {project}-csit-* job templates
176 name: integration-openstack-controller-mininet
180 - cloud-name: 'ODLRPC'
181 template-name: '{controller-image}'
182 count: '{controller-vms}'
183 - cloud-name: 'ODLRPC'
184 template-name: '{mininet-image}'
185 count: '{mininet-vms}'
187 # Macro: integration-openstack-controller-devstack
188 # Operation: this macro will spin the controller and devstack vms
189 # Used by: {project}-csit-openstack job templates
191 name: integration-openstack-controller-devstack
195 - cloud-name: 'ODLRPC'
196 template-name: '{controller-image}'
197 count: '{controller-vms}'
198 - cloud-name: 'ODLRPC'
199 template-name: '{openstack-image}'
200 count: '{openstack-vms}'
206 # Macro: integration-infra-stack
207 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
208 # up csit lab using openstack-heat.
209 # Used by: {project}-csit-* job templates
212 name: integration-infra-stack
214 - integration-cleanup-workspace
217 # Setup openstack envirnoment file for use by
218 # the opendaylight-infra-stack macro
219 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
221 vm_0_count: {vm_0_count}
222 vm_0_flavor: {vm_0_flavor}
223 vm_0_image: {vm_0_image}
224 vm_1_count: {vm_1_count}
225 vm_1_flavor: {vm_1_flavor}
226 vm_1_image: {vm_1_image}
228 echo "Contents of opendaylight-infra-environment.yaml ..."
229 cat $WORKSPACE/opendaylight-infra-environment.yaml
230 - opendaylight-infra-stack:
231 stack-template: '{stack-template}'
233 # Macro: integration-infra-stack-3-type
234 # Operation: Sets environment and then calls opendaylight-infra-stack to spin
235 # up csit lab using openstack-heat.
236 # Used by: {project}-csit-* job templates
239 name: integration-infra-stack-3-type
241 - integration-cleanup-workspace
244 # Setup openstack envirnoment file for use by
245 # the opendaylight-infra-stack macro
246 cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
248 vm_0_count: {vm_0_count}
249 vm_0_flavor: {vm_0_flavor}
250 vm_0_image: {vm_0_image}
251 vm_1_count: {vm_1_count}
252 vm_1_flavor: {vm_1_flavor}
253 vm_1_image: {vm_1_image}
254 vm_2_count: {vm_2_count}
255 vm_2_flavor: {vm_2_flavor}
256 vm_2_image: {vm_2_image}
258 echo "Contents of opendaylight-infra-environment.yaml ..."
259 cat $WORKSPACE/opendaylight-infra-environment.yaml
260 - opendaylight-infra-stack:
261 stack-template: 'csit-3-instance-type.yaml'
263 # Macro: integration-get-slave-addresses
264 # Operation: this macro gets the IP addresses of the dynamic vms
265 # Used by: {project}-csit-* job templates
268 name: integration-get-slave-addresses
270 - shell: !include-raw: include-raw-integration-get-slave-addresses.sh
273 name: integration-set-variables
274 # Operation: Construct variables not requiring online detection and export using set_variables.env
275 # Required bash variables:
276 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
278 - shell: !include-raw: integration-set-variables.sh
280 properties-file: set_variables.env
283 name: integration-detect-variables
284 # Operation: Construct variables including online detection and export using detect_variables.env
285 # This calls integration-set-variables internally.
286 # Required bash variables:
287 # KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
289 - integration-set-variables
290 - shell: !include-raw: integration-detect-variables.sh
292 properties-file: detect_variables.env
295 name: integration-distribution-check
296 # Operation: Locally deploy ODL with all fetures, check it is not broken.
297 # Required bash variables:
298 # KARAF_VERSION: 'karaf4' or 'karaf3'.
299 # Use distribution-karaf-version macro to customize.
301 - integration-set-variables
302 - shell: !include-raw: integration-distribution-check.sh
305 name: distribution-deploy-verify
306 # Operation: Deploy ODL with all fetures and check it is not broken.
307 # Required bash variables:
308 # KARAF_VERSION: 'karaf4' or 'karaf3'.
309 # Use distribution-karaf-version macro to customize.
311 - integration-detect-variables
312 - shell: !include-raw: distribution-deploy-verify.sh
315 name: distribution-deploy-offline
316 # Operation: Deploys ODL on the current system, with no external repo configuration, check it works.
317 # Required bash variables:
318 # KARAF_VERSION: 'karaf4' or 'karaf3'.
319 # Use distribution-karaf-version macro to customize.
321 - integration-detect-variables
322 - shell: !include-raw: distribution-deploy-offline.sh
324 # Macro: integration-deply-controller-run-test
325 # Operation: this macro deploys single contoller and runs test
326 # Used by: {project}-csit-1node-* job templates
329 name: integration-deploy-controller-run-test
331 - shell: !include-raw: include-raw-integration-deploy-controller-run-test.sh
333 # Macro: integration-configure-clustering
334 # Operation: this macro configures the clustering
335 # Used by: {project}-csit-3node-* job templates
338 name: integration-configure-clustering
340 - shell: !include-raw: include-raw-integration-configure-clustering.sh
342 # Macro: integration-start-cluster-run-test
343 # Operation: this macro starts the 3-node cluster and runs test
344 # Used by: {project}-csit-3node-* job templates
347 name: integration-start-cluster-run-test
349 - shell: !include-raw: include-raw-integration-start-cluster-run-test.sh
351 # Macro: integration-install-robotframework
352 # Operation: Installs robotframework using pip to a virtualenv
353 # Used by: {project}-csit-* job templates
356 name: integration-install-robotframework
358 - shell: !include-raw: include-raw-integration-install-robotframework.sh
360 # Macro: integration-cleanup-tmp
361 # Operation: Cleans up temporary files created by build
362 # Used by: {project}-csit-* job templates
365 name: integration-cleanup-tmp
367 - shell: !include-raw: include-raw-integration-cleanup-tmp.sh
369 # Macro: integration-multipatch-builder
370 # Operation: checks out multiple patches and builds custom distribution
371 # Used by: integration-multipatch-test-* job templates
374 name: integration-multipatch-builder
376 - shell: !include-raw: include-raw-integration-multipatch-distribution-test.sh
378 # Macro: integration-cleanup-workspace
379 # Operation: Cleans up files possibly left there by the previous build
380 # Used by: {project}-csit-* job templates
383 name: integration-cleanup-workspace
385 - shell: !include-raw: include-raw-integration-cleanup-workspace.sh
387 # Macro: integration-rebase-patch
388 # Operation: For cloned project, rebase checked-out Gerrit patch onto $DISTROBRANCH.
389 # Used by: integration-patch-distribution-* job template
392 name: integration-rebase-gerrit-patch
394 - shell: !include-raw: include-raw-integration-rebase-gerrit-patch.sh
397 name: integration-deploy-openstack-run-test
399 - shell: !include-raw: include-raw-integration-deploy-openstack-run-test.sh
401 # Macro: integration-list-jobs
402 # Operation: queries Jenkins jobs from jenkins.opendaylight.org and
403 # writes a list of the jobs corresponding to the search terms to a file.
404 # Used by: builder-merge job template
406 # This script requires the following JJB variables to be passed in:
407 # {search_string} Job type to act as a primary filter (e.g. csit)
408 # {blacklist} List of sub-projects to filter out (e.g. longevity)
409 # {stream} Development release name (e.g. boron)
410 # {jobs-filename} Filename to write list into (e.g. carbon-jobs.lst)
411 # NOTE: Requires xmlstarlet installed on node.
414 name: integration-list-jobs
416 - shell: !include-raw: include-raw-integration-list-jobs.sh
418 # Macro: integration-replace-block-text
419 # Operation: using starting and ending regex to
420 # replace a block of text in a file with the text in
421 # another file. Regex should be basic and work with sed
422 # Used by: builder-merge job template
424 # This script requires the following JJB variables to be passed in:
427 # {file-with-changes-to-insert}
431 name: integration-replace-block-text
433 - shell: !include-raw: include-raw-integration-replace-block-text.sh
437 name: integration-compare-distributions
438 # Operation: will compare an already created distribtion (probably last
439 # published to nexus) to the current distribution being created.
440 # The comparison is done to find the list of patches that are new to the
441 # current distribution.
442 # Required bash variables:
443 # KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
445 - shell: !include-raw: include-raw-integration-compare-distributions.sh
448 name: integration-upload-distribution
449 # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
451 # {dist-pom} path to pom file containing the version
452 # Required bash variables:
453 # KARAF_VERSION: 'karaf4' or 'karaf3'.
454 # Use distribution-karaf-version macro to customize.
456 - config-file-provider:
458 - file-id: odl-global-settings
459 variable: GLOBAL_SETTINGS_FILE
460 - file-id: integration-settings
461 variable: SETTINGS_FILE
462 - integration-set-variables
464 properties-content: BUNDLE_POM={dist-pom}
465 - shell: !include-raw-escape: integration-upload-distribution.sh
467 properties-file: integration-upload-distribution.env
473 # Macro: integration-robot
474 # Operation: this macro publishes robot results
475 # Used by: {project}-csit-* job templates
478 name: integration-robot
483 unstable-threshold: '{unstable-if}'
484 pass-threshold: '{pass-if}'
488 name: integration-robot-tempest
493 - tempest_results.html
494 unstable-threshold: '{unstable-if}'
495 pass-threshold: '{pass-if}'
499 name: integration-csit-archive-build
505 mkdir -p $WORKSPACE/archives
506 curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
507 unzip -d $WORKSPACE/archives robot-plugin.zip
508 mv *log* *.log *.log.gz *.csv *.png $WORKSPACE/archives || true # Don't fail if file missing
509 script-only-if-succeeded: 'False'
510 script-only-if-failed: 'False'
511 mark-unstable-if-failed: 'True'