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