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