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