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'
27 installer_type: 'fuel'
28 installer_ip: '172.30.10.73'
31 node: 'orange-fr-pod2'
32 installer_type: 'joid'
33 installer_ip: '127.0.0.1'
36 node: 'huawei-us-deploy-bare-1'
37 installer_type: 'compass'
38 installer_ip: '192.168.200.2'
42 - 'set-functest-env-{pod}'
44 - 'clean-functest-env-{pod}'
45 - 'set-functest-env-{installer}-{stream}'
46 - 'functest-{installer}-{stream}'
47 - 'clean-functest-env-{installer}-{stream}'
48 - 'functest-openstack-bench-test-{pod}'
49 - 'functest-openstack-tempest-smoke-test-{pod}'
50 - 'functest-odl-test-{pod}'
51 - 'functest-vims-{installer}-{stream}'
52 - 'functest-vping-test-{pod}'
53 - 'functest-daily-{stream}'
54 - 'functest-merge-{stream}'
55 - 'functest-verify-{stream}'
57 # stream: branch with - in place of / (eg. stable-arno)
58 # branch: branch (eg. stable/arno)
69 ################################
71 ################################
73 name: set-functest-env-{pod}
81 name: clean-functest-env-{pod}
89 name: set-functest-env-{installer}-{stream}
97 name: clean-functest-env-{installer}-{stream}
105 name: functest-openstack-bench-test-{pod}
110 - 'functest-rally-bench'
113 name: functest-openstack-tempest-smoke-test-{pod}
118 - 'functest-tempest-smoke'
121 name: functest-odl-test-{pod}
130 name: functest-vping-test-{pod}
148 default: '{installer_type}'
149 description: "Installer name that is used for deployment."
152 default: '{installer_ip}'
153 description: "Installer IP."
158 credentials-id: '{ssh-credentials}'
166 - 'functest-store-results'
169 name: functest-{installer}-{stream}
179 default: '{installer_type}'
180 description: "Installer name that is used for deployment."
183 default: '{installer_ip}'
184 description: "Installer IP."
187 default: ssh://gerrit.opnfv.org:29418/$PROJECT
188 description: "Override GIT_BASE"
192 credentials-id: '{ssh-credentials}'
200 - 'functest-store-results'
203 name: functest-vims-{installer}-{stream}
213 default: '{installer_type}'
214 description: "Installer name that is used for deployment."
217 default: '{installer_ip}'
218 description: "Installer IP."
221 default: ssh://gerrit.opnfv.org:29418/$PROJECT
222 description: "Override GIT_BASE"
226 credentials-id: '{ssh-credentials}'
234 name: 'functest-daily-{stream}'
236 # Job template for daily builders
238 # Required Variables:
239 # stream: branch with - in place of / (eg. stable)
240 # branch: branch (eg. stable)
242 varsetabove: '{somevar}'
247 - functest-parameter:
248 gs-pathname: '{gs-pathname}'
252 credentials-id: '{ssh-credentials}'
257 - 'functest-{stream}'
264 !include-raw ../opnfvdocs/docu-build.sh
270 name: 'functest-verify-{stream}'
278 - gerrit-trigger-scm:
279 credentials-id: '{ssh-credentials}'
280 refspec: '$GERRIT_REFSPEC'
281 choosing-strategy: 'gerrit'
286 - patchset-created-event:
287 exclude-drafts: 'false'
288 exclude-trivial-rebase: 'false'
289 exclude-no-code-change: 'false'
290 - draft-published-event
291 - comment-added-contains-event:
292 comment-contains-value: 'recheck'
293 - comment-added-contains-event:
294 comment-contains-value: 'reverify'
296 - project-compare-type: 'ANT'
297 project-pattern: 'functest'
299 - branch-compare-type: 'ANT'
300 branch-pattern: '**/{branch}'
304 !include-raw ../opnfvdocs/docu-build.sh
307 name: 'functest-merge-{stream}'
309 # builder-merge job to run JJB update
311 # This job's purpose is to update all the JJB
320 - gerrit-trigger-scm:
321 credentials-id: '{ssh-credentials}'
323 choosing-strategy: 'default'
328 - change-merged-event
329 - comment-added-contains-event:
330 comment-contains-value: 'remerge'
332 - project-compare-type: 'ANT'
333 project-pattern: 'functest'
335 - branch-compare-type: 'ANT'
336 branch-pattern: '**/{branch}'
340 !include-raw ../opnfvdocs/docu-build.sh
342 ########################
344 ########################
346 name: functest-parameter
350 default: '{gs-pathname}'
351 description: "Version directory where the opnfv documents will be stored in gs repository"
353 name: FUNCTEST_REPO_DIR
354 default: "/home/opnfv/repos/functest"
355 description: "Directory where the Functest repository is cloned"
362 default: https://gerrit.opnfv.org/gerrit/$PROJECT
363 description: "Override GIT_BASE"
370 default: https://gerrit.opnfv.org/gerrit/$PROJECT
371 description: "Override GIT_BASE"
374 default: "/home/opnfv/repos/functest"
375 description: "Openstack credentials on the dev lab"
382 default: ssh://gerrit.opnfv.org:29418/$PROJECT
383 description: "Override GIT_BASE"
390 default: https://gerrit.opnfv.org/gerrit/$PROJECT
391 description: "Override GIT_BASE"
398 default: ssh://gerrit.opnfv.org:29418/$PROJECT
399 description: "Override GIT_BASE"
400 ########################
402 ########################
404 name: 'functest-master'
406 - pollscm: "H 9 * * *"
409 name: 'functest-stable-arno'
411 - pollscm: "H 21 * * *"
413 ########################
415 ########################
424 echo "Functest: running all the tests"
425 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
426 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
427 docker exec $container_id $cmd
430 name: set-functest-env
435 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
436 INSTALLER_IP=$(cat instack /var/lib/libvirt/dnsmasq/default.leases \
437 |sed 's/.*192/192/g' | sed 's/\ in.*//g')
438 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
440 echo "Functest: Start Docker and prepare environment"
441 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME}"
443 # If production lab then creds may be retrieved dynamically
444 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
445 if [ -n "${LAB_CONFIG}" ]; then
446 labconfig="-v ${LAB_CONFIG}:/home/opnfv/functest/conf/openstack.creds"
449 docker pull opnfv/functest:latest_stable
450 cmd="docker run -id -e $envs ${labconfig} ${sshkey} opnfv/functest:latest_stable /bin/bash"
451 echo "Functest: Running docker run command: ${cmd}"
455 container_id=$(docker ps | grep 'opnfv/functest:latest_stable' | awk '{print $1}' | head -1)
456 echo "Container ID=${container_id}"
457 if [ -z ${container_id} ]; then
458 echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing."
462 echo "Starting the container: docker start ${container_id}"
463 docker start ${container_id}
466 if [ $(docker ps | grep 'opnfv/functest:latest_stable' | wc -l) == 0 ]; then
467 echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..."
470 cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
471 echo "Executing command inside the docker: ${cmd}"
472 docker exec ${container_id} ${cmd}
481 echo "Functest: run vPing"
482 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
483 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
484 docker exec $container_id $cmd
493 echo "Functest: run ODL suite"
494 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
495 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
496 docker exec $container_id $cmd
499 name: functest-tempest-smoke
506 echo "Functest: run Tempest suite"
507 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
508 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
509 docker exec $container_id $cmd
512 name: functest-rally-bench
518 echo "Functest: run Functest Rally Bench suites"
519 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
520 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
521 docker exec $container_id $cmd
530 echo "Functest: run Functest vIMS test"
531 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims"
532 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
533 docker exec $container_id $cmd
536 name: functest-store-results
539 !include-raw res-build.sh
542 name: functest-cleanup
547 echo "Cleaning up docker containers/images..."
549 # Remove previous running containers if exist
550 if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
551 echo "Removing existing opnfv/functest containers..."
552 docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop
553 docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm
556 # Remove existing images if exist
557 if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
558 echo "Docker images to remove:"
559 docker images | head -1 && docker images | grep opnfv/functest
560 image_tags=($(docker images | grep opnfv/functest | awk '{print $2}'))
561 for tag in "${image_tags[@]}"; do
562 echo "Removing docker image opnfv/functest:$tag..."
563 docker rmi opnfv/functest:$tag