78a02067bb3237d36d9214b043e09a40f8043f56
[releng.git] / jjb / functest / functest.yaml
1 ---
2 - functest-containers: &functest-containers
3     name: 'functest-containers'
4     repo: '{repo}'
5     port: '{port}'
6     container: '{container}'
7     tag: '{tag}'
8
9 - functest-params: &functest-params
10     name: 'functest-params'
11     repo: 'opnfv'
12     port:
13     tag:
14       - latest:
15           from:
16           build_args:
17           branch: master
18           slave: lf-pod4-2
19           DASHBOARD_URL: http://172.30.12.85
20           dependency: 3.14
21       - xena:
22           from:
23           build_args:
24           branch: stable/xena
25           slave: laas-xena
26           DASHBOARD_URL: http://172.30.12.85
27           dependency: 3.14
28       - wallaby:
29           from:
30           build_args:
31           branch: stable/wallaby
32           slave: lf-virtual6
33           DASHBOARD_URL: http://172.30.13.91
34           dependency: 3.13
35       - leguer:
36           from:
37           build_args:
38           branch: stable/leguer
39           slave: lf-virtual9
40           DASHBOARD_URL: http://172.30.13.94
41           dependency: 3.12
42       - kali:
43           from:
44           build_args:
45           branch: stable/kali
46           slave: lf-pod4-3
47           DASHBOARD_URL: http://172.30.12.88
48           dependency: 3.11
49       - jerma:
50           from:
51           build_args:
52           branch: stable/jerma
53           slave: lf-pod4
54           DASHBOARD_URL: http://172.30.12.83
55           dependency: 3.10
56
57 - functest-jobs: &functest-jobs
58     name: 'functest-jobs'
59     current-parameters: true
60
61 - parameter:
62     name: functest-slave
63     parameters:
64       - label:
65           name: slave
66           default: '{slave}'
67
68 - parameter:
69     name: functest-build_tag
70     parameters:
71       - random-string:
72           name: build_tag
73
74 - parameter:
75     name: functest-EXTERNAL_NETWORK
76     parameters:
77       - string:
78           name: EXTERNAL_NETWORK
79           default: public
80
81 - parameter:
82     name: functest-VOLUME_DEVICE_NAME
83     parameters:
84       - string:
85           name: VOLUME_DEVICE_NAME
86           default: sdb
87
88 - parameter:
89     name: functest-IMAGE_PROPERTIES
90     parameters:
91       - string:
92           name: IMAGE_PROPERTIES
93           default: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
94
95 - functest-run-containers: &functest-run-containers
96     name: 'functest-run-containers'
97     <<: *functest-containers
98     test: '{test}'
99     privileged: '{privileged}'
100     volumes: '{volumes}'
101     env: '{env}'
102     network: '{network}'
103     DASHBOARD_URL: '{DASHBOARD_URL}'
104
105 - builder:
106     name: functest-pull-containers
107     builders:
108       - shell: |
109           set +x
110           if [ "{repo}" = "_" ]; then
111             image={container}:{tag}
112           elif [ "{port}" = "None" ]; then
113             image={repo}/{container}:{tag}
114           else
115             image={repo}:{port}/{container}:{tag}
116           fi
117           sudo docker pull $image
118
119 - builder:
120     name: functest-run-containers
121     builders:
122       - shell: |
123           set +x
124           volumes=;
125           if [ "{volumes}" != "None" ]; then
126             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
127               do volumes="-v $i $volumes"; done
128           fi
129           env=;
130           if [ "{env}" != "None" ]; then
131             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
132               do env="-e $i $env"; done
133           fi
134           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
135           if [ "{repo}" = "_" ]; then
136             image={container}:{tag}
137           elif [ "{port}" = "None" ]; then
138             image={repo}/{container}:{tag}
139           else
140             image={repo}:{port}/{container}:{tag}
141           fi
142           sudo docker run --rm \
143             --privileged={privileged} \
144             --network={network} \
145             $volumes \
146             $env \
147             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
148             -e S3_DST_URL=s3://artifacts.opnfv.org/functest/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
149             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
150             -v /home/opnfv/functest/.boto:/root/.boto \
151             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
152             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
153             -e NODE_NAME=$slave \
154             -e BUILD_TAG=$BUILD_TAG \
155             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
156             -e DASHBOARD_URL={DASHBOARD_URL} \
157             $image run_tests -t {test} -p -r
158
159 - builder:
160     name: functest-remove-images
161     builders:
162       - shell: |
163           set +x
164           if [ "{repo}" = "_" ]; then
165             image={container}:{tag}
166           elif [ "{port}" = "None" ]; then
167             image={repo}/{container}:{tag}
168           else
169             image={repo}:{port}/{container}:{tag}
170           fi
171           sudo docker rmi $image || true
172
173 - job-template:
174     name: 'functest-{repo}-{container}-{tag}-pull'
175     parameters:
176       - functest-slave:
177           slave: '{slave}'
178     builders:
179       - functest-pull-containers:
180           <<: *functest-containers
181
182 - project:
183     name: 'functest-opnfv-functest-healthcheck-pull'
184     <<: *functest-params
185     container: 'functest-healthcheck'
186     jobs:
187       - 'functest-{repo}-{container}-{tag}-pull'
188
189 - project:
190     name: 'functest-opnfv-functest-smoke-pull'
191     <<: *functest-params
192     container: 'functest-smoke'
193     jobs:
194       - 'functest-{repo}-{container}-{tag}-pull'
195
196 - project:
197     name: 'functest-opnfv-functest-smoke-cntt-pull'
198     <<: *functest-params
199     container: 'functest-smoke-cntt'
200     jobs:
201       - 'functest-{repo}-{container}-{tag}-pull'
202
203 - project:
204     name: 'functest-opnfv-functest-benchmarking-pull'
205     <<: *functest-params
206     container: 'functest-benchmarking'
207     jobs:
208       - 'functest-{repo}-{container}-{tag}-pull'
209
210 - project:
211     name: 'functest-opnfv-functest-benchmarking-cntt-pull'
212     <<: *functest-params
213     container: 'functest-benchmarking-cntt'
214     jobs:
215       - 'functest-{repo}-{container}-{tag}-pull'
216
217 - project:
218     name: 'functest-opnfv-functest-vnf-pull'
219     <<: *functest-params
220     container: 'functest-vnf'
221     jobs:
222       - 'functest-{repo}-{container}-{tag}-pull'
223
224 - job-template:
225     name: 'functest-{repo}-{container}-{tag}-rmi'
226     parameters:
227       - functest-slave:
228           slave: '{slave}'
229     builders:
230       - functest-remove-images:
231           <<: *functest-containers
232
233 - project:
234     name: 'functest-opnfv-functest-healthcheck-rmi'
235     <<: *functest-params
236     container: 'functest-healthcheck'
237     jobs:
238       - 'functest-{repo}-{container}-{tag}-rmi'
239
240 - project:
241     name: 'functest-opnfv-functest-smoke-rmi'
242     <<: *functest-params
243     container: 'functest-smoke'
244     jobs:
245       - 'functest-{repo}-{container}-{tag}-rmi'
246
247 - project:
248     name: 'functest-opnfv-functest-smoke-cntt-rmi'
249     <<: *functest-params
250     container: 'functest-smoke-cntt'
251     jobs:
252       - 'functest-{repo}-{container}-{tag}-rmi'
253
254 - project:
255     name: 'functest-opnfv-functest-benchmarking-rmi'
256     <<: *functest-params
257     container: 'functest-benchmarking'
258     jobs:
259       - 'functest-{repo}-{container}-{tag}-rmi'
260
261 - project:
262     name: 'functest-opnfv-functest-benchmarking-cntt-rmi'
263     <<: *functest-params
264     container: 'functest-benchmarking-cntt'
265     jobs:
266       - 'functest-{repo}-{container}-{tag}-rmi'
267
268 - project:
269     name: 'functest-opnfv-functest-vnf-rmi'
270     <<: *functest-params
271     container: 'functest-vnf'
272     jobs:
273       - 'functest-{repo}-{container}-{tag}-rmi'
274
275 - job-template:
276     name: 'functest-opnfv-functest-healthcheck-{tag}-{test}-run'
277     parameters:
278       - functest-slave:
279           slave: '{slave}'
280       - functest-build_tag:
281           build_tag: ''
282       - functest-EXTERNAL_NETWORK:
283           EXTERNAL_NETWORK: public
284       - functest-VOLUME_DEVICE_NAME:
285           VOLUME_DEVICE_NAME: sdb
286       - functest-IMAGE_PROPERTIES:
287           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
288     builders:
289       - functest-run-containers:
290           <<: *functest-run-containers
291
292 - project:
293     name: 'functest-opnfv-functest-healthcheck'
294     <<: *functest-params
295     volumes:
296       - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
297       - /home/opnfv/functest/images:/home/opnfv/functest/images
298     env:
299       - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
300       - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
301       - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
302     container: 'functest-healthcheck'
303     test:
304       - connection_check
305       - tenantnetwork1
306       - tenantnetwork2
307       - vmready1
308       - vmready2
309       - singlevm1
310       - singlevm2
311       - vping_ssh
312       - vping_userdata
313       - cinder_test
314       - odl
315       - tempest_smoke
316       - tempest_horizon
317     privileged: 'false'
318     network: bridge
319     jobs:
320       - 'functest-opnfv-functest-healthcheck-{tag}-{test}-run'
321
322 - job-template:
323     name: 'functest-opnfv-functest-smoke-{tag}-{test}-run'
324     parameters:
325       - functest-slave:
326           slave: '{slave}'
327       - functest-build_tag:
328           build_tag: ''
329       - functest-EXTERNAL_NETWORK:
330           EXTERNAL_NETWORK: public
331       - functest-VOLUME_DEVICE_NAME:
332           VOLUME_DEVICE_NAME: sdb
333       - functest-IMAGE_PROPERTIES:
334           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
335     builders:
336       - functest-run-containers:
337           <<: *functest-run-containers
338
339 - project:
340     name: 'functest-opnfv-functest-smoke'
341     <<: *functest-params
342     volumes:
343       - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
344       - /home/opnfv/functest/images:/home/opnfv/functest/images
345     env:
346       - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
347       - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
348       - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
349     container: 'functest-smoke'
350     test:
351       - tempest_neutron
352       - tempest_cinder
353       - tempest_keystone
354       - tempest_heat
355       - tempest_telemetry
356       - rally_sanity
357       - refstack_defcore
358       - refstack_compute
359       - refstack_object
360       - refstack_platform
361       - tempest_full
362       - tempest_scenario
363       - tempest_slow
364       - patrole
365       - patrole_admin
366       - patrole_member
367       - patrole_reader
368       - networking-bgpvpn
369       - networking-sfc
370       - tempest_barbican
371       - tempest_octavia
372       - tempest_cyborg
373     privileged: 'false'
374     network: bridge
375     exclude:
376       - tag: latest
377         test: refstack_defcore
378       - tag: latest
379         test: networking-bgpvpn
380       - tag: latest
381         test: networking-sfc
382       - tag: latest
383         test: patrole
384       - tag: xena
385         test: refstack_defcore
386       - tag: xena
387         test: networking-bgpvpn
388       - tag: xena
389         test: networking-sfc
390       - tag: xena
391         test: patrole
392       - tag: wallaby
393         test: refstack_defcore
394       - tag: wallaby
395         test: networking-bgpvpn
396       - tag: wallaby
397         test: networking-sfc
398       - tag: wallaby
399         test: patrole
400       - tag: leguer
401         test: refstack_defcore
402       - tag: leguer
403         test: networking-bgpvpn
404       - tag: leguer
405         test: networking-sfc
406       - tag: leguer
407         test: patrole
408       - tag: kali
409         test: refstack_defcore
410       - tag: kali
411         test: networking-bgpvpn
412       - tag: kali
413         test: networking-sfc
414       - tag: kali
415         test: patrole_admin
416       - tag: kali
417         test: patrole_member
418       - tag: kali
419         test: patrole_reader
420       - tag: jerma
421         test: refstack_defcore
422       - tag: jerma
423         test: networking-bgpvpn
424       - tag: jerma
425         test: networking-sfc
426       - tag: jerma
427         test: patrole_admin
428       - tag: jerma
429         test: patrole_member
430       - tag: jerma
431         test: patrole_reader
432       - tag: jerma
433         test: tempest_cyborg
434     jobs:
435       - 'functest-opnfv-functest-smoke-{tag}-{test}-run'
436
437 - job-template:
438     name: 'functest-opnfv-functest-smoke-cntt-{tag}-{test}-run'
439     parameters:
440       - functest-slave:
441           slave: '{slave}'
442       - functest-build_tag:
443           build_tag: ''
444       - functest-EXTERNAL_NETWORK:
445           EXTERNAL_NETWORK: public
446       - functest-VOLUME_DEVICE_NAME:
447           VOLUME_DEVICE_NAME: sdb
448       - functest-IMAGE_PROPERTIES:
449           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
450     builders:
451       - functest-run-containers:
452           <<: *functest-run-containers
453
454 - project:
455     name: 'functest-opnfv-functest-smoke-cntt'
456     <<: *functest-params
457     volumes:
458       - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
459       - /home/opnfv/functest/images:/home/opnfv/functest/images
460     env:
461       - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
462       - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
463       - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
464     container: 'functest-smoke-cntt'
465     test:
466       - tempest_neutron_cntt
467       - tempest_cinder_cntt
468       - tempest_keystone_cntt
469       - tempest_heat_cntt
470       - rally_sanity_cntt
471       - tempest_full_cntt
472       - tempest_scenario_cntt
473       - tempest_slow_cntt
474     privileged: 'false'
475     network: bridge
476     jobs:
477       - 'functest-opnfv-functest-smoke-cntt-{tag}-{test}-run'
478
479 - job-template:
480     name: 'functest-opnfv-functest-benchmarking-{tag}-{test}-run'
481     parameters:
482       - functest-slave:
483           slave: '{slave}'
484       - functest-build_tag:
485           build_tag: ''
486       - functest-EXTERNAL_NETWORK:
487           EXTERNAL_NETWORK: public
488       - functest-VOLUME_DEVICE_NAME:
489           VOLUME_DEVICE_NAME: sdb
490       - functest-IMAGE_PROPERTIES:
491           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
492     builders:
493       - functest-run-containers:
494           <<: *functest-run-containers
495
496 - project:
497     name: 'functest-opnfv-functest-benchmarking'
498     <<: *functest-params
499     volumes:
500       - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
501       - /home/opnfv/functest/images:/home/opnfv/functest/images
502     env:
503       - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
504       - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
505       - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
506     container: 'functest-benchmarking'
507     test:
508       - rally_full
509       - rally_jobs
510       - vmtp
511       - shaker
512     privileged: 'false'
513     network: bridge
514     jobs:
515       - 'functest-opnfv-functest-benchmarking-{tag}-{test}-run'
516
517 - job-template:
518     name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-{test}-run'
519     parameters:
520       - functest-slave:
521           slave: '{slave}'
522       - functest-build_tag:
523           build_tag: ''
524       - functest-EXTERNAL_NETWORK:
525           EXTERNAL_NETWORK: public
526       - functest-VOLUME_DEVICE_NAME:
527           VOLUME_DEVICE_NAME: sdb
528       - functest-IMAGE_PROPERTIES:
529           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
530     builders:
531       - functest-run-containers:
532           <<: *functest-run-containers
533
534 - project:
535     name: 'functest-opnfv-functest-benchmarking-cntt'
536     <<: *functest-params
537     volumes:
538       - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
539       - /home/opnfv/functest/images:/home/opnfv/functest/images
540     env:
541       - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
542       - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
543       - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
544     container: 'functest-benchmarking-cntt'
545     test:
546       - rally_full_cntt
547       - rally_jobs_cntt
548     privileged: 'false'
549     network: bridge
550     jobs:
551       - 'functest-opnfv-functest-benchmarking-cntt-{tag}-{test}-run'
552
553 - job-template:
554     name: 'functest-opnfv-functest-vnf-{tag}-{test}-run'
555     parameters:
556       - functest-slave:
557           slave: '{slave}'
558       - functest-build_tag:
559           build_tag: ''
560       - functest-EXTERNAL_NETWORK:
561           EXTERNAL_NETWORK: public
562       - functest-VOLUME_DEVICE_NAME:
563           VOLUME_DEVICE_NAME: sdb
564       - functest-IMAGE_PROPERTIES:
565           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
566     builders:
567       - functest-run-containers:
568           <<: *functest-run-containers
569
570 - project:
571     name: 'functest-opnfv-functest-vnf'
572     <<: *functest-params
573     volumes:
574       - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
575       - /home/opnfv/functest/images:/home/opnfv/functest/images
576     env:
577       - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
578       - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
579       - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
580     container: 'functest-vnf'
581     test:
582       - cloudify
583       - cloudify_ims
584       - heat_ims
585       - vyos_vrouter
586       - juju_epc
587     privileged: 'false'
588     network: bridge
589     jobs:
590       - 'functest-opnfv-functest-vnf-{tag}-{test}-run'
591
592 - builder:
593     name: functest-zip
594     builders:
595       - shell: |
596           set +x
597           volumes=;
598           if [ "{volumes}" != "None" ]; then
599             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
600               do volumes="-v $i $volumes"; done
601           fi
602           env=;
603           if [ "{env}" != "None" ]; then
604             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
605               do env="-e $i $env"; done
606           fi
607           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
608           if [ "{repo}" = "_" ]; then
609             image={container}:{tag}
610           elif [ "{port}" = "None" ]; then
611             image={repo}/{container}:{tag}
612           else
613             image={repo}:{port}/{container}:{tag}
614           fi
615           sudo docker run --rm \
616             $volumes \
617             $env \
618             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
619             -e S3_DST_URL=s3://artifacts.opnfv.org/functest \
620             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest \
621             -v /home/opnfv/functest/.boto:/root/.boto \
622             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
623             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
624             -e BUILD_TAG=$BUILD_TAG \
625             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
626             $image zip_campaign
627
628 - job-template:
629     name: 'functest-{tag}-zip'
630     parameters:
631       - functest-slave:
632           slave: '{slave}'
633       - functest-build_tag:
634           build_tag: ''
635       - functest-EXTERNAL_NETWORK:
636           EXTERNAL_NETWORK: public
637       - functest-VOLUME_DEVICE_NAME:
638           VOLUME_DEVICE_NAME: sdb
639       - functest-IMAGE_PROPERTIES:
640           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
641     builders:
642       - functest-zip:
643           <<: *functest-containers
644           volumes: '{volumes}'
645           env: '{env}'
646
647 - project:
648     name: 'functest-{tag}-zip'
649     <<: *functest-params
650     volumes:
651       - /home/opnfv/functest/openstack.creds:/home/opnfv/functest/conf/env_file
652       - /home/opnfv/functest/images:/home/opnfv/functest/images
653     env:
654       - EXTERNAL_NETWORK=$EXTERNAL_NETWORK
655       - VOLUME_DEVICE_NAME=$VOLUME_DEVICE_NAME
656       - IMAGE_PROPERTIES=$IMAGE_PROPERTIES
657     container: 'functest-healthcheck'
658     jobs:
659       - 'functest-{tag}-zip'
660
661 - job-template:
662     name: 'functest-{tag}-daily'
663     project-type: multijob
664     triggers:
665       - timed: '@weekly'
666     parameters:
667       - functest-slave:
668           slave: '{slave}'
669       - functest-build_tag:
670           build_tag: ''
671       - functest-EXTERNAL_NETWORK:
672           EXTERNAL_NETWORK: public
673       - functest-VOLUME_DEVICE_NAME:
674           VOLUME_DEVICE_NAME: sdb
675       - functest-IMAGE_PROPERTIES:
676           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
677     # PyYAML and yamllint differ here
678     # see https://github.com/yaml/pyyaml/issues/234
679     # yamllint disable rule:indentation
680     properties:
681       - build-blocker:
682           blocking-jobs:
683           - ^functest-(pi-)*{tag}-(daily|docker|review)$
684     # yamllint enable rule:indentation
685     builders:
686       - multijob:
687           name: remove former images
688           projects:
689             - name: 'functest-opnfv-functest-healthcheck-{tag}-rmi'
690               <<: *functest-jobs
691             - name: 'functest-opnfv-functest-smoke-{tag}-rmi'
692               <<: *functest-jobs
693             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-rmi'
694               <<: *functest-jobs
695             - name: 'functest-opnfv-functest-benchmarking-{tag}-rmi'
696               <<: *functest-jobs
697             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-rmi'
698               <<: *functest-jobs
699             - name: 'functest-opnfv-functest-vnf-{tag}-rmi'
700               <<: *functest-jobs
701       - multijob:
702           name: pull containers
703           projects:
704             - name: 'functest-opnfv-functest-healthcheck-{tag}-pull'
705               <<: *functest-jobs
706             - name: 'functest-opnfv-functest-smoke-{tag}-pull'
707               <<: *functest-jobs
708             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-pull'
709               <<: *functest-jobs
710             - name: 'functest-opnfv-functest-benchmarking-{tag}-pull'
711               <<: *functest-jobs
712             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-pull'
713               <<: *functest-jobs
714             - name: 'functest-opnfv-functest-vnf-{tag}-pull'
715               <<: *functest-jobs
716       - multijob:
717           name: opnfv/functest-healthcheck:{tag}
718           projects:
719             - name: 'functest-opnfv-functest-healthcheck-{tag}-connection_check-run'
720               <<: *functest-jobs
721             - name: 'functest-opnfv-functest-healthcheck-{tag}-tenantnetwork1-run'
722               <<: *functest-jobs
723             - name: 'functest-opnfv-functest-healthcheck-{tag}-tenantnetwork2-run'
724               <<: *functest-jobs
725             - name: 'functest-opnfv-functest-healthcheck-{tag}-vmready1-run'
726               <<: *functest-jobs
727             - name: 'functest-opnfv-functest-healthcheck-{tag}-vmready2-run'
728               <<: *functest-jobs
729             - name: 'functest-opnfv-functest-healthcheck-{tag}-singlevm1-run'
730               <<: *functest-jobs
731             - name: 'functest-opnfv-functest-healthcheck-{tag}-singlevm2-run'
732               <<: *functest-jobs
733             - name: 'functest-opnfv-functest-healthcheck-{tag}-vping_ssh-run'
734               <<: *functest-jobs
735             - name: 'functest-opnfv-functest-healthcheck-{tag}-vping_userdata-run'
736               <<: *functest-jobs
737             - name: 'functest-opnfv-functest-healthcheck-{tag}-cinder_test-run'
738               <<: *functest-jobs
739             - name: 'functest-opnfv-functest-healthcheck-{tag}-odl-run'
740               <<: *functest-jobs
741             - name: 'functest-opnfv-functest-healthcheck-{tag}-tempest_smoke-run'
742               <<: *functest-jobs
743             - name: 'functest-opnfv-functest-healthcheck-{tag}-tempest_horizon-run'
744               <<: *functest-jobs
745       - multijob:
746           name: opnfv/functest-smoke:{tag}
747           projects:
748             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_neutron-run'
749               <<: *functest-jobs
750             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_cinder-run'
751               <<: *functest-jobs
752             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_keystone-run'
753               <<: *functest-jobs
754             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_heat-run'
755               <<: *functest-jobs
756             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_telemetry-run'
757               <<: *functest-jobs
758             - name: 'functest-opnfv-functest-smoke-{tag}-rally_sanity-run'
759               <<: *functest-jobs
760             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_defcore-run'
761               <<: *functest-jobs
762             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_compute-run'
763               <<: *functest-jobs
764             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_object-run'
765               <<: *functest-jobs
766             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_platform-run'
767               <<: *functest-jobs
768             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_full-run'
769               <<: *functest-jobs
770             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_scenario-run'
771               <<: *functest-jobs
772             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_slow-run'
773               <<: *functest-jobs
774             - name: 'functest-opnfv-functest-smoke-{tag}-patrole-run'
775               <<: *functest-jobs
776             - name: 'functest-opnfv-functest-smoke-{tag}-patrole_admin-run'
777               <<: *functest-jobs
778             - name: 'functest-opnfv-functest-smoke-{tag}-patrole_member-run'
779               <<: *functest-jobs
780             - name: 'functest-opnfv-functest-smoke-{tag}-patrole_reader-run'
781               <<: *functest-jobs
782             - name: 'functest-opnfv-functest-smoke-{tag}-networking-bgpvpn-run'
783               <<: *functest-jobs
784             - name: 'functest-opnfv-functest-smoke-{tag}-networking-sfc-run'
785               <<: *functest-jobs
786             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_barbican-run'
787               <<: *functest-jobs
788             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_octavia-run'
789               <<: *functest-jobs
790             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_cyborg-run'
791               <<: *functest-jobs
792       - multijob:
793           name: opnfv/functest-smoke-cntt:{tag}
794           projects:
795             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_neutron_cntt-run'
796               <<: *functest-jobs
797             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_cinder_cntt-run'
798               <<: *functest-jobs
799             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_keystone_cntt-run'
800               <<: *functest-jobs
801             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_heat_cntt-run'
802               <<: *functest-jobs
803             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-rally_sanity_cntt-run'
804               <<: *functest-jobs
805             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_full_cntt-run'
806               <<: *functest-jobs
807             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_scenario_cntt-run'
808               <<: *functest-jobs
809             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_slow_cntt-run'
810               <<: *functest-jobs
811       - multijob:
812           name: opnfv/functest-benchmarking:{tag}
813           projects:
814             - name: 'functest-opnfv-functest-benchmarking-{tag}-rally_full-run'
815               <<: *functest-jobs
816             - name: 'functest-opnfv-functest-benchmarking-{tag}-rally_jobs-run'
817               <<: *functest-jobs
818             - name: 'functest-opnfv-functest-benchmarking-{tag}-vmtp-run'
819               <<: *functest-jobs
820             - name: 'functest-opnfv-functest-benchmarking-{tag}-shaker-run'
821               <<: *functest-jobs
822       - multijob:
823           name: opnfv/functest-benchmarking-cntt:{tag}
824           projects:
825             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-rally_full_cntt-run'
826               <<: *functest-jobs
827             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-rally_jobs_cntt-run'
828               <<: *functest-jobs
829       - multijob:
830           name: opnfv/functest-vnf:{tag}
831           projects:
832             - name: 'functest-opnfv-functest-vnf-{tag}-cloudify-run'
833               <<: *functest-jobs
834             - name: 'functest-opnfv-functest-vnf-{tag}-cloudify_ims-run'
835               <<: *functest-jobs
836             - name: 'functest-opnfv-functest-vnf-{tag}-heat_ims-run'
837               <<: *functest-jobs
838             - name: 'functest-opnfv-functest-vnf-{tag}-vyos_vrouter-run'
839               <<: *functest-jobs
840             - name: 'functest-opnfv-functest-vnf-{tag}-juju_epc-run'
841               <<: *functest-jobs
842       - multijob:
843           name: dump all campaign data
844           projects:
845             - name: 'functest-{tag}-zip'
846               <<: *functest-jobs
847
848 - project:
849     name: 'functest-daily'
850     <<: *functest-params
851     jobs:
852       - 'functest-{tag}-daily'
853
854 - view:
855     name: functest
856     view-type: list
857     columns:
858       - status
859       - weather
860       - job
861       - last-success
862       - last-failure
863       - last-duration
864     regex: ^functest-[a-z0-9.]+-daily$
865
866 - functest-build-containers: &functest-build-containers
867     name: 'functest-build-containers'
868     <<: *functest-containers
869     ref_arg: '{ref_arg}'
870     path: '{path}'
871     build_args: '{build_args}'
872     from: '{from}'
873
874 - builder:
875     name: functest-build-containers
876     builders:
877       - shell: |
878           set +x
879           if [ "{repo}" = "_" ]; then
880             image={container}:{tag}
881           elif [ "{port}" = "None" ]; then
882             image={repo}/{container}:{tag}
883           else
884             image={repo}:{port}/{container}:{tag}
885           fi
886           build_args=""
887           if [ "{build_args}" != "None" ]; then
888             for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
889               do build_args="--build-arg $i $build_args"; done
890           fi
891           if [ "{ref_arg}" != "None" ]; then
892             build_args="$build_args --build-arg {ref_arg}={ref}"
893           fi
894           cd {path}
895           if [ "{from}" != "None" ]; then
896               sed -i {from} Dockerfile
897           fi
898           sudo docker build $build_args \
899             --pull=false --no-cache --force-rm=true \
900             -t $image .
901
902 - scm:
903     name: functest-scm
904     scm:
905       - git:
906           url: 'https://gerrit.opnfv.org/gerrit/functest'
907           refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
908           branches:
909             - '{ref}'
910
911 - functest-dep: &functest-dep
912     name: 'functest-containers'
913     repo: '{repo}'
914     port: '{port}'
915     tag: '{tag}'
916     dependency: '{dependency}'
917
918 - builder:
919     name: functest-pull-dep-images
920     builders:
921       - shell: |
922           set +x
923           if [ "_" = "_" ]; then
924             image=alpine:{dependency}
925           elif [ "None" = "None" ]; then
926             image=_/alpine:{dependency}
927           else
928             image=_:/alpine:{dependency}
929           fi
930           sudo docker pull $image || true
931
932 - builder:
933     name: functest-remove-dep-images
934     builders:
935       - shell: |
936           set +x
937           if [ "_" = "_" ]; then
938             image=alpine:{dependency}
939           elif [ "" = "None" ]; then
940             image=_/alpine:{dependency}
941           else
942             image=_:/alpine:{dependency}
943           fi
944           sudo docker rmi $image || true
945
946 - job-template:
947     name: 'functest-{repo}-{tag}-dep-pull'
948     parameters:
949       - functest-slave:
950           slave: '{slave}'
951     builders:
952       - functest-pull-dep-images:
953           <<: *functest-dep
954
955 - project:
956     name: 'functest-{repo}-{tag}-dep-pull'
957     <<: *functest-params
958     jobs:
959       - 'functest-{repo}-{tag}-dep-pull'
960
961 - job-template:
962     name: 'functest-{repo}-{tag}-dep-rmi'
963     parameters:
964       - functest-slave:
965           slave: '{slave}'
966     builders:
967       - functest-remove-dep-images:
968           <<: *functest-dep
969
970 - project:
971     name: 'functest-{repo}-{tag}-dep-rmi'
972     <<: *functest-params
973     jobs:
974       - 'functest-{repo}-{tag}-dep-rmi'
975
976 - builder:
977     name: functest-tox
978     builders:
979       - shell: |
980           set +x
981           sudo apt-get update && \
982           sudo DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
983           sudo DEBIAN_FRONTEND=noninteractive \
984           apt-get install software-properties-common gpg -y
985           sudo add-apt-repository -y ppa:deadsnakes/ppa
986           sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
987           apt-get install \
988             python3.9 python3.9-dev python3.9-distutils \
989             python3.8 python3.8-dev python3.8-distutils \
990             python3.7 python3.7-dev python3.6 python3.6-dev \
991             python python-dev python3-pip enchant -y
992           sudo pip3 install tox tox-pip-version
993
994           tox
995
996 - job-template:
997     name: 'functest-{tag}-tox'
998     scm:
999       - functest-scm:
1000           ref: $GERRIT_REFSPEC
1001     triggers:
1002       - functest-patchset-created:
1003           branch: '{branch}'
1004     parameters:
1005       - functest-slave:
1006           slave: '{slave}'
1007     builders:
1008       - functest-tox:
1009
1010 - project:
1011     name: functest-tox
1012     <<: *functest-params
1013     jobs:
1014       - 'functest-{tag}-tox'
1015
1016 - job-template:
1017     name: 'functest-{repo}-{container}-{tag}-gate'
1018     parameters:
1019       - functest-slave:
1020           slave: '{slave}'
1021     scm:
1022       - functest-scm:
1023           ref: $GERRIT_REFSPEC
1024     builders:
1025       - functest-build-containers:
1026           <<: *functest-build-containers
1027           ref: $GERRIT_REFSPEC
1028           build_args: '{build_args}'
1029
1030 - project:
1031     name: functest-opnfv-functest-core-{tag}-gate
1032     <<: *functest-params
1033     container: functest-core
1034     ref_arg: BRANCH
1035     path: docker/core
1036     jobs:
1037       - 'functest-{repo}-{container}-{tag}-gate'
1038
1039 - project:
1040     name: functest-opnfv-functest-tempest-{tag}-gate
1041     <<: *functest-params
1042     container: functest-tempest
1043     ref_arg: BRANCH
1044     path: docker/tempest
1045     exclude:
1046       - {'tag': 'latest'}
1047       - {'tag': 'xena'}
1048       - {'tag': 'wallaby'}
1049       - {'tag': 'leguer'}
1050       - {'tag': 'kali'}
1051       - {'tag': 'jerma'}
1052     jobs:
1053       - 'functest-{repo}-{container}-{tag}-gate'
1054
1055 - project:
1056     name: functest-opnfv-functest-healthcheck-{tag}-gate
1057     <<: *functest-params
1058     container: functest-healthcheck
1059     ref_arg: BRANCH
1060     path: docker/healthcheck
1061     jobs:
1062       - 'functest-{repo}-{container}-{tag}-gate'
1063
1064 - project:
1065     name: functest-opnfv-functest-smoke-{tag}-gate
1066     <<: *functest-params
1067     container: functest-smoke
1068     ref_arg: BRANCH
1069     path: docker/smoke
1070     jobs:
1071       - 'functest-{repo}-{container}-{tag}-gate'
1072
1073 - project:
1074     name: functest-opnfv-functest-benchmarking-{tag}-gate
1075     <<: *functest-params
1076     container: functest-benchmarking
1077     ref_arg: BRANCH
1078     path: docker/benchmarking
1079     jobs:
1080       - 'functest-{repo}-{container}-{tag}-gate'
1081
1082 - project:
1083     name: functest-opnfv-functest-vnf-{tag}-gate
1084     <<: *functest-params
1085     container: functest-vnf
1086     ref_arg:
1087     path: docker/vnf
1088     jobs:
1089       - 'functest-{repo}-{container}-{tag}-gate'
1090
1091 - project:
1092     name: functest-opnfv-functest-smoke-cntt-{tag}-gate
1093     <<: *functest-params
1094     container: functest-smoke-cntt
1095     ref_arg: BRANCH
1096     path: docker/smoke-cntt
1097     jobs:
1098       - 'functest-{repo}-{container}-{tag}-gate'
1099
1100 - project:
1101     name: functest-opnfv-functest-benchmarking-cntt-{tag}-gate
1102     <<: *functest-params
1103     container: functest-benchmarking-cntt
1104     ref_arg: BRANCH
1105     path: docker/benchmarking-cntt
1106     jobs:
1107       - 'functest-{repo}-{container}-{tag}-gate'
1108
1109 - trigger:
1110     name: functest-patchset-created
1111     triggers:
1112       - gerrit:
1113           trigger-on:
1114             - patchset-created-event
1115             - comment-added-contains-event:
1116                 comment-contains-value: 'recheck'
1117             - comment-added-contains-event:
1118                 comment-contains-value: 'reverify'
1119           projects:
1120             - project-compare-type: 'ANT'
1121               project-pattern: 'functest'
1122               branches:
1123                 - branch-compare-type: 'ANT'
1124                   branch-pattern: '**/{branch}'
1125
1126 - job-template:
1127     name: 'functest-{tag}-review'
1128     project-type: multijob
1129     triggers:
1130       - functest-patchset-created:
1131           branch: '{branch}'
1132     parameters:
1133       - functest-slave:
1134           slave: '{slave}'
1135       - functest-build_tag:
1136           build_tag: ''
1137       - functest-EXTERNAL_NETWORK:
1138           EXTERNAL_NETWORK: public
1139       - functest-VOLUME_DEVICE_NAME:
1140           VOLUME_DEVICE_NAME: sdb
1141       - functest-IMAGE_PROPERTIES:
1142           IMAGE_PROPERTIES: hw_scsi_model:virtio-scsi,hw_disk_bus:scsi
1143     # PyYAML and yamllint differ here
1144     # see https://github.com/yaml/pyyaml/issues/234
1145     # yamllint disable rule:indentation
1146     properties:
1147       - build-blocker:
1148           blocking-jobs:
1149           - ^functest-(pi-)*{tag}-(daily|docker|review)$
1150     # yamllint enable rule:indentation
1151     builders:
1152       - multijob:
1153           name: remove former images
1154           projects:
1155             - name: 'functest-opnfv-functest-healthcheck-{tag}-rmi'
1156               <<: *functest-jobs
1157             - name: 'functest-opnfv-functest-smoke-{tag}-rmi'
1158               <<: *functest-jobs
1159             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-rmi'
1160               <<: *functest-jobs
1161             - name: 'functest-opnfv-functest-benchmarking-{tag}-rmi'
1162               <<: *functest-jobs
1163             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-rmi'
1164               <<: *functest-jobs
1165             - name: 'functest-opnfv-functest-vnf-{tag}-rmi'
1166               <<: *functest-jobs
1167       - multijob:
1168           name: remove dependency
1169           projects:
1170             - name: 'functest-{repo}-{tag}-dep-rmi'
1171               <<: *functest-jobs
1172       - multijob:
1173           name: pull dependency
1174           projects:
1175             - name: 'functest-{repo}-{tag}-dep-pull'
1176               <<: *functest-jobs
1177       - multijob:
1178           name: build opnfv/functest-core
1179           projects:
1180             - name: 'functest-opnfv-functest-core-{tag}-gate'
1181               <<: *functest-jobs
1182       - multijob:
1183           name: build opnfv/functest-tempest
1184           projects:
1185             - name: 'functest-opnfv-functest-tempest-{tag}-gate'
1186               <<: *functest-jobs
1187       - multijob:
1188           name: build containers
1189           projects:
1190             - name: 'functest-opnfv-functest-healthcheck-{tag}-gate'
1191               <<: *functest-jobs
1192             - name: 'functest-opnfv-functest-smoke-{tag}-gate'
1193               <<: *functest-jobs
1194             - name: 'functest-opnfv-functest-benchmarking-{tag}-gate'
1195               <<: *functest-jobs
1196             - name: 'functest-opnfv-functest-vnf-{tag}-gate'
1197               <<: *functest-jobs
1198       - multijob:
1199           name: build cntt containers
1200           projects:
1201             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-gate'
1202               <<: *functest-jobs
1203             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-gate'
1204               <<: *functest-jobs
1205       - multijob:
1206           name: opnfv/functest-healthcheck:{tag}
1207           projects:
1208             - name: 'functest-opnfv-functest-healthcheck-{tag}-connection_check-run'
1209               <<: *functest-jobs
1210             - name: 'functest-opnfv-functest-healthcheck-{tag}-tenantnetwork1-run'
1211               <<: *functest-jobs
1212             - name: 'functest-opnfv-functest-healthcheck-{tag}-tenantnetwork2-run'
1213               <<: *functest-jobs
1214             - name: 'functest-opnfv-functest-healthcheck-{tag}-vmready1-run'
1215               <<: *functest-jobs
1216             - name: 'functest-opnfv-functest-healthcheck-{tag}-vmready2-run'
1217               <<: *functest-jobs
1218             - name: 'functest-opnfv-functest-healthcheck-{tag}-singlevm1-run'
1219               <<: *functest-jobs
1220             - name: 'functest-opnfv-functest-healthcheck-{tag}-singlevm2-run'
1221               <<: *functest-jobs
1222             - name: 'functest-opnfv-functest-healthcheck-{tag}-vping_ssh-run'
1223               <<: *functest-jobs
1224             - name: 'functest-opnfv-functest-healthcheck-{tag}-vping_userdata-run'
1225               <<: *functest-jobs
1226             - name: 'functest-opnfv-functest-healthcheck-{tag}-cinder_test-run'
1227               <<: *functest-jobs
1228             - name: 'functest-opnfv-functest-healthcheck-{tag}-odl-run'
1229               <<: *functest-jobs
1230             - name: 'functest-opnfv-functest-healthcheck-{tag}-tempest_smoke-run'
1231               <<: *functest-jobs
1232             - name: 'functest-opnfv-functest-healthcheck-{tag}-tempest_horizon-run'
1233               <<: *functest-jobs
1234       - multijob:
1235           name: opnfv/functest-smoke:{tag}
1236           projects:
1237             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_neutron-run'
1238               <<: *functest-jobs
1239             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_cinder-run'
1240               <<: *functest-jobs
1241             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_keystone-run'
1242               <<: *functest-jobs
1243             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_heat-run'
1244               <<: *functest-jobs
1245             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_telemetry-run'
1246               <<: *functest-jobs
1247             - name: 'functest-opnfv-functest-smoke-{tag}-rally_sanity-run'
1248               <<: *functest-jobs
1249             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_defcore-run'
1250               <<: *functest-jobs
1251             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_compute-run'
1252               <<: *functest-jobs
1253             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_object-run'
1254               <<: *functest-jobs
1255             - name: 'functest-opnfv-functest-smoke-{tag}-refstack_platform-run'
1256               <<: *functest-jobs
1257             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_full-run'
1258               <<: *functest-jobs
1259             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_scenario-run'
1260               <<: *functest-jobs
1261             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_slow-run'
1262               <<: *functest-jobs
1263             - name: 'functest-opnfv-functest-smoke-{tag}-patrole-run'
1264               <<: *functest-jobs
1265             - name: 'functest-opnfv-functest-smoke-{tag}-patrole_admin-run'
1266               <<: *functest-jobs
1267             - name: 'functest-opnfv-functest-smoke-{tag}-patrole_member-run'
1268               <<: *functest-jobs
1269             - name: 'functest-opnfv-functest-smoke-{tag}-patrole_reader-run'
1270               <<: *functest-jobs
1271             - name: 'functest-opnfv-functest-smoke-{tag}-networking-bgpvpn-run'
1272               <<: *functest-jobs
1273             - name: 'functest-opnfv-functest-smoke-{tag}-networking-sfc-run'
1274               <<: *functest-jobs
1275             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_barbican-run'
1276               <<: *functest-jobs
1277             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_octavia-run'
1278               <<: *functest-jobs
1279             - name: 'functest-opnfv-functest-smoke-{tag}-tempest_cyborg-run'
1280               <<: *functest-jobs
1281       - multijob:
1282           name: opnfv/functest-smoke-cntt:{tag}
1283           projects:
1284             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_neutron_cntt-run'
1285               <<: *functest-jobs
1286             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_cinder_cntt-run'
1287               <<: *functest-jobs
1288             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_keystone_cntt-run'
1289               <<: *functest-jobs
1290             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_heat_cntt-run'
1291               <<: *functest-jobs
1292             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-rally_sanity_cntt-run'
1293               <<: *functest-jobs
1294             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_full_cntt-run'
1295               <<: *functest-jobs
1296             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_scenario_cntt-run'
1297               <<: *functest-jobs
1298             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-tempest_slow_cntt-run'
1299               <<: *functest-jobs
1300       - multijob:
1301           name: opnfv/functest-benchmarking:{tag}
1302           projects:
1303             - name: 'functest-opnfv-functest-benchmarking-{tag}-rally_full-run'
1304               <<: *functest-jobs
1305             - name: 'functest-opnfv-functest-benchmarking-{tag}-rally_jobs-run'
1306               <<: *functest-jobs
1307             - name: 'functest-opnfv-functest-benchmarking-{tag}-vmtp-run'
1308               <<: *functest-jobs
1309             - name: 'functest-opnfv-functest-benchmarking-{tag}-shaker-run'
1310               <<: *functest-jobs
1311       - multijob:
1312           name: opnfv/functest-benchmarking-cntt:{tag}
1313           projects:
1314             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-rally_full_cntt-run'
1315               <<: *functest-jobs
1316             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-rally_jobs_cntt-run'
1317               <<: *functest-jobs
1318       - multijob:
1319           name: opnfv/functest-vnf:{tag}
1320           projects:
1321             - name: 'functest-opnfv-functest-vnf-{tag}-cloudify-run'
1322               <<: *functest-jobs
1323             - name: 'functest-opnfv-functest-vnf-{tag}-cloudify_ims-run'
1324               <<: *functest-jobs
1325             - name: 'functest-opnfv-functest-vnf-{tag}-heat_ims-run'
1326               <<: *functest-jobs
1327             - name: 'functest-opnfv-functest-vnf-{tag}-vyos_vrouter-run'
1328               <<: *functest-jobs
1329             - name: 'functest-opnfv-functest-vnf-{tag}-juju_epc-run'
1330               <<: *functest-jobs
1331
1332 - project:
1333     name: 'functest-review'
1334     <<: *functest-params
1335     jobs:
1336       - 'functest-{tag}-review'
1337
1338 - view:
1339     name: functest-review
1340     view-type: list
1341     columns:
1342       - status
1343       - weather
1344       - job
1345       - last-success
1346       - last-failure
1347       - last-duration
1348     regex: ^functest-[a-z0-9.]+-review$
1349
1350 - view:
1351     name: functest-tox
1352     view-type: list
1353     columns:
1354       - status
1355       - weather
1356       - job
1357       - last-success
1358       - last-failure
1359       - last-duration
1360     regex: ^functest-[a-z0-9.]+-tox$
1361
1362 - builder:
1363     name: functest-push-containers
1364     builders:
1365       - shell: |
1366           set +x
1367           if [ "{repo}" = "_" ]; then
1368             image={container}:{tag}
1369           elif [ "{port}" = "None" ]; then
1370             image={repo}/{container}:{tag}
1371           else
1372             image={repo}:{port}/{container}:{tag}
1373           fi
1374           sudo docker push $image
1375
1376 - trigger:
1377     name: functest-commit
1378     triggers:
1379       - pollscm:
1380           cron: "*/30 * * * *"
1381
1382 - job-template:
1383     name: 'functest-{repo}-{container}-{tag}-build'
1384     parameters:
1385       - functest-slave:
1386           slave: '{slave}'
1387     scm:
1388       - functest-scm:
1389           ref: '{branch}'
1390     builders:
1391       - functest-build-containers:
1392           <<: *functest-build-containers
1393           ref: '{branch}'
1394           build_args: '{build_args}'
1395       - functest-push-containers:
1396           <<: *functest-build-containers
1397           ref: '{branch}'
1398
1399 - project:
1400     name: functest-opnfv-functest-core-{tag}-build
1401     <<: *functest-params
1402     container: functest-core
1403     ref_arg: BRANCH
1404     path: docker/core
1405     jobs:
1406       - 'functest-{repo}-{container}-{tag}-build'
1407
1408 - project:
1409     name: functest-opnfv-functest-tempest-{tag}-build
1410     <<: *functest-params
1411     container: functest-tempest
1412     ref_arg: BRANCH
1413     path: docker/tempest
1414     exclude:
1415       - {'tag': 'latest'}
1416       - {'tag': 'xena'}
1417       - {'tag': 'wallaby'}
1418       - {'tag': 'leguer'}
1419       - {'tag': 'kali'}
1420       - {'tag': 'jerma'}
1421     jobs:
1422       - 'functest-{repo}-{container}-{tag}-build'
1423
1424 - project:
1425     name: functest-opnfv-functest-healthcheck-{tag}-build
1426     <<: *functest-params
1427     container: functest-healthcheck
1428     ref_arg: BRANCH
1429     path: docker/healthcheck
1430     jobs:
1431       - 'functest-{repo}-{container}-{tag}-build'
1432
1433 - project:
1434     name: functest-opnfv-functest-smoke-{tag}-build
1435     <<: *functest-params
1436     container: functest-smoke
1437     ref_arg: BRANCH
1438     path: docker/smoke
1439     jobs:
1440       - 'functest-{repo}-{container}-{tag}-build'
1441
1442 - project:
1443     name: functest-opnfv-functest-benchmarking-{tag}-build
1444     <<: *functest-params
1445     container: functest-benchmarking
1446     ref_arg: BRANCH
1447     path: docker/benchmarking
1448     jobs:
1449       - 'functest-{repo}-{container}-{tag}-build'
1450
1451 - project:
1452     name: functest-opnfv-functest-vnf-{tag}-build
1453     <<: *functest-params
1454     container: functest-vnf
1455     ref_arg:
1456     path: docker/vnf
1457     jobs:
1458       - 'functest-{repo}-{container}-{tag}-build'
1459
1460 - project:
1461     name: functest-opnfv-functest-smoke-cntt-{tag}-build
1462     <<: *functest-params
1463     container: functest-smoke-cntt
1464     ref_arg: BRANCH
1465     path: docker/smoke-cntt
1466     jobs:
1467       - 'functest-{repo}-{container}-{tag}-build'
1468
1469 - project:
1470     name: functest-opnfv-functest-benchmarking-cntt-{tag}-build
1471     <<: *functest-params
1472     container: functest-benchmarking-cntt
1473     ref_arg: BRANCH
1474     path: docker/benchmarking-cntt
1475     jobs:
1476       - 'functest-{repo}-{container}-{tag}-build'
1477
1478 - job-template:
1479     name: 'functest-{tag}-docker'
1480     project-type: multijob
1481     triggers:
1482       - functest-commit
1483     scm:
1484       - functest-scm:
1485           ref: '{branch}'
1486     parameters:
1487       - functest-slave:
1488           slave: '{slave}'
1489     # PyYAML and yamllint differ here
1490     # see https://github.com/yaml/pyyaml/issues/234
1491     # yamllint disable rule:indentation
1492     properties:
1493       - build-blocker:
1494           blocking-jobs:
1495           - ^functest-(pi-)*{tag}-(daily|docker|review)$
1496     # yamllint enable rule:indentation
1497     builders:
1498       - multijob:
1499           name: remove dependency
1500           projects:
1501             - name: 'functest-{repo}-{tag}-dep-rmi'
1502               <<: *functest-jobs
1503       - multijob:
1504           name: pull dependency
1505           projects:
1506             - name: 'functest-{repo}-{tag}-dep-pull'
1507               <<: *functest-jobs
1508       - multijob:
1509           name: build opnfv/functest-core
1510           projects:
1511             - name: 'functest-opnfv-functest-core-{tag}-build'
1512               <<: *functest-jobs
1513       - multijob:
1514           name: build opnfv/functest-tempest
1515           projects:
1516             - name: 'functest-opnfv-functest-tempest-{tag}-build'
1517               <<: *functest-jobs
1518       - multijob:
1519           name: build containers
1520           projects:
1521             - name: 'functest-opnfv-functest-healthcheck-{tag}-build'
1522               <<: *functest-jobs
1523             - name: 'functest-opnfv-functest-smoke-{tag}-build'
1524               <<: *functest-jobs
1525             - name: 'functest-opnfv-functest-benchmarking-{tag}-build'
1526               <<: *functest-jobs
1527             - name: 'functest-opnfv-functest-vnf-{tag}-build'
1528               <<: *functest-jobs
1529       - multijob:
1530           name: build cntt containers
1531           projects:
1532             - name: 'functest-opnfv-functest-smoke-cntt-{tag}-build'
1533               <<: *functest-jobs
1534             - name: 'functest-opnfv-functest-benchmarking-cntt-{tag}-build'
1535               <<: *functest-jobs
1536
1537 - builder:
1538     name: functest-trivy
1539     builders:
1540       - shell: |
1541           sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
1542           apt-get install curl -y
1543
1544           curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
1545           if [ "{repo}" = "_" ]; then
1546             image={container}:{tag}
1547           elif [ "{port}" = "None" ]; then
1548             image={repo}/{container}:{tag}
1549           else
1550             image={repo}:{port}/{container}:{tag}
1551           fi
1552           ./trivy --exit-code 1 $image
1553
1554 - job-template:
1555     name: 'functest-{repo}-{container}-{tag}-trivy'
1556     triggers:
1557       - timed: '@weekly'
1558     parameters:
1559       - functest-slave:
1560           slave: '{slave}'
1561     builders:
1562       - functest-trivy:
1563           <<: *functest-containers
1564
1565 - project:
1566     name: 'functest-opnfv-functest-core-trivy'
1567     <<: *functest-params
1568     container: 'functest-core'
1569     jobs:
1570       - 'functest-{repo}-{container}-{tag}-trivy'
1571
1572 - project:
1573     name: 'functest-opnfv-functest-tempest-trivy'
1574     <<: *functest-params
1575     container: 'functest-tempest'
1576     jobs:
1577       - 'functest-{repo}-{container}-{tag}-trivy'
1578
1579 - project:
1580     name: 'functest-opnfv-functest-healthcheck-trivy'
1581     <<: *functest-params
1582     container: 'functest-healthcheck'
1583     jobs:
1584       - 'functest-{repo}-{container}-{tag}-trivy'
1585
1586 - project:
1587     name: 'functest-opnfv-functest-smoke-trivy'
1588     <<: *functest-params
1589     container: 'functest-smoke'
1590     jobs:
1591       - 'functest-{repo}-{container}-{tag}-trivy'
1592
1593 - project:
1594     name: 'functest-opnfv-functest-benchmarking-trivy'
1595     <<: *functest-params
1596     container: 'functest-benchmarking'
1597     jobs:
1598       - 'functest-{repo}-{container}-{tag}-trivy'
1599
1600 - project:
1601     name: 'functest-opnfv-functest-vnf-trivy'
1602     <<: *functest-params
1603     container: 'functest-vnf'
1604     jobs:
1605       - 'functest-{repo}-{container}-{tag}-trivy'
1606
1607 - project:
1608     name: 'functest-opnfv-functest-smoke-cntt-trivy'
1609     <<: *functest-params
1610     container: 'functest-smoke-cntt'
1611     jobs:
1612       - 'functest-{repo}-{container}-{tag}-trivy'
1613
1614 - project:
1615     name: 'functest-opnfv-functest-benchmarking-cntt-trivy'
1616     <<: *functest-params
1617     container: 'functest-benchmarking-cntt'
1618     jobs:
1619       - 'functest-{repo}-{container}-{tag}-trivy'
1620
1621 - project:
1622     name: 'functest'
1623     <<: *functest-params
1624     jobs:
1625       - 'functest-{tag}-docker'
1626
1627 - view:
1628     name: functest-docker
1629     view-type: list
1630     columns:
1631       - status
1632       - weather
1633       - job
1634       - last-success
1635       - last-failure
1636       - last-duration
1637     regex: ^functest-[a-z0-9.]+-docker$
1638
1639 - view:
1640     name: functest-trivy
1641     view-type: list
1642     columns:
1643       - status
1644       - weather
1645       - job
1646       - last-success
1647       - last-failure
1648       - last-duration
1649     regex: (?!functest-kubernetes)(?!functest-pi)^functest-[a-z-0-9.]+-trivy$