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