[compass] yardstick testing of compass-virtual-deployment use huawei's node
[releng.git] / jjb / yardstick / yardstick-ci-jobs.yml
1 ###################################
2 # job configuration for functest
3 ###################################
4 - project:
5     name: yardstick
6
7     project: '{name}'
8
9 #--------------------------------
10 # BRANCH ANCHORS
11 #--------------------------------
12     master: &master
13         stream: master
14         branch: '{stream}'
15         gs-pathname: ''
16     brahmaputra: &brahmaputra
17         stream: brahmaputra
18         branch: 'stable/{stream}'
19         gs-pathname: '{stream}'
20 #--------------------------------
21 # POD, INSTALLER, AND BRANCH MAPPING
22 #--------------------------------
23 #        brahmaputra
24 #--------------------------------
25     pod:
26         - opnfv-jump-1:
27             installer: apex
28             suite: daily
29             <<: *brahmaputra
30         - opnfv-jump-2:
31             installer: fuel
32             suite: daily
33             <<: *brahmaputra
34         - intel-pod5:
35             installer: joid
36             suite: daily
37             <<: *brahmaputra
38         - huawei-us-deploy-bare-1:
39             installer: compass
40             suite: daily
41             <<: *brahmaputra
42         - ericsson-pod1:
43             installer: fuel
44             suite: daily
45             <<: *brahmaputra
46         - virtual:
47             installer: fuel
48             suite: daily
49             <<: *brahmaputra
50         - huawei-virtual:
51             installer: compass
52             suite: daily
53             <<: *brahmaputra
54         - virtual:
55             installer: joid
56             suite: daily
57             <<: *brahmaputra
58 #--------------------------------
59 #        master
60 #--------------------------------
61         - ericsson-pod1:
62             installer: fuel
63             suite: daily
64             <<: *master
65         - ericsson-pod1:
66             installer: fuel
67             suite: vtcdaily
68             <<: *master
69         - ericsson-pod2:
70             installer: fuel
71             suite: daily
72             <<: *master
73         - intel-pod6:
74             installer: joid
75             suite: daily
76             <<: *master
77         - intel-pod8:
78             installer: compass
79             suite: daily
80             <<: *master
81         - zte-build-1:
82             installer: fuel
83             suite: daily
84             <<: *master
85         - orange-pod2:
86             installer: joid
87             suite: daily
88             <<: *master
89         - opnfv-jump-1:
90             installer: apex
91             suite: daily
92             <<: *master
93         - virtual:
94             installer: fuel
95             suite: daily
96             <<: *master
97         - huawei-virtual:
98             installer: compass
99             suite: daily
100             <<: *master
101         - virtual:
102             installer: joid
103             suite: daily
104             <<: *master
105 #--------------------------------
106
107     jobs:
108         - 'yardstick-{installer}-{pod}-{suite}-{stream}'
109
110 ################################
111 # job templates
112 ################################
113 - job-template:
114     name: 'yardstick-{installer}-{pod}-{suite}-{stream}'
115
116     disabled: false
117
118     concurrent: true
119
120     properties:
121         - throttle:
122             enabled: true
123             max-per-node: 1
124
125     wrappers:
126         - build-name:
127             name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
128
129     triggers:
130         - 'yardstick-{pod}-trigger'
131
132     parameters:
133         - project-parameter:
134             project: '{project}'
135         - '{pod}-defaults'
136         - '{installer}-defaults'
137         - 'yardstick-params-{pod}'
138         - string:
139             name: DEPLOY_SCENARIO
140             default: 'os-odl_l2-nofeature-ha'
141         - string:
142             name: YARDSTICK_SUITE_NAME
143             default: opnfv_${{NODE_NAME}}_{suite}.yaml
144             description: 'Path to test suite'
145         - string:
146             name: CI_DEBUG
147             default: 'false'
148             description: "Show debut output information"
149
150     scm:
151         - git-scm:
152             credentials-id: '{ssh-credentials}'
153             refspec: ''
154             branch: '{branch}'
155
156     builders:
157         - 'yardstick-cleanup'
158         #- 'yardstick-fetch-os-creds'
159         - 'yardstick-{suite}'
160
161     publishers:
162         - email:
163             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
164
165 ########################
166 # builder macros
167 ########################
168 - builder:
169     name: yardstick-daily
170     builders:
171         - shell: |
172             #!/bin/bash
173             set -e
174             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
175
176             # labconfig is used only for joid
177             labconfig=""
178             sshkey=""
179             if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
180                 instack_mac=$(sudo virsh domiflist instack | grep default | \
181                               grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
182                 INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
183                 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
184                 if [[ -n $(sudo iptables -L FORWARD |grep "REJECT"|grep "reject-with icmp-port-unreachable") ]]; then
185                     #note: this happens only in opnfv-lf-pod1
186                     sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
187                     sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
188                 fi
189             elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
190                 # If production lab then creds may be retrieved dynamically
191                 # creds are on the jumphost, always in the same folder
192                 labconfig="-v $LAB_CONFIG/admin-openrc:/home/opnfv/openrc"
193                 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
194                 # replace the default one by the customized one provided by jenkins config
195             fi
196
197             opts="--privileged=true --rm"
198             envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
199                 -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \
200                 -e YARDSTICK_BRANCH=${GIT_BRANCH##origin/} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO}"
201
202             # Pull the latest image
203             docker pull opnfv/yardstick >$redirect
204
205             # Run docker
206             cmd="sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/yardstick \
207                 run_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SUITE_NAME}"
208             echo "Yardstick: Running docker cmd: ${cmd}"
209             ${cmd}
210
211             echo "Yardstick: done!"
212
213 - builder:
214     name: yardstick-vtcdaily
215     builders:
216         - shell: |
217             #!/bin/bash
218             set -e
219             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
220
221             cd $WORKSPACE
222             ./ci/apexlake-verify
223
224 - builder:
225     name: yardstick-fetch-os-creds
226     builders:
227         - shell:
228             !include-raw: ../../utils/fetch_os_creds.sh
229
230 - builder:
231     name: yardstick-cleanup
232     builders:
233         - shell: |
234             #!/bin/bash
235             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
236
237             echo "Cleaning up docker containers/images..."
238             # Remove previous running containers if exist
239             if [[ ! -z $(docker ps -a | grep opnfv/yardstick) ]]; then
240                 echo "Removing existing opnfv/yardstick containers..."
241                 docker ps -a | grep opnfv/yardstick | awk '{print $1}' | xargs docker rm -f >$redirect
242
243             fi
244
245             # Remove existing images if exist
246             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
247                 echo "Docker images to remove:"
248                 docker images | head -1 && docker images | grep opnfv/yardstick
249                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
250                 for tag in "${image_tags[@]}"; do
251                     echo "Removing docker image opnfv/yardstick:$tag..."
252                     docker rmi opnfv/yardstick:$tag >$redirect
253
254                 done
255             fi
256 ########################
257 # parameter macros
258 ########################
259 - parameter:
260     name: 'yardstick-params-intel-pod5'
261     parameters:
262         - string:
263             name: YARDSTICK_DB_BACKEND
264             default: ''
265             description: 'Arguments to use in order to choose the backend DB'
266
267 - parameter:
268     name: 'yardstick-params-intel-pod6'
269     parameters:
270         - string:
271             name: YARDSTICK_DB_BACKEND
272             default: ''
273             description: 'Arguments to use in order to choose the backend DB'
274
275 - parameter:
276     name: 'yardstick-params-intel-pod8'
277     parameters:
278         - string:
279             name: YARDSTICK_DB_BACKEND
280             default: ''
281             description: 'Arguments to use in order to choose the backend DB'
282
283 - parameter:
284     name: 'yardstick-params-ericsson-pod1'
285     parameters:
286         - string:
287             name: YARDSTICK_DB_BACKEND
288             default: '-i 10.118.36.90:8086'
289             description: 'Arguments to use in order to choose the backend DB'
290
291 - parameter:
292     name: 'yardstick-params-ericsson-pod2'
293     parameters:
294         - string:
295             name: YARDSTICK_DB_BACKEND
296             default: '-i 10.118.36.90:8086'
297             description: 'Arguments to use in order to choose the backend DB'
298
299 - parameter:
300     name: 'yardstick-params-opnfv-jump-1'
301     parameters:
302         - string:
303             name: YARDSTICK_DB_BACKEND
304             default: '-r 213.77.62.197/results'
305             description: 'Arguments to use in order to choose the backend DB'
306
307 - parameter:
308     name: 'yardstick-params-opnfv-jump-2'
309     parameters:
310         - string:
311             name: YARDSTICK_DB_BACKEND
312             default: '-r 213.77.62.197/results'
313             description: 'Arguments to use in order to choose the backend DB'
314
315 - parameter:
316     name: 'yardstick-params-huawei-us-deploy-bare-1'
317     parameters:
318         - string:
319             name: YARDSTICK_DB_BACKEND
320             default: ''
321             description: 'Arguments to use in order to choose the backend DB'
322
323 - parameter:
324     name: 'yardstick-params-zte-build-1'
325     parameters:
326         - string:
327             name: YARDSTICK_DB_BACKEND
328             default: ''
329             description: 'Arguments to use in order to choose the backend DB'
330
331 - parameter:
332     name: 'yardstick-params-orange-pod2'
333     parameters:
334         - string:
335             name: YARDSTICK_DB_BACKEND
336             default: ''
337             description: 'Arguments to use in order to choose the backend DB'
338
339 - parameter:
340     name: 'yardstick-params-virtual'
341     parameters:
342         - string:
343             name: YARDSTICK_DB_BACKEND
344             default: ''
345             description: 'Arguments to use in order to choose the backend DB'
346
347 - parameter:
348     name: 'yardstick-params-huawei-virtual'
349     parameters:
350         - string:
351             name: YARDSTICK_DB_BACKEND
352             default: ''
353             description: 'Arguments to use in order to choose the backend DB'
354
355 #######################
356 ## trigger macros
357 #######################
358 # trigger for PODs to only run yardstick test suites
359 - trigger:
360     name: 'yardstick-zte-build-1-trigger'
361     triggers:
362         - timed: '0 2 * * *'
363
364 - trigger:
365     name: 'yardstick-intel-pod5-trigger'
366     triggers:
367         - timed: ''
368
369 - trigger:
370     name: 'yardstick-intel-pod6-trigger'
371     triggers:
372         - timed: ''
373
374 - trigger:
375     name: 'yardstick-intel-pod8-trigger'
376     triggers:
377         - timed: ''
378
379 - trigger:
380     name: 'yardstick-ericsson-pod1-trigger'
381     triggers:
382         - timed: ''
383
384 - trigger:
385     name: 'yardstick-ericsson-pod2-trigger'
386     triggers:
387         - timed: ''
388
389 - trigger:
390     name: 'yardstick-opnfv-jump-1-trigger'
391     triggers:
392         - timed: ''
393
394 - trigger:
395     name: 'yardstick-opnfv-jump-2-trigger'
396     triggers:
397         - timed: ''
398
399 - trigger:
400     name: 'yardstick-huawei-us-deploy-bare-1-trigger'
401     triggers:
402         - timed: ''
403
404 - trigger:
405     name: 'yardstick-orange-pod2-trigger'
406     triggers:
407         - timed: ''
408
409 - trigger:
410     name: 'yardstick-virtual-trigger'
411     triggers:
412         - timed: ''
413
414 - trigger:
415     name: 'yardstick-huawei-virtual-trigger'
416     triggers:
417         - timed: ''