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