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