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