611c68d095dc3d8efcd728de8ad4d241e3bcff0f
[releng.git] / jjb / functest / xtesting-pi.yaml
1 ---
2 - xtesting-pi-containers: &xtesting-pi-containers
3     name: 'xtesting-pi-containers'
4     repo: '{repo}'
5     port: '{port}'
6     container: '{container}'
7     tag: '{tag}'
8
9 - xtesting-pi-params: &xtesting-pi-params
10     name: 'xtesting-pi-params'
11     repo: 'ollivier'
12     port:
13     tag:
14       - latest:
15           slave: lf-virtual1
16       - wallaby:
17           slave: lf-virtual1
18       - leguer:
19           slave: lf-virtual1
20       - kali:
21           slave: lf-virtual1
22       - jerma:
23           slave: lf-virtual1
24       - arm-latest:
25           slave: lf-virtual1
26       - arm-wallaby:
27           slave: lf-virtual1
28       - arm-leguer:
29           slave: lf-virtual1
30       - arm-kali:
31           slave: lf-virtual1
32       - arm-jerma:
33           slave: lf-virtual1
34       - arm64-latest:
35           slave: lf-virtual1
36       - arm64-wallaby:
37           slave: lf-virtual1
38       - arm64-leguer:
39           slave: lf-virtual1
40       - arm64-kali:
41           slave: lf-virtual1
42       - arm64-jerma:
43           slave: lf-virtual1
44
45 - xtesting-pi-jobs: &xtesting-pi-jobs
46     name: 'xtesting-pi-jobs'
47     current-parameters: true
48
49 - parameter:
50     name: xtesting-pi-slave
51     parameters:
52       - label:
53           name: slave
54           default: '{slave}'
55
56 - parameter:
57     name: xtesting-pi-build_tag
58     parameters:
59       - random-string:
60           name: build_tag
61
62 - xtesting-pi-run-containers: &xtesting-pi-run-containers
63     name: 'xtesting-pi-run-containers'
64     <<: *xtesting-pi-containers
65     test: '{test}'
66     privileged: '{privileged}'
67     network: '{network}'
68
69 - builder:
70     name: xtesting-pi-pull-containers
71     builders:
72       - shell: |
73           set +x
74           if [ "{repo}" = "_" ]; then
75             image={container}:{tag}
76           elif [ "{port}" = "None" ]; then
77             image={repo}/{container}:{tag}
78           else
79             image={repo}:{port}/{container}:{tag}
80           fi
81           sudo docker pull $image
82
83 - builder:
84     name: xtesting-pi-run-containers
85     builders:
86       - shell: |
87           set +x
88           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
89           if [ "{repo}" = "_" ]; then
90             image={container}:{tag}
91           elif [ "{port}" = "None" ]; then
92             image={repo}/{container}:{tag}
93           else
94             image={repo}:{port}/{container}:{tag}
95           fi
96           sudo docker run --rm \
97             --privileged={privileged} \
98             --network={network} \
99             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
100             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
101             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
102             -v /home/opnfv/xtesting/.boto:/root/.boto \
103             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
104             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
105             -e NODE_NAME=$slave \
106             -e BUILD_TAG=$BUILD_TAG \
107             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
108             $image run_tests -t {test} -p -r
109
110 - builder:
111     name: xtesting-pi-remove-images
112     builders:
113       - shell: |
114           set +x
115           if [ "{repo}" = "_" ]; then
116             image={container}:{tag}
117           elif [ "{port}" = "None" ]; then
118             image={repo}/{container}:{tag}
119           else
120             image={repo}:{port}/{container}:{tag}
121           fi
122           sudo docker rmi $image || true
123
124 - job-template:
125     name: 'xtesting-pi-{repo}-{container}-{tag}-pull'
126     parameters:
127       - xtesting-pi-slave:
128           slave: '{slave}'
129     builders:
130       - xtesting-pi-pull-containers:
131           <<: *xtesting-pi-containers
132
133 - project:
134     name: 'xtesting-pi-ollivier-xtesting-pull'
135     <<: *xtesting-pi-params
136     container: 'xtesting'
137     jobs:
138       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
139
140 - project:
141     name: 'xtesting-pi-ollivier-xtesting-mts-pull'
142     <<: *xtesting-pi-params
143     container: 'xtesting-mts'
144     jobs:
145       - 'xtesting-pi-{repo}-{container}-{tag}-pull'
146
147 - job-template:
148     name: 'xtesting-pi-{repo}-{container}-{tag}-rmi'
149     parameters:
150       - xtesting-pi-slave:
151           slave: '{slave}'
152     builders:
153       - xtesting-pi-remove-images:
154           <<: *xtesting-pi-containers
155
156 - project:
157     name: 'xtesting-pi-ollivier-xtesting-rmi'
158     <<: *xtesting-pi-params
159     container: 'xtesting'
160     jobs:
161       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
162
163 - project:
164     name: 'xtesting-pi-ollivier-xtesting-mts-rmi'
165     <<: *xtesting-pi-params
166     container: 'xtesting-mts'
167     jobs:
168       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
169
170 - job-template:
171     name: 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'
172     parameters:
173       - xtesting-pi-slave:
174           slave: '{slave}'
175       - xtesting-pi-build_tag:
176           build_tag: ''
177     builders:
178       - xtesting-pi-run-containers:
179           <<: *xtesting-pi-run-containers
180
181 - project:
182     name: 'xtesting-pi-ollivier-xtesting'
183     <<: *xtesting-pi-params
184     container: 'xtesting'
185     test:
186       - first
187       - second
188       - third
189       - fourth
190       - fifth
191       - sixth
192       - eighth
193     privileged: 'false'
194     network: bridge
195     exclude:
196       - tag: leguer
197         test: eighth
198       - tag: kali
199         test: eighth
200       - tag: jerma
201         test: eighth
202       - tag: arm-leguer
203         test: eighth
204       - tag: arm-kali
205         test: eighth
206       - tag: arm-jerma
207         test: eighth
208       - tag: arm64-leguer
209         test: eighth
210       - tag: arm64-kali
211         test: eighth
212       - tag: arm64-jerma
213         test: eighth
214     jobs:
215       - 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'
216
217 - project:
218     name: 'xtesting-pi-ollivier-xtesting-mts'
219     <<: *xtesting-pi-params
220     container: 'xtesting-mts'
221     test:
222       - seventh
223     privileged: 'false'
224     network: bridge
225     jobs:
226       - 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'
227
228 - builder:
229     name: xtesting-pi-zip
230     builders:
231       - shell: |
232           set +x
233           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
234           if [ "{repo}" = "_" ]; then
235             image={container}:{tag}
236           elif [ "{port}" = "None" ]; then
237             image={repo}/{container}:{tag}
238           else
239             image={repo}:{port}/{container}:{tag}
240           fi
241           sudo docker run --rm \
242             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
243             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
244             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
245             -v /home/opnfv/xtesting/.boto:/root/.boto \
246             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
247             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
248             -e BUILD_TAG=$BUILD_TAG \
249             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
250             $image zip_campaign
251
252 - job-template:
253     name: 'xtesting-pi-{tag}-zip'
254     parameters:
255       - xtesting-pi-slave:
256           slave: '{slave}'
257       - xtesting-pi-build_tag:
258           build_tag: ''
259     builders:
260       - xtesting-pi-zip:
261           <<: *xtesting-pi-containers
262
263 - project:
264     name: 'xtesting-pi-{tag}-zip'
265     <<: *xtesting-pi-params
266     container: 'xtesting'
267     jobs:
268       - 'xtesting-pi-{tag}-zip'
269
270 - job-template:
271     name: 'xtesting-pi-{tag}-daily'
272     project-type: multijob
273     triggers:
274       - timed: '@daily'
275     parameters:
276       - xtesting-pi-slave:
277           slave: '{slave}'
278       - xtesting-pi-build_tag:
279           build_tag: ''
280     # PyYAML and yamllint differ here
281     # see https://github.com/yaml/pyyaml/issues/234
282     # yamllint disable rule:indentation
283     properties:
284       - build-blocker:
285           blocking-jobs:
286           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
287     # yamllint enable rule:indentation
288     builders:
289       - multijob:
290           name: remove former images
291           projects:
292             - name: 'xtesting-pi-ollivier-xtesting-{tag}-rmi'
293               <<: *xtesting-pi-jobs
294             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-rmi'
295               <<: *xtesting-pi-jobs
296       - multijob:
297           name: pull containers
298           projects:
299             - name: 'xtesting-pi-ollivier-xtesting-{tag}-pull'
300               <<: *xtesting-pi-jobs
301             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-pull'
302               <<: *xtesting-pi-jobs
303       - multijob:
304           name: ollivier/xtesting:{tag}
305           projects:
306             - name: 'xtesting-pi-ollivier-xtesting-{tag}-first-run'
307               <<: *xtesting-pi-jobs
308             - name: 'xtesting-pi-ollivier-xtesting-{tag}-second-run'
309               <<: *xtesting-pi-jobs
310             - name: 'xtesting-pi-ollivier-xtesting-{tag}-third-run'
311               <<: *xtesting-pi-jobs
312             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fourth-run'
313               <<: *xtesting-pi-jobs
314             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fifth-run'
315               <<: *xtesting-pi-jobs
316             - name: 'xtesting-pi-ollivier-xtesting-{tag}-sixth-run'
317               <<: *xtesting-pi-jobs
318             - name: 'xtesting-pi-ollivier-xtesting-{tag}-eighth-run'
319               <<: *xtesting-pi-jobs
320       - multijob:
321           name: ollivier/xtesting-mts:{tag}
322           projects:
323             - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-seventh-run'
324               <<: *xtesting-pi-jobs
325       - multijob:
326           name: dump all campaign data
327           projects:
328             - name: 'xtesting-pi-{tag}-zip'
329               <<: *xtesting-pi-jobs
330
331 - project:
332     name: 'xtesting-pi-daily'
333     <<: *xtesting-pi-params
334     jobs:
335       - 'xtesting-pi-{tag}-daily'
336
337 - view:
338     name: xtesting-pi
339     view-type: list
340     columns:
341       - status
342       - weather
343       - job
344       - last-success
345       - last-failure
346       - last-duration
347     regex: ^xtesting-pi-[a-z-0-9.]+-daily$