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