2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
35 branch: stable/wallaby
57 - xtesting-jobs: &xtesting-jobs
59 current-parameters: true
69 name: xtesting-build_tag
74 - xtesting-run-containers: &xtesting-run-containers
75 name: 'xtesting-run-containers'
76 <<: *xtesting-containers
78 privileged: '{privileged}'
84 published_ports: '{published_ports}'
87 name: xtesting-pull-containers
91 if [ "{repo}" = "_" ]; then
92 image={container}:{tag}
93 elif [ "{port}" = "None" ]; then
94 image={repo}/{container}:{tag}
96 image={repo}:{port}/{container}:{tag}
98 sudo docker pull $image
101 name: xtesting-run-containers
106 if [ "{volumes}" != "None" ]; then
107 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
108 do volumes="-v $i $volumes"; done
111 if [ "{env}" != "None" ]; then
112 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
113 do env="-e $i $env"; done
116 if [ "{published_ports}" != "None" ]; then
117 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
118 do published_ports="-p $i $published_ports"; done
120 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
121 if [ "{repo}" = "_" ]; then
122 image={container}:{tag}
123 elif [ "{port}" = "None" ]; then
124 image={repo}/{container}:{tag}
126 image={repo}:{port}/{container}:{tag}
128 sudo mkdir -p $WORKSPACE/results
129 sudo chown {uid}:{gid} $WORKSPACE/results
130 sudo docker run --rm \
131 --privileged={privileged} \
132 --network={network} \
136 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
137 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
138 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
139 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
140 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
141 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
142 -e NODE_NAME=$slave \
143 -e BUILD_TAG=$BUILD_TAG \
144 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
145 $image run_tests -t {test} -p -r
148 name: xtesting-remove-images
152 if [ "{repo}" = "_" ]; then
153 image={container}:{tag}
154 elif [ "{port}" = "None" ]; then
155 image={repo}/{container}:{tag}
157 image={repo}:{port}/{container}:{tag}
159 sudo docker rmi $image || true
162 name: 'xtesting-{repo}-{container}-{tag}-pull'
167 - xtesting-pull-containers:
168 <<: *xtesting-containers
171 name: 'xtesting-opnfv-xtesting-pull'
173 container: 'xtesting'
175 - 'xtesting-{repo}-{container}-{tag}-pull'
178 name: 'xtesting-opnfv-xtesting-mts-pull'
180 container: 'xtesting-mts'
182 - 'xtesting-{repo}-{container}-{tag}-pull'
185 name: 'xtesting-{repo}-{container}-{tag}-rmi'
190 - xtesting-remove-images:
191 <<: *xtesting-containers
194 name: 'xtesting-opnfv-xtesting-rmi'
196 container: 'xtesting'
198 - 'xtesting-{repo}-{container}-{tag}-rmi'
201 name: 'xtesting-opnfv-xtesting-mts-rmi'
203 container: 'xtesting-mts'
205 - 'xtesting-{repo}-{container}-{tag}-rmi'
208 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
212 - xtesting-build_tag:
215 - xtesting-run-containers:
216 <<: *xtesting-run-containers
219 name: 'xtesting-opnfv-xtesting'
224 container: 'xtesting'
245 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
248 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
252 - xtesting-build_tag:
255 - xtesting-run-containers:
256 <<: *xtesting-run-containers
259 name: 'xtesting-opnfv-xtesting-mts'
264 container: 'xtesting-mts'
272 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
280 if [ "{volumes}" != "None" ]; then
281 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
282 do volumes="-v $i $volumes"; done
285 if [ "{env}" != "None" ]; then
286 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
287 do env="-e $i $env"; done
290 if [ "{published_ports}" != "None" ]; then
291 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
292 do published_ports="-p $i $published_ports"; done
294 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
295 if [ "{repo}" = "_" ]; then
296 image={container}:{tag}
297 elif [ "{port}" = "None" ]; then
298 image={repo}/{container}:{tag}
300 image={repo}:{port}/{container}:{tag}
302 sudo mkdir -p $WORKSPACE/results
303 sudo chown {uid}:{gid} $WORKSPACE/results
304 sudo docker run --rm \
308 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
309 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
310 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
311 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
312 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
313 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
314 -e BUILD_TAG=$BUILD_TAG \
315 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
319 name: 'xtesting-{tag}-zip'
323 - xtesting-build_tag:
327 <<: *xtesting-containers
332 published_ports: '{published_ports}'
335 name: 'xtesting-{tag}-zip'
340 container: 'xtesting'
344 - 'xtesting-{tag}-zip'
347 name: 'xtesting-{tag}-daily'
348 project-type: multijob
354 - xtesting-build_tag:
356 # PyYAML and yamllint differ here
357 # see https://github.com/yaml/pyyaml/issues/234
358 # yamllint disable rule:indentation
362 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
363 # yamllint enable rule:indentation
366 name: remove former images
368 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
370 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
373 name: pull containers
375 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
377 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
380 name: opnfv/xtesting:{tag}
382 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
384 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
386 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
388 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
390 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
392 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
394 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
397 name: opnfv/xtesting-mts:{tag}
399 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
402 name: dump all campaign data
404 - name: 'xtesting-{tag}-zip'
411 recipients: cedric.ollivier@orange.com
414 name: 'xtesting-daily'
417 - 'xtesting-{tag}-daily'
429 regex: ^xtesting-[a-z0-9.]+-daily$
431 - xtesting-build-containers: &xtesting-build-containers
432 name: 'xtesting-build-containers'
433 <<: *xtesting-containers
436 build_args: '{build_args}'
440 name: xtesting-build-containers
444 if [ "{repo}" = "_" ]; then
445 image={container}:{tag}
446 elif [ "{port}" = "None" ]; then
447 image={repo}/{container}:{tag}
449 image={repo}:{port}/{container}:{tag}
452 if [ "{build_args}" != "None" ]; then
453 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
454 do build_args="--build-arg $i $build_args"; done
456 if [ "{ref_arg}" != "None" ]; then
457 build_args="$build_args --build-arg {ref_arg}={ref}"
460 if [ "{from}" != "None" ]; then
461 sed -i {from} Dockerfile
463 sudo docker build $build_args \
464 --pull=false --no-cache --force-rm=true \
471 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
472 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
476 - xtesting-dep: &xtesting-dep
477 name: 'xtesting-containers'
481 dependency: '{dependency}'
484 name: xtesting-pull-dep-images
488 if [ "_" = "_" ]; then
489 image=alpine:{dependency}
490 elif [ "" = "None" ]; then
491 image=_/alpine:{dependency}
493 image=_:/alpine:{dependency}
495 sudo docker pull $image || true
498 name: xtesting-remove-dep-images
502 if [ "_" = "_" ]; then
503 image=alpine:{dependency}
504 elif [ "" = "None" ]; then
505 image=_/alpine:{dependency}
507 image=_:/alpine:{dependency}
509 sudo docker rmi $image || true
512 name: 'xtesting-{repo}-{tag}-dep-pull'
517 - xtesting-pull-dep-images:
521 name: 'xtesting-{repo}-{tag}-dep-pull'
524 - 'xtesting-{repo}-{tag}-dep-pull'
527 name: 'xtesting-{repo}-{tag}-dep-rmi'
532 - xtesting-remove-dep-images:
536 name: 'xtesting-{repo}-{tag}-dep-rmi'
539 - 'xtesting-{repo}-{tag}-dep-rmi'
546 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
547 sudo DEBIAN_FRONTEND=noninteractive apt-get \
548 -o DPkg::Lock::Timeout=300 dist-upgrade -y
549 sudo DEBIAN_FRONTEND=noninteractive \
550 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
551 sudo add-apt-repository -y ppa:deadsnakes/ppa
552 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
553 sudo DEBIAN_FRONTEND=noninteractive apt-get \
554 -o DPkg::Lock::Timeout=300 install \
555 python3.9 python3.9-dev python3.9-distutils \
556 python3.8 python3.8-dev python3.8-distutils \
557 python3.7 python3.7-dev python3.6 python3.6-dev \
558 python python-dev python3-pip enchant -y
559 sudo pip3 install tox tox-pip-version
564 name: 'xtesting-{tag}-tox'
569 - xtesting-patchset-created:
581 - 'xtesting-{tag}-tox'
584 name: 'xtesting-{repo}-{container}-{tag}-gate'
592 - xtesting-build-containers:
593 <<: *xtesting-build-containers
595 build_args: '{build_args}'
598 name: xtesting-opnfv-xtesting-{tag}-gate
604 - 'xtesting-{repo}-{container}-{tag}-gate'
607 name: xtesting-opnfv-xtesting-mts-{tag}-gate
609 container: xtesting-mts
613 - 'xtesting-{repo}-{container}-{tag}-gate'
616 name: xtesting-patchset-created
620 - patchset-created-event
621 - comment-added-contains-event:
622 comment-contains-value: 'recheck'
623 - comment-added-contains-event:
624 comment-contains-value: 'reverify'
626 - project-compare-type: 'ANT'
627 project-pattern: 'functest-xtesting'
629 - branch-compare-type: 'ANT'
630 branch-pattern: '**/{branch}'
633 name: 'xtesting-{tag}-review'
634 project-type: multijob
636 - xtesting-patchset-created:
641 - xtesting-build_tag:
643 # PyYAML and yamllint differ here
644 # see https://github.com/yaml/pyyaml/issues/234
645 # yamllint disable rule:indentation
649 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
650 # yamllint enable rule:indentation
653 name: remove former images
655 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
657 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
660 name: remove dependency
662 - name: 'xtesting-{repo}-{tag}-dep-rmi'
665 name: pull dependency
667 - name: 'xtesting-{repo}-{tag}-dep-pull'
672 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
675 name: opnfv/xtesting-mts
677 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
680 name: opnfv/xtesting:{tag}
682 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
684 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
686 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
688 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
690 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
692 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
694 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
697 name: opnfv/xtesting-mts:{tag}
699 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
706 recipients: cedric.ollivier@orange.com
709 name: 'xtesting-review'
712 - 'xtesting-{tag}-review'
715 name: xtesting-review
724 regex: ^xtesting-[a-z0-9.]+-review$
736 regex: ^xtesting-[a-z0-9.]+-tox$
739 name: xtesting-push-containers
743 if [ "{repo}" = "_" ]; then
744 image={container}:{tag}
745 elif [ "{port}" = "None" ]; then
746 image={repo}/{container}:{tag}
748 image={repo}:{port}/{container}:{tag}
750 sudo docker push $image
753 name: xtesting-commit
759 name: 'xtesting-{repo}-{container}-{tag}-build'
767 - xtesting-build-containers:
768 <<: *xtesting-build-containers
770 build_args: '{build_args}'
771 - xtesting-push-containers:
772 <<: *xtesting-build-containers
776 name: xtesting-opnfv-xtesting-{tag}-build
782 - 'xtesting-{repo}-{container}-{tag}-build'
785 name: xtesting-opnfv-xtesting-mts-{tag}-build
787 container: xtesting-mts
791 - 'xtesting-{repo}-{container}-{tag}-build'
794 name: 'xtesting-{tag}-docker'
795 project-type: multijob
804 # PyYAML and yamllint differ here
805 # see https://github.com/yaml/pyyaml/issues/234
806 # yamllint disable rule:indentation
810 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
811 # yamllint enable rule:indentation
814 name: remove dependency
816 - name: 'xtesting-{repo}-{tag}-dep-rmi'
819 name: pull dependency
821 - name: 'xtesting-{repo}-{tag}-dep-pull'
826 - name: 'xtesting-opnfv-xtesting-{tag}-build'
829 name: opnfv/xtesting-mts
831 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
838 recipients: cedric.ollivier@orange.com
844 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
845 sudo DEBIAN_FRONTEND=noninteractive apt-get \
846 -o DPkg::Lock::Timeout=300 install curl -y
848 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
849 if [ "{repo}" = "_" ]; then
850 image={container}:{tag}
851 elif [ "{port}" = "None" ]; then
852 image={repo}/{container}:{tag}
854 image={repo}:{port}/{container}:{tag}
856 ./trivy image --exit-code 1 $image
859 name: 'xtesting-{repo}-{container}-{tag}-trivy'
867 <<: *xtesting-containers
873 recipients: cedric.ollivier@orange.com
876 name: 'xtesting-opnfv-xtesting-trivy'
878 container: 'xtesting'
880 - 'xtesting-{repo}-{container}-{tag}-trivy'
883 name: 'xtesting-opnfv-xtesting-mts-trivy'
885 container: 'xtesting-mts'
887 - 'xtesting-{repo}-{container}-{tag}-trivy'
893 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
894 sudo DEBIAN_FRONTEND=noninteractive apt-get \
895 -o DPkg::Lock::Timeout=300 install curl -y
897 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
898 if [ "{repo}" = "_" ]; then
899 image={container}:{tag}
900 elif [ "{port}" = "None" ]; then
901 image={repo}/{container}:{tag}
903 image={repo}:{port}/{container}:{tag}
908 name: 'xtesting-{repo}-{container}-{tag}-grype'
916 <<: *xtesting-containers
922 recipients: cedric.ollivier@orange.com
925 name: 'xtesting-opnfv-xtesting-grype'
927 container: 'xtesting'
929 - 'xtesting-{repo}-{container}-{tag}-grype'
932 name: 'xtesting-opnfv-xtesting-mts-grype'
934 container: 'xtesting-mts'
936 - 'xtesting-{repo}-{container}-{tag}-grype'
942 - 'xtesting-{tag}-docker'
945 name: xtesting-docker
954 regex: ^xtesting-[a-z0-9.]+-docker$
966 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
978 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$