Merge "create merge jobs for octopus for master and stable arno"
[releng.git] / jjb / functest / functest.yml
1 ###################################
2 # job configuration for functest
3 ###################################
4 - project:
5     name: functest
6     pod:
7         - opnfv-jump-1:
8             node: 'opnfv-jump-1'
9             installer_type: 'fuel'
10             installer_ip: '10.20.0.2'
11         - opnfv-jump-2:
12             node: 'opnfv-jump-2'
13             installer_type: 'foreman'
14             installer_ip: '172.30.10.73'
15         - orange-build:
16             node: 'orange-build'
17             installer_type: 'foreman'
18             installer_ip: '172.30.10.73'
19     jobs:
20         - 'functest-{pod}'
21         - 'set-functest-env-{pod}'
22         - 'clean-functest-env-{pod}'
23         - 'functest-openstack-bench-test-{pod}'
24         - 'functest-openstack-tempest-smoke-test-{pod}'
25         - 'functest-odl-test-{pod}'
26         - 'functest-vims-test-{pod}'
27         - 'functest-vping-test-{pod}'
28         - 'functest-daily-{stream}'
29         - 'functest-merge'
30         - 'functest-verify-{stream}'
31
32     # stream:    branch with - in place of / (eg. stable-arno)
33     # branch:    branch (eg. stable/arno)
34     stream:
35         - master:
36             branch: 'master'
37             gs-pathname: ''
38         - stable-arno:
39             branch: 'stable/arno'
40             gs-pathname: '/arno'
41
42     project: 'functest'
43     somevar: 'foo'
44 ################################
45 # job template
46 ################################
47 - job-template:
48     name: set-functest-env-{pod}
49
50     project-type: freestyle
51
52     node: '{pod}'
53
54     logrotate:
55         daysToKeep: 30
56         numToKeep: 10
57         artifactDaysToKeep: -1
58         artifactNumToKeep: -1
59
60     builders:
61         - shell: |
62             #!/bin/bash
63             set +e
64
65             echo "Functest: prepare Functest environment"
66             mkdir -p $HOME/functest/
67             # source openstack vars
68             if [[ ! -f $HOME/opnfv-openrc.sh ]]; then
69                 echo "Unable to access file $HOME/opnfv-openrc.sh"
70                 exit 1
71             fi
72             source $HOME/opnfv-openrc.sh
73
74             # WORKSPACE is the root of the functest repo
75             # go into WORKSPACE where the functest repo is cloned
76             cd $WORKSPACE
77
78             # prepare
79             echo "Functest: prepare Functest environment"
80             python $WORKSPACE/testcases/config_functest.py --debug $WORKSPACE/ start
81
82 - job-template:
83     name: clean-functest-env-{pod}
84
85     project-type: freestyle
86
87     node: '{pod}'
88
89     logrotate:
90         daysToKeep: 30
91         numToKeep: 10
92         artifactDaysToKeep: -1
93         artifactNumToKeep: -1
94
95     builders:
96         - shell: |
97             #!/bin/bash
98             set +e
99
100             # collect results
101             echo "Functest: copy results and clean Functest environment"
102             mkdir -p $HOME/functest/results
103
104             # save ODL results
105             cp -Rf $WORSPACE/testcases/Controllers/ODL/CI/logs $HOME/functest/results/ODL
106
107             # save tempest.conf for further troubleshooting
108             cp $HOME/.rally/tempest/for-deployment-*/tempest.conf $HOME/functest/results
109
110             # cleanup
111             python $WORKSPACE/testcases/config_functest.py --debug --force $WORKSPACE/ clean
112
113 - job-template:
114     name: functest-openstack-bench-test-{pod}
115
116     project-type: freestyle
117
118     node: '{pod}'
119
120     logrotate:
121         daysToKeep: 30
122         numToKeep: 10
123         artifactDaysToKeep: -1
124         artifactNumToKeep: -1
125
126     builders:
127         - shell: |
128             #!/bin/bash
129             set +e
130
131             echo "Functest: run Functest Rally Bench suites"
132             python $WORKSPACE/testcases/VIM/OpenStack/CI/libraries/run_rally.py --debug $WORKSPACE/ all
133
134 - job-template:
135     name: functest-openstack-tempest-smoke-test-{pod}
136
137     project-type: freestyle
138
139     node: '{pod}'
140
141     logrotate:
142         daysToKeep: 30
143         numToKeep: 10
144         artifactDaysToKeep: -1
145         artifactNumToKeep: -1
146
147     builders:
148         - shell: |
149             #!/bin/bash
150             set +e
151
152             # tempest
153             echo "Functest: run Tempest suite"
154             rally verify start smoke
155             rally verify list
156
157 - job-template:
158     name: functest-odl-test-{pod}
159
160     project-type: freestyle
161
162     node: '{pod}'
163
164     logrotate:
165         daysToKeep: 30
166         numToKeep: 10
167         artifactDaysToKeep: -1
168         artifactNumToKeep: -1
169
170     builders:
171         - shell: |
172             #!/bin/bash
173             set +e
174
175             echo "Functest: run ODL suite"
176             $WORKSPACE/testcases/Controllers/ODL/CI/start_tests.sh
177
178 - job-template:
179     name: functest-vims-test-{pod}
180
181     project-type: freestyle
182
183     node: '{pod}'
184
185     logrotate:
186         daysToKeep: 30
187         numToKeep: 10
188         artifactDaysToKeep: -1
189         artifactNumToKeep: -1
190
191     builders:
192         - shell: |
193             echo "put your CI scenario here"
194
195
196 - job-template:
197     name: functest-vping-test-{pod}
198
199     project-type: freestyle
200
201     node: '{pod}'
202
203     logrotate:
204         daysToKeep: 30
205         numToKeep: 10
206         artifactDaysToKeep: -1
207         artifactNumToKeep: -1
208
209     builders:
210         - shell: |
211             #!/bin/bash
212             set +e
213
214             # vPing
215             echo "Functest: run vPing"
216             python $WORKSPACE/testcases/vPing/CI/libraries/vPing.py --debug $WORKSPACE/
217
218 - job-template:
219     name: functest-{pod}
220
221     project-type: freestyle
222
223     node: '{pod}'
224
225     parameters:
226         - project-parameter:
227             project: '{project}'
228         - string:
229             name: INSTALLER_TYPE
230             default: '{installer_type}'
231             description: "Installer name that is used for deployment."
232         - string:
233             name: INSTALLER_IP
234             default: '{installer_ip}'
235             description: "Installer IP."
236         - '{pod}'
237
238     scm:
239         - git-scm:
240             credentials-id: '{ssh-credentials}'
241             refspec: ''
242             branch: master
243
244     logrotate:
245         daysToKeep: 30
246         numToKeep: 10
247         artifactDaysToKeep: -1
248         artifactNumToKeep: -1
249
250     builders:
251         - 'functest-fetch-os-creds'
252         - 'functest-all'
253         - 'functest-store-results'
254         - 'functest-cleanup'
255
256 - job-template:
257     name: 'functest-daily-{stream}'
258
259     node: master
260
261     # Job template for daily builders
262     #
263     # Required Variables:
264     #     stream:    branch with - in place of / (eg. stable)
265     #     branch:    branch (eg. stable)
266
267     project-type: freestyle
268     varsetabove: '{somevar}'
269
270     logrotate:
271         daysToKeep: '{build-days-to-keep}'
272         numToKeep: '{build-num-to-keep}'
273         artifactDaysToKeep: '{build-artifact-days-to-keep}'
274         artifactNumToKeep: '{build-artifact-num-to-keep}'
275
276     parameters:
277         - project-parameter:
278             project: '{project}'
279         - functest-parameter:
280             gs-pathname: '{gs-pathname}'
281
282     scm:
283         - git-scm:
284             credentials-id: '{ssh-credentials}'
285             refspec: ''
286             branch: '{stream}'
287
288     wrappers:
289         - ssh-agent-credentials:
290             user: '{ssh-credentials}'
291
292     triggers:
293         - 'functest-{stream}'
294
295     prebuilders:
296         - test-macro
297
298     builders:
299         - shell:
300             !include-raw ../opnfvdocs/docu-build.sh
301
302     postbuilders:
303         - test-macro
304
305 - job-template:
306     name: 'functest-verify-{stream}'
307
308     node: master
309
310     project-type: freestyle
311
312     logrotate:
313         daysToKeep: 30
314         numToKeep: 10
315         artifactDaysToKeep: -1
316         artifactNumToKeep: -1
317
318     parameters:
319         - project-parameter:
320             project: '{project}'
321         - gerrit-parameter:
322             branch: '{branch}'
323     scm:
324         - gerrit-trigger-scm:
325             credentials-id: '{ssh-credentials}'
326             refspec: '$GERRIT_REFSPEC'
327             choosing-strategy: 'gerrit'
328
329     wrappers:
330         - ssh-agent-credentials:
331             user: '{ssh-credentials}'
332
333     triggers:
334         - gerrit:
335             trigger-on:
336                 - patchset-created-event:
337                     exclude-drafts: 'false'
338                     exclude-trivial-rebase: 'false'
339                     exclude-no-code-change: 'false'
340                 - draft-published-event
341                 - comment-added-contains-event:
342                     comment-contains-value: 'recheck'
343                 - comment-added-contains-event:
344                     comment-contains-value: 'reverify'
345             projects:
346               - project-compare-type: 'ANT'
347                 project-pattern: 'functest'
348                 branches:
349                   - branch-compare-type: 'ANT'
350                     branch-pattern: '**/{branch}'
351
352     builders:
353         - shell:
354             !include-raw ../opnfvdocs/docu-build.sh
355
356 - job-template:
357     name: 'functest-merge'
358
359     node: master
360
361     # builder-merge job to run JJB update
362     #
363     # This job's purpose is to update all the JJB
364
365     project-type: freestyle
366
367     logrotate:
368         daysToKeep: 30
369         numToKeep: 40
370         artifactDaysToKeep: -1
371         artifactNumToKeep: 5
372
373     parameters:
374         - project-parameter:
375             project: '{project}'
376         - gerrit-parameter:
377             branch: 'master'
378
379     scm:
380         - gerrit-trigger-scm:
381             credentials-id: '{ssh-credentials}'
382             refspec: ''
383             choosing-strategy: 'default'
384
385     wrappers:
386         - ssh-agent-credentials:
387             user: '{ssh-credentials}'
388
389     triggers:
390         - gerrit:
391             trigger-on:
392                 - change-merged-event
393                 - comment-added-contains-event:
394                     comment-contains-value: 'remerge'
395             projects:
396               - project-compare-type: 'ANT'
397                 project-pattern: 'functest'
398                 branches:
399                     - branch-compare-type: 'ANT'
400                       branch-pattern: '**/master'
401
402     builders:
403         - shell:
404             !include-raw ../opnfvdocs/docu-build.sh
405
406 ########################
407 # parameter macros
408 ########################
409 - parameter:
410     name: functest-parameter
411     parameters:
412         - string:
413             name: GS_PATHNAME
414             default: '{gs-pathname}'
415             description: "Version directory where the opnfv documents will be stored in gs repository"
416
417 - parameter:
418     name: orange-build
419     parameters:
420         - string:
421             name: GIT_BASE
422             default: https://gerrit.opnfv.org/gerrit/$PROJECT
423             description: "Override GIT_BASE"
424
425 - parameter:
426     name: opnfv-jump-1
427     parameters:
428         - string:
429             name: GIT_BASE
430             default: ssh://gerrit.opnfv.org:29418/$PROJECT
431             description: "Override GIT_BASE"
432
433 - parameter:
434     name: opnfv-jump-2
435     parameters:
436         - string:
437             name: GIT_BASE
438             default: ssh://gerrit.opnfv.org:29418/$PROJECT
439             description: "Override GIT_BASE"
440 ########################
441 # trigger macros
442 ########################
443 - trigger:
444     name: 'functest-master'
445     triggers:
446         - pollscm: "H 9 * * *"
447
448 - trigger:
449     name: 'functest-stable-arno'
450     triggers:
451         - pollscm: "H 21 * * *"
452
453 ########################
454 # builder macros
455 ########################
456 # macros
457 - builder:
458     name: functest-all
459     builders:
460         - shell: |
461             #!/bin/bash
462             set +e
463
464             echo "Functest: prepare Functest environment"
465             mkdir -p $HOME/functest/
466             source $HOME/functest/opnfv-openrc.sh
467
468             # WORKSPACE is the root of the functest repo
469             # go into WORKSPACE where the functest repo is cloned
470             cd $WORKSPACE
471
472             # prepare
473             echo "Functest: prepare Functest environment"
474             python $WORKSPACE/testcases/config_functest.py --debug $WORKSPACE/ start
475
476             # vPing
477             echo "Functest: run vPing"
478             python $WORKSPACE/testcases/vPing/CI/libraries/vPing.py --debug $WORKSPACE/
479
480             # ODL
481             echo "Functest: run ODL suite"
482             $WORKSPACE/testcases/Controllers/ODL/CI/start_tests.sh
483
484             # rally
485             echo "Functest: run Functest Rally Bench suites"
486             python $WORKSPACE/testcases/VIM/OpenStack/CI/libraries/run_rally.py --debug $WORKSPACE/ all
487
488             # tempest
489             echo "Functest: run Tempest suite"
490             rally verify start smoke
491             rally verify list
492
493             # collect results
494             echo "Functest: copy results and clean Functest environment"
495             mkdir -p $HOME/functest/results
496
497             # save ODL results
498             cp -Rf $WORKSPACE/testcases/Controllers/ODL/CI/logs $HOME/functest/results/ODL
499
500             # save tempest.conf for further troubleshooting
501             cp $HOME/.rally/tempest/for-deployment-*/tempest.conf $HOME/functest/results
502
503 - builder:
504     name: functest-store-results
505     builders:
506         - shell:
507             !include-raw res-build.sh
508
509 - builder:
510     name: functest-cleanup
511     builders:
512         - shell: |
513             #!/bin/bash
514             set +e
515
516             # cleanup
517             python $WORKSPACE/testcases/config_functest.py --debug --force $WORKSPACE/ clean
518
519 - builder:
520     name: functest-fetch-os-creds
521     builders:
522         - shell:
523             !include-raw ../../utils/fetch_os_creds.sh