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