2 - xtesting-containers: &xtesting-containers
3 name: 'xtesting-containers'
6 container: '{container}'
9 - xtesting-params: &xtesting-params
10 name: 'xtesting-params'
41 branch: stable/wallaby
63 - xtesting-jobs: &xtesting-jobs
65 current-parameters: true
75 name: xtesting-build_tag
80 - xtesting-run-containers: &xtesting-run-containers
81 name: 'xtesting-run-containers'
82 <<: *xtesting-containers
84 privileged: '{privileged}'
90 published_ports: '{published_ports}'
93 name: xtesting-pull-containers
97 if [ "{repo}" = "_" ]; then
98 image={container}:{tag}
99 elif [ "{port}" = "None" ]; then
100 image={repo}/{container}:{tag}
102 image={repo}:{port}/{container}:{tag}
104 sudo docker pull $image
107 name: xtesting-run-containers
112 if [ "{volumes}" != "None" ]; then
113 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
114 do volumes="-v $i $volumes"; done
117 if [ "{env}" != "None" ]; then
118 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
119 do env="-e $i $env"; done
122 if [ "{published_ports}" != "None" ]; then
123 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
124 do published_ports="-p $i $published_ports"; done
126 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
127 if [ "{repo}" = "_" ]; then
128 image={container}:{tag}
129 elif [ "{port}" = "None" ]; then
130 image={repo}/{container}:{tag}
132 image={repo}:{port}/{container}:{tag}
134 sudo mkdir -p $WORKSPACE/results
135 sudo chown {uid}:{gid} $WORKSPACE/results
136 sudo docker run --rm \
137 --privileged={privileged} \
138 --network={network} \
142 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
143 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
144 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
145 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
146 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
147 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
148 -e NODE_NAME=$slave \
149 -e BUILD_TAG=$BUILD_TAG \
150 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
151 $image run_tests -t {test} -p -r
154 name: xtesting-remove-images
158 if [ "{repo}" = "_" ]; then
159 image={container}:{tag}
160 elif [ "{port}" = "None" ]; then
161 image={repo}/{container}:{tag}
163 image={repo}:{port}/{container}:{tag}
165 sudo docker rmi $image || true
168 name: 'xtesting-{repo}-{container}-{tag}-pull'
173 - xtesting-pull-containers:
174 <<: *xtesting-containers
177 name: 'xtesting-opnfv-xtesting-pull'
179 container: 'xtesting'
181 - 'xtesting-{repo}-{container}-{tag}-pull'
184 name: 'xtesting-opnfv-xtesting-mts-pull'
186 container: 'xtesting-mts'
188 - 'xtesting-{repo}-{container}-{tag}-pull'
191 name: 'xtesting-{repo}-{container}-{tag}-rmi'
196 - xtesting-remove-images:
197 <<: *xtesting-containers
200 name: 'xtesting-opnfv-xtesting-rmi'
202 container: 'xtesting'
204 - 'xtesting-{repo}-{container}-{tag}-rmi'
207 name: 'xtesting-opnfv-xtesting-mts-rmi'
209 container: 'xtesting-mts'
211 - 'xtesting-{repo}-{container}-{tag}-rmi'
214 name: 'xtesting-opnfv-xtesting-{tag}-{test}-run'
218 - xtesting-build_tag:
221 - xtesting-run-containers:
222 <<: *xtesting-run-containers
225 name: 'xtesting-opnfv-xtesting'
230 container: 'xtesting'
251 - 'xtesting-opnfv-xtesting-{tag}-{test}-run'
254 name: 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
258 - xtesting-build_tag:
261 - xtesting-run-containers:
262 <<: *xtesting-run-containers
265 name: 'xtesting-opnfv-xtesting-mts'
270 container: 'xtesting-mts'
278 - 'xtesting-opnfv-xtesting-mts-{tag}-{test}-run'
286 if [ "{volumes}" != "None" ]; then
287 for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
288 do volumes="-v $i $volumes"; done
291 if [ "{env}" != "None" ]; then
292 for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
293 do env="-e $i $env"; done
296 if [ "{published_ports}" != "None" ]; then
297 for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
298 do published_ports="-p $i $published_ports"; done
300 [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
301 if [ "{repo}" = "_" ]; then
302 image={container}:{tag}
303 elif [ "{port}" = "None" ]; then
304 image={repo}/{container}:{tag}
306 image={repo}:{port}/{container}:{tag}
308 sudo mkdir -p $WORKSPACE/results
309 sudo chown {uid}:{gid} $WORKSPACE/results
310 sudo docker run --rm \
314 -e S3_ENDPOINT_URL=https://storage.googleapis.com \
315 -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
316 -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
317 -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
318 -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
319 -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
320 -e BUILD_TAG=$BUILD_TAG \
321 -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
325 name: 'xtesting-{tag}-zip'
329 - xtesting-build_tag:
333 <<: *xtesting-containers
338 published_ports: '{published_ports}'
341 name: 'xtesting-{tag}-zip'
346 container: 'xtesting'
350 - 'xtesting-{tag}-zip'
353 name: 'xtesting-{tag}-daily'
354 project-type: multijob
360 - xtesting-build_tag:
362 # PyYAML and yamllint differ here
363 # see https://github.com/yaml/pyyaml/issues/234
364 # yamllint disable rule:indentation
368 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
369 # yamllint enable rule:indentation
372 name: remove former images
374 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
376 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
379 name: pull containers
381 - name: 'xtesting-opnfv-xtesting-{tag}-pull'
383 - name: 'xtesting-opnfv-xtesting-mts-{tag}-pull'
386 name: opnfv/xtesting:{tag}
388 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
390 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
392 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
394 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
396 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
398 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
400 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
403 name: opnfv/xtesting-mts:{tag}
405 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
408 name: dump all campaign data
410 - name: 'xtesting-{tag}-zip'
417 recipients: cedric.ollivier@orange.com
420 name: 'xtesting-daily'
423 - 'xtesting-{tag}-daily'
435 regex: ^xtesting-[a-z0-9.]+-daily$
437 - xtesting-build-containers: &xtesting-build-containers
438 name: 'xtesting-build-containers'
439 <<: *xtesting-containers
442 build_args: '{build_args}'
446 name: xtesting-build-containers
450 if [ "{repo}" = "_" ]; then
451 image={container}:{tag}
452 elif [ "{port}" = "None" ]; then
453 image={repo}/{container}:{tag}
455 image={repo}:{port}/{container}:{tag}
458 if [ "{build_args}" != "None" ]; then
459 for i in $(echo {build_args} | tr -d '[]' |sed "s/, / /g" ); \
460 do build_args="--build-arg $i $build_args"; done
462 if [ "{ref_arg}" != "None" ]; then
463 build_args="$build_args --build-arg {ref_arg}={ref}"
466 if [ "{from}" != "None" ]; then
467 sed -i {from} Dockerfile
469 sudo docker build $build_args \
470 --pull=false --no-cache --force-rm=true \
477 url: 'https://gerrit.opnfv.org/gerrit/functest-xtesting'
478 refspec: '+refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/*'
482 - xtesting-dep: &xtesting-dep
483 name: 'xtesting-containers'
487 dependency: '{dependency}'
490 name: xtesting-pull-dep-images
494 if [ "_" = "_" ]; then
495 image=alpine:{dependency}
496 elif [ "" = "None" ]; then
497 image=_/alpine:{dependency}
499 image=_:/alpine:{dependency}
501 sudo docker pull $image || true
504 name: xtesting-remove-dep-images
508 if [ "_" = "_" ]; then
509 image=alpine:{dependency}
510 elif [ "" = "None" ]; then
511 image=_/alpine:{dependency}
513 image=_:/alpine:{dependency}
515 sudo docker rmi $image || true
518 name: 'xtesting-{repo}-{tag}-dep-pull'
523 - xtesting-pull-dep-images:
527 name: 'xtesting-{repo}-{tag}-dep-pull'
530 - 'xtesting-{repo}-{tag}-dep-pull'
533 name: 'xtesting-{repo}-{tag}-dep-rmi'
538 - xtesting-remove-dep-images:
542 name: 'xtesting-{repo}-{tag}-dep-rmi'
545 - 'xtesting-{repo}-{tag}-dep-rmi'
552 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
553 sudo DEBIAN_FRONTEND=noninteractive apt-get \
554 -o DPkg::Lock::Timeout=300 dist-upgrade -y
555 sudo DEBIAN_FRONTEND=noninteractive \
556 apt-get -o DPkg::Lock::Timeout=300 install software-properties-common gpg -y
557 sudo add-apt-repository -y ppa:deadsnakes/ppa
558 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
559 sudo DEBIAN_FRONTEND=noninteractive apt-get \
560 -o DPkg::Lock::Timeout=300 install \
561 libxml2-dev libxslt-dev libffi-dev libjpeg-dev \
562 python3.10 python3.10-dev python3.10-distutils \
563 python3.9 python3.9-dev python3.9-distutils \
564 python3.8 python3.8-dev python3.8-distutils \
565 python3.7 python3.7-dev python3.6 python3.6-dev \
566 python python-dev python3-pip enchant -y
567 sudo pip3 install tox tox-pip-version
572 name: 'xtesting-{tag}-tox'
577 - xtesting-patchset-created:
589 - 'xtesting-{tag}-tox'
592 name: 'xtesting-{repo}-{container}-{tag}-gate'
600 - xtesting-build-containers:
601 <<: *xtesting-build-containers
603 build_args: '{build_args}'
606 name: xtesting-opnfv-xtesting-{tag}-gate
612 - 'xtesting-{repo}-{container}-{tag}-gate'
615 name: xtesting-opnfv-xtesting-mts-{tag}-gate
617 container: xtesting-mts
621 - 'xtesting-{repo}-{container}-{tag}-gate'
624 name: xtesting-patchset-created
628 - patchset-created-event
629 - comment-added-contains-event:
630 comment-contains-value: 'recheck'
631 - comment-added-contains-event:
632 comment-contains-value: 'reverify'
634 - project-compare-type: 'ANT'
635 project-pattern: 'functest-xtesting'
637 - branch-compare-type: 'ANT'
638 branch-pattern: '**/{branch}'
641 name: 'xtesting-{tag}-review'
642 project-type: multijob
644 - xtesting-patchset-created:
649 - xtesting-build_tag:
651 # PyYAML and yamllint differ here
652 # see https://github.com/yaml/pyyaml/issues/234
653 # yamllint disable rule:indentation
657 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
658 # yamllint enable rule:indentation
661 name: remove former images
663 - name: 'xtesting-opnfv-xtesting-{tag}-rmi'
665 - name: 'xtesting-opnfv-xtesting-mts-{tag}-rmi'
668 name: remove dependency
670 - name: 'xtesting-{repo}-{tag}-dep-rmi'
673 name: pull dependency
675 - name: 'xtesting-{repo}-{tag}-dep-pull'
680 - name: 'xtesting-opnfv-xtesting-{tag}-gate'
683 name: opnfv/xtesting-mts
685 - name: 'xtesting-opnfv-xtesting-mts-{tag}-gate'
688 name: opnfv/xtesting:{tag}
690 - name: 'xtesting-opnfv-xtesting-{tag}-first-run'
692 - name: 'xtesting-opnfv-xtesting-{tag}-second-run'
694 - name: 'xtesting-opnfv-xtesting-{tag}-third-run'
696 - name: 'xtesting-opnfv-xtesting-{tag}-fourth-run'
698 - name: 'xtesting-opnfv-xtesting-{tag}-fifth-run'
700 - name: 'xtesting-opnfv-xtesting-{tag}-sixth-run'
702 - name: 'xtesting-opnfv-xtesting-{tag}-eighth-run'
705 name: opnfv/xtesting-mts:{tag}
707 - name: 'xtesting-opnfv-xtesting-mts-{tag}-seventh-run'
714 recipients: cedric.ollivier@orange.com
717 name: 'xtesting-review'
720 - 'xtesting-{tag}-review'
723 name: xtesting-review
732 regex: ^xtesting-[a-z0-9.]+-review$
744 regex: ^xtesting-[a-z0-9.]+-tox$
747 name: xtesting-push-containers
751 if [ "{repo}" = "_" ]; then
752 image={container}:{tag}
753 elif [ "{port}" = "None" ]; then
754 image={repo}/{container}:{tag}
756 image={repo}:{port}/{container}:{tag}
758 sudo docker push $image
761 name: xtesting-commit
767 name: 'xtesting-{repo}-{container}-{tag}-build'
775 - xtesting-build-containers:
776 <<: *xtesting-build-containers
778 build_args: '{build_args}'
779 - xtesting-push-containers:
780 <<: *xtesting-build-containers
784 name: xtesting-opnfv-xtesting-{tag}-build
790 - 'xtesting-{repo}-{container}-{tag}-build'
793 name: xtesting-opnfv-xtesting-mts-{tag}-build
795 container: xtesting-mts
799 - 'xtesting-{repo}-{container}-{tag}-build'
802 name: 'xtesting-{tag}-docker'
803 project-type: multijob
812 # PyYAML and yamllint differ here
813 # see https://github.com/yaml/pyyaml/issues/234
814 # yamllint disable rule:indentation
818 - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
819 # yamllint enable rule:indentation
822 name: remove dependency
824 - name: 'xtesting-{repo}-{tag}-dep-rmi'
827 name: pull dependency
829 - name: 'xtesting-{repo}-{tag}-dep-pull'
834 - name: 'xtesting-opnfv-xtesting-{tag}-build'
837 name: opnfv/xtesting-mts
839 - name: 'xtesting-opnfv-xtesting-mts-{tag}-build'
846 recipients: cedric.ollivier@orange.com
852 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
853 sudo DEBIAN_FRONTEND=noninteractive apt-get \
854 -o DPkg::Lock::Timeout=300 install curl -y
856 curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b .
857 if [ "{repo}" = "_" ]; then
858 image={container}:{tag}
859 elif [ "{port}" = "None" ]; then
860 image={repo}/{container}:{tag}
862 image={repo}:{port}/{container}:{tag}
864 ./trivy image --exit-code 1 $image
867 name: 'xtesting-{repo}-{container}-{tag}-trivy'
875 <<: *xtesting-containers
881 recipients: cedric.ollivier@orange.com
884 name: 'xtesting-opnfv-xtesting-trivy'
886 container: 'xtesting'
888 - 'xtesting-{repo}-{container}-{tag}-trivy'
891 name: 'xtesting-opnfv-xtesting-mts-trivy'
893 container: 'xtesting-mts'
895 - 'xtesting-{repo}-{container}-{tag}-trivy'
901 sudo apt-get -o DPkg::Lock::Timeout=300 update && \
902 sudo DEBIAN_FRONTEND=noninteractive apt-get \
903 -o DPkg::Lock::Timeout=300 install curl -y
905 curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b .
906 if [ "{repo}" = "_" ]; then
907 image={container}:{tag}
908 elif [ "{port}" = "None" ]; then
909 image={repo}/{container}:{tag}
911 image={repo}:{port}/{container}:{tag}
916 name: 'xtesting-{repo}-{container}-{tag}-grype'
924 <<: *xtesting-containers
930 recipients: cedric.ollivier@orange.com
933 name: 'xtesting-opnfv-xtesting-grype'
935 container: 'xtesting'
937 - 'xtesting-{repo}-{container}-{tag}-grype'
940 name: 'xtesting-opnfv-xtesting-mts-grype'
942 container: 'xtesting-mts'
944 - 'xtesting-{repo}-{container}-{tag}-grype'
950 - 'xtesting-{tag}-docker'
953 name: xtesting-docker
962 regex: ^xtesting-[a-z0-9.]+-docker$
974 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-trivy$
986 regex: (?!xtesting-pi)^xtesting-[a-z-0-9.]+-grype$
994 cat /etc/jenkins_jobs/jenkins_jobs.ini
999 - xtesting-debug-slave:
1005 name: 'xtesting-debug'