2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
23 branch: stable/wallaby
45 - xtesting-jobs: &xtesting-jobs
47 current-parameters: true
57 name: xtesting-build_tag
62 - xtesting-run-containers: &xtesting-run-containers
63 name: 'xtesting-run-containers'
64 <<: *xtesting-containers
66 privileged: '{privileged}'
72 name: xtesting-pull-containers
76 if [ "{repo}" = "_" ]; then
77 image={container}:{tag}
78 elif [ "{port}" = "None" ]; then
79 image={repo}/{container}:{tag}
81 image={repo}:{port}/{container}:{tag}
83 sudo docker pull $image
86 name: xtesting-run-containers
91 if [ "{volumes}" != "None" ]; then
92 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
93 do volumes="-v $i $volumes"; done
96 if [ "{env}" != "None" ]; then
97 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
98 do env="-e $i $env"; done
100 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
101 if [ "{repo}" = "_" ]; then
102 image={container}:{tag}
103 elif [ "{port}" = "None" ]; then
104 image={repo}/{container}:{tag}
106 image={repo}:{port}/{container}:{tag}
108 sudo docker run --rm \
109 --privileged={privileged} \
110 --network={network} \
113 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
114 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
115 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
116 -v /home/opnfv/xtesting/.boto:/root/.boto \
117 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
118 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
119 -e NODE_NAME=$slave \
120 -e BUILD_TAG=$BUILD_TAG \
121 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
122 $image run_tests -t {test} -p -r
125 name: xtesting-remove-images
129 if [ "{repo}" = "_" ]; then
130 image={container}:{tag}
131 elif [ "{port}" = "None" ]; then
132 image={repo}/{container}:{tag}
134 image={repo}:{port}/{container}:{tag}
136 sudo docker rmi $image || true
139 name: 'xtesting-{repo}-{container}-{tag}-pull'
144 - xtesting-pull-containers:
145 <<: *xtesting-containers
148 name: 'xtesting-opnfv-xtesting-pull'
150 container: 'xtesting'
152 - 'xtesting-{repo}-{container}-{tag}-pull'
155 name: 'xtesting-opnfv-xtesting-mts-pull'
157 container: 'xtesting-mts'
159 - 'xtesting-{repo}-{container}-{tag}-pull'
162 name: 'xtesting-{repo}-{container}-{tag}-rmi'
167 - xtesting-remove-images:
168 <<: *xtesting-containers
171 name: 'xtesting-opnfv-xtesting-rmi'
173 container: 'xtesting'
175 - 'xtesting-{repo}-{container}-{tag}-rmi'
178 name: 'xtesting-opnfv-xtesting-mts-rmi'
180 container: 'xtesting-mts'
182 - 'xtesting-{repo}-{container}-{tag}-rmi'
185 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
189 - xtesting-build_tag:
192 - xtesting-run-containers:
193 <<: *xtesting-run-containers
196 name: 'xtesting-opnfv-xtesting'
200 container: 'xtesting'
219 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
222 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
226 - xtesting-build_tag:
229 - xtesting-run-containers:
230 <<: *xtesting-run-containers
233 name: 'xtesting-opnfv-xtesting-mts'
237 container: 'xtesting-mts'
243 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
251 if [ "{volumes}" != "None" ]; then
252 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
253 do volumes="-v $i $volumes"; done
256 if [ "{env}" != "None" ]; then
257 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
258 do env="-e $i $env"; done
260 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
261 if [ "{repo}" = "_" ]; then
262 image={container}:{tag}
263 elif [ "{port}" = "None" ]; then
264 image={repo}/{container}:{tag}
266 image={repo}:{port}/{container}:{tag}
268 sudo docker run --rm \
271 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
272 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
273 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
274 -v /home/opnfv/xtesting/.boto:/root/.boto \
275 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
276 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
277 -e BUILD_TAG=$BUILD_TAG \
278 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
282 name: 'xtesting-{tag}-zip'
286 - xtesting-build_tag:
290 <<: *xtesting-containers
295 name: 'xtesting-{tag}-zip'
299 container: 'xtesting'
301 - 'xtesting-{tag}-zip'
304 name: 'xtesting-{tag}-daily'
305 project-type: multijob
311 - xtesting-build_tag:
313 # PyYAML and yamllint differ here
314 # see https://github.com/yaml/pyyaml/issues/234
315 # yamllint disable rule:indentation
319 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
320 # yamllint enable rule:indentation
323 name: remove former images
325 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
327 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
330 name: pull containers
332 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
334 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
337 name: opnfv/xtesting:{tag}
339 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
341 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
343 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
345 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
347 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
349 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
351 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
354 name: opnfv/xtesting-mts:{tag}
356 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
359 name: dump all campaign data
361 - name: 'xtesting-{tag}-zip'
365 name: 'xtesting-daily'
368 - 'xtesting-{tag}-daily'
380 regex: ^xtesting-[a-z0-9.]+-daily$
382 - xtesting-build-containers: &xtesting-build-containers
383 name: 'xtesting-build-containers'
384 <<: *xtesting-containers
387 buildargs: '{buildargs}'
391 name: xtesting-build-containers
395 if [ "{repo}" = "_" ]; then
396 image={container}:{tag}
397 elif [ "{port}" = "None" ]; then
398 image={repo}/{container}:{tag}
400 image={repo}:{port}/{container}:{tag}
403 if [ "{buildargs}" != "None" ]; then
404 for i in $(eval echo {buildargs} | tr -d '[]' |sed "s/, / /g" ); \
405 do build_args="--build-arg $i $build_args"; done
407 if [ "{ref_arg}" != "None" ]; then
408 build_args="$build_args --build-arg {ref_arg}={ref}"
411 if [ "{from}" != "None" ]; then
412 sed -i {from} Dockerfile
414 sudo docker build $build_args \
415 --pull=false --no-cache --force-rm=true \
422 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
423 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
427 - xtesting-dep: &xtesting-dep
428 name: 'xtesting-containers'
432 dependency: '{dependency}'
435 name: xtesting-pull-dep-images
439 if [ "_" = "_" ]; then
440 image=alpine:{dependency}
441 elif [ "" = "None" ]; then
442 image=_/alpine:{dependency}
444 image=_:/alpine:{dependency}
446 sudo docker pull $image || true
449 name: xtesting-remove-dep-images
453 if [ "_" = "_" ]; then
454 image=alpine:{dependency}
455 elif [ "" = "None" ]; then
456 image=_/alpine:{dependency}
458 image=_:/alpine:{dependency}
460 sudo docker rmi $image || true
463 name: 'xtesting-{repo}-{tag}-dep-pull'
468 - xtesting-pull-dep-images:
472 name: 'xtesting-{repo}-{tag}-dep-pull'
475 - 'xtesting-{repo}-{tag}-dep-pull'
478 name: 'xtesting-{repo}-{tag}-dep-rmi'
483 - xtesting-remove-dep-images:
487 name: 'xtesting-{repo}-{tag}-dep-rmi'
490 - 'xtesting-{repo}-{tag}-dep-rmi'
497 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
498 apt-get install software-properties-common gpg -y
499 sudo add-apt-repository -y ppa:deadsnakes/ppa
500 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
502 python3.9 python3.9-dev python3.9-distutils \
503 python3.8 python3.8-dev python3.8-distutils \
504 python3.7 python3.7-dev python3.6 python3.6-dev \
505 python python-dev python3-pip enchant -y
506 sudo pip3 install tox tox-pip-version
511 name: 'xtesting-{tag}-tox'
516 - xtesting-patchset-created:
528 - 'xtesting-{tag}-tox'
531 name: 'xtesting-{repo}-{container}-{tag}-gate'
539 - xtesting-build-containers:
540 <<: *xtesting-build-containers
542 buildargs: '{buildargs}'
545 name: xtesting-opnfv-xtesting-{tag}-gate
551 - 'xtesting-{repo}-{container}-{tag}-gate'
554 name: xtesting-opnfv-xtesting-mts-{tag}-gate
556 container: xtesting-mts
560 - 'xtesting-{repo}-{container}-{tag}-gate'
563 name: xtesting-patchset-created
567 - patchset-created-event
568 - comment-added-contains-event:
569 comment-contains-value: 'recheck'
570 - comment-added-contains-event:
571 comment-contains-value: 'reverify'
573 - project-compare-type: 'ANT'
574 project-pattern: 'functest-xtesting'
576 - branch-compare-type: 'ANT'
577 branch-pattern: '**/{branch}'
580 name: 'xtesting-{tag}-review'
581 project-type: multijob
583 - xtesting-patchset-created:
588 - xtesting-build_tag:
590 # PyYAML and yamllint differ here
591 # see https://github.com/yaml/pyyaml/issues/234
592 # yamllint disable rule:indentation
596 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
597 # yamllint enable rule:indentation
600 name: remove former images
602 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
604 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
607 name: remove dependency
609 - name: 'xtesting-{repo}-{tag}-dep-rmi'
612 name: pull dependency
614 - name: 'xtesting-{repo}-{tag}-dep-pull'
619 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
622 name: opnfv/xtesting-mts
624 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
627 name: opnfv/xtesting:{tag}
629 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
631 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
633 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
635 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
637 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
639 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
641 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
644 name: opnfv/xtesting-mts:{tag}
646 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
650 name: 'xtesting-review'
653 - 'xtesting-{tag}-review'
656 name: xtesting-review
665 regex: ^xtesting-[a-z0-9.]+-review$
677 regex: ^xtesting-[a-z0-9.]+-tox$
680 name: xtesting-push-containers
684 if [ "{repo}" = "_" ]; then
685 image={container}:{tag}
686 elif [ "{port}" = "None" ]; then
687 image={repo}/{container}:{tag}
689 image={repo}:{port}/{container}:{tag}
691 sudo docker push $image
694 name: xtesting-commit
700 name: 'xtesting-{repo}-{container}-{tag}-build'
708 - xtesting-build-containers:
709 <<: *xtesting-build-containers
711 buildargs: '{buildargs}'
712 - xtesting-push-containers:
713 <<: *xtesting-build-containers
717 name: xtesting-opnfv-xtesting-{tag}-build
723 - 'xtesting-{repo}-{container}-{tag}-build'
726 name: xtesting-opnfv-xtesting-mts-{tag}-build
728 container: xtesting-mts
732 - 'xtesting-{repo}-{container}-{tag}-build'
735 name: 'xtesting-{tag}-docker'
736 project-type: multijob
745 # PyYAML and yamllint differ here
746 # see https://github.com/yaml/pyyaml/issues/234
747 # yamllint disable rule:indentation
751 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
752 # yamllint enable rule:indentation
755 name: remove dependency
757 - name: 'xtesting-{repo}-{tag}-dep-rmi'
760 name: pull dependency
762 - name: 'xtesting-{repo}-{tag}-dep-pull'
767 - name: 'xtesting-opnfv-xtesting-{tag}-build'
770 name: opnfv/xtesting-mts
772 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
779 sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive \
780 apt-get install curl -y
782 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
783 if [ "{repo}" = "_" ]; then
784 image={container}:{tag}
785 elif [ "{port}" = "None" ]; then
786 image={repo}/{container}:{tag}
788 image={repo}:{port}/{container}:{tag}
790 ./trivy --exit-code 1 $image
793 name: 'xtesting-{repo}-{container}-{tag}-trivy'
801 <<: *xtesting-containers
804 name: 'xtesting-opnfv-xtesting-trivy'
806 container: 'xtesting'
808 - 'xtesting-{repo}-{container}-{tag}-trivy'
811 name: 'xtesting-opnfv-xtesting-mts-trivy'
813 container: 'xtesting-mts'
815 - 'xtesting-{repo}-{container}-{tag}-trivy'
821 - 'xtesting-{tag}-docker'
824 name: xtesting-docker
833 regex: ^xtesting-[a-z0-9.]+-docker$
845 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$