1 ###################################
2 # job configuration for functest
3 ###################################
10 installer_type: 'fuel'
11 installer_ip: '10.20.0.2'
14 installer_type: 'foreman'
15 installer_ip: '172.30.10.73'
18 installer_type: 'apex'
19 installer_ip: '192.168.X.X'
21 node: 'huawei-us-deploy-bare-1'
22 installer_type: 'compass'
23 installer_ip: '192.168.200.2'
26 installer_type: 'compass'
27 installer_ip: '127.0.0.1'
31 installer_type: 'fuel'
32 installer_ip: '172.30.10.73'
34 node: 'orange-fr-pod2'
35 installer_type: 'joid'
36 installer_ip: '127.0.0.1'
38 node: 'huawei-us-deploy-bare-1'
39 installer_type: 'compass'
40 installer_ip: '192.168.200.2'
43 installer_type: 'joid'
44 installer_ip: '127.0.0.1'
47 - 'set-functest-env-{pod}'
49 - 'clean-functest-env-{pod}'
50 - 'set-functest-env-{installer}-{stream}'
51 - 'functest-{installer}-{stream}'
52 - 'clean-functest-env-{installer}-{stream}'
53 - 'functest-openstack-bench-test-{pod}'
54 - 'functest-openstack-tempest-smoke-test-{pod}'
55 - 'functest-odl-test-{pod}'
56 - 'functest-vims-{installer}-{stream}'
57 - 'functest-vping-test-{pod}'
58 - 'functest-verify-{stream}'
60 # stream: branch with - in place of / (eg. stable-arno)
61 # branch: branch (eg. stable/arno)
72 ################################
74 ################################
76 name: set-functest-env-{pod}
84 name: clean-functest-env-{pod}
92 name: set-functest-env-{installer}-{stream}
100 name: clean-functest-env-{installer}-{stream}
108 name: functest-openstack-bench-test-{pod}
113 - 'functest-rally-bench'
116 name: functest-openstack-tempest-smoke-test-{pod}
121 - 'functest-tempest-smoke'
124 name: functest-odl-test-{pod}
133 name: functest-vping-test-{pod}
151 default: '{installer_type}'
152 description: "Installer name that is used for deployment."
155 default: '{installer_ip}'
156 description: "Installer IP."
161 credentials-id: '{ssh-credentials}'
169 - 'functest-store-results'
172 name: functest-{installer}-{stream}
182 default: '{installer_type}'
183 description: "Installer name that is used for deployment."
186 default: '{installer_ip}'
187 description: "Installer IP."
190 default: ssh://gerrit.opnfv.org:29418/$PROJECT
191 description: "Override GIT_BASE"
195 credentials-id: '{ssh-credentials}'
203 - 'functest-store-results'
206 name: functest-vims-{installer}-{stream}
216 default: '{installer_type}'
217 description: "Installer name that is used for deployment."
220 default: '{installer_ip}'
221 description: "Installer IP."
224 default: ssh://gerrit.opnfv.org:29418/$PROJECT
225 description: "Override GIT_BASE"
229 credentials-id: '{ssh-credentials}'
237 name: 'functest-verify-{stream}'
245 - gerrit-trigger-scm:
246 credentials-id: '{ssh-credentials}'
247 refspec: '$GERRIT_REFSPEC'
248 choosing-strategy: 'gerrit'
253 - patchset-created-event:
254 exclude-drafts: 'false'
255 exclude-trivial-rebase: 'false'
256 exclude-no-code-change: 'false'
257 - draft-published-event
258 - comment-added-contains-event:
259 comment-contains-value: 'recheck'
260 - comment-added-contains-event:
261 comment-contains-value: 'reverify'
263 - project-compare-type: 'ANT'
264 project-pattern: 'functest'
266 - branch-compare-type: 'ANT'
267 branch-pattern: '**/{branch}'
271 echo "Nothing to verify!"
273 ########################
275 ########################
277 name: functest-parameter
281 default: '{gs-pathname}'
282 description: "Version directory where the opnfv documents will be stored in gs repository"
284 name: FUNCTEST_REPO_DIR
285 default: "/home/opnfv/repos/functest"
286 description: "Directory where the Functest repository is cloned"
293 default: https://gerrit.opnfv.org/gerrit/$PROJECT
294 description: "Override GIT_BASE"
301 default: https://gerrit.opnfv.org/gerrit/$PROJECT
302 description: "Override GIT_BASE"
305 default: "/home/opnfv/repos/functest"
306 description: "Openstack credentials on the dev lab"
313 default: ssh://gerrit.opnfv.org:29418/$PROJECT
314 description: "Override GIT_BASE"
321 default: https://gerrit.opnfv.org/gerrit/$PROJECT
322 description: "Override GIT_BASE"
329 default: https://gerrit.opnfv.org/gerrit/$PROJECT
330 description: "Override GIT_BASE"
333 default: "/home/ubuntu/joid_config/admin-openrc"
334 description: "Openstack credentials on the dev lab"
341 default: ssh://gerrit.opnfv.org:29418/$PROJECT
342 description: "Override GIT_BASE"
343 ########################
345 ########################
347 name: 'functest-master'
349 - pollscm: "H 9 * * *"
352 name: 'functest-stable-arno'
354 - pollscm: "H 21 * * *"
356 ########################
358 ########################
367 echo "Functest: running all the tests"
368 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
369 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
370 docker exec $container_id $cmd
373 name: set-functest-env
378 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
379 INSTALLER_IP=$(grep instack /var/lib/libvirt/dnsmasq/default.leases \
380 |awk '{print $3}' | head -n 1)
381 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
383 echo "Functest: Start Docker and prepare environment"
384 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME}"
386 # If production lab then creds may be retrieved dynamically
387 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
388 if [ -n "${LAB_CONFIG}" ]; then
389 labconfig="-v ${LAB_CONFIG}:/home/opnfv/functest/conf/openstack.creds"
392 docker pull opnfv/functest:latest_stable
393 cmd="docker run -id -e $envs ${labconfig} ${sshkey} opnfv/functest:latest_stable /bin/bash"
394 echo "Functest: Running docker run command: ${cmd}"
398 container_id=$(docker ps | grep 'opnfv/functest:latest_stable' | awk '{print $1}' | head -1)
399 echo "Container ID=${container_id}"
400 if [ -z ${container_id} ]; then
401 echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing."
405 echo "Starting the container: docker start ${container_id}"
406 docker start ${container_id}
409 if [ $(docker ps | grep 'opnfv/functest:latest_stable' | wc -l) == 0 ]; then
410 echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..."
413 cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
414 echo "Executing command inside the docker: ${cmd}"
415 docker exec ${container_id} ${cmd}
424 echo "Functest: run vPing"
425 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
426 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
427 docker exec $container_id $cmd
436 echo "Functest: run ODL suite"
437 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
438 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
439 docker exec $container_id $cmd
442 name: functest-tempest-smoke
449 echo "Functest: run Tempest suite"
450 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
451 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
452 docker exec $container_id $cmd
455 name: functest-rally-bench
461 echo "Functest: run Functest Rally Bench suites"
462 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
463 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
464 docker exec $container_id $cmd
473 echo "Functest: run Functest vIMS test"
474 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims"
475 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
476 docker exec $container_id $cmd
479 name: functest-store-results
482 !include-raw res-build.sh
485 name: functest-cleanup
490 echo "Cleaning up docker containers/images..."
492 # Remove previous running containers if exist
493 if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
494 echo "Removing existing opnfv/functest containers..."
495 docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop
496 docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm
499 # Remove existing images if exist
500 if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
501 echo "Docker images to remove:"
502 docker images | head -1 && docker images | grep opnfv/functest
503 image_tags=($(docker images | grep opnfv/functest | awk '{print $2}'))
504 for tag in "${image_tags[@]}"; do
505 echo "Removing docker image opnfv/functest:$tag..."
506 docker rmi opnfv/functest:$tag