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'
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 - 'set-functest-env-{pod}'
38 - 'clean-functest-env-{pod}'
39 - 'set-functest-env-{installer}-{stream}'
40 - 'functest-{installer}-{stream}'
41 - 'clean-functest-env-{installer}-{stream}'
42 - 'functest-openstack-bench-test-{pod}'
43 - 'functest-openstack-tempest-smoke-test-{pod}'
44 - 'functest-odl-test-{pod}'
45 - 'functest-vims-{installer}-{stream}'
46 - 'functest-vping-test-{pod}'
47 - 'functest-daily-{stream}'
48 - 'functest-merge-{stream}'
49 - 'functest-verify-{stream}'
51 # stream: branch with - in place of / (eg. stable-arno)
52 # branch: branch (eg. stable/arno)
63 ################################
65 ################################
67 name: set-functest-env-{pod}
74 artifactDaysToKeep: -1
81 name: clean-functest-env-{pod}
88 artifactDaysToKeep: -1
95 name: set-functest-env-{installer}-{stream}
102 artifactDaysToKeep: -1
103 artifactNumToKeep: -1
109 name: clean-functest-env-{installer}-{stream}
116 artifactDaysToKeep: -1
117 artifactNumToKeep: -1
123 name: functest-openstack-bench-test-{pod}
130 artifactDaysToKeep: -1
131 artifactNumToKeep: -1
134 - 'functest-rally-bench'
137 name: functest-openstack-tempest-smoke-test-{pod}
144 artifactDaysToKeep: -1
145 artifactNumToKeep: -1
148 - 'functest-tempest-smoke'
151 name: functest-odl-test-{pod}
158 artifactDaysToKeep: -1
159 artifactNumToKeep: -1
166 name: functest-vping-test-{pod}
173 artifactDaysToKeep: -1
174 artifactNumToKeep: -1
190 default: '{installer_type}'
191 description: "Installer name that is used for deployment."
194 default: '{installer_ip}'
195 description: "Installer IP."
200 credentials-id: '{ssh-credentials}'
207 artifactDaysToKeep: -1
208 artifactNumToKeep: -1
214 - 'functest-store-results'
217 name: functest-{installer}-{stream}
227 default: '{installer_type}'
228 description: "Installer name that is used for deployment."
231 default: '{installer_ip}'
232 description: "Installer IP."
235 default: ssh://gerrit.opnfv.org:29418/$PROJECT
236 description: "Override GIT_BASE"
240 credentials-id: '{ssh-credentials}'
247 artifactDaysToKeep: -1
248 artifactNumToKeep: -1
254 - 'functest-store-results'
257 name: functest-vims-{installer}-{stream}
267 default: '{installer_type}'
268 description: "Installer name that is used for deployment."
271 default: '{installer_ip}'
272 description: "Installer IP."
275 default: ssh://gerrit.opnfv.org:29418/$PROJECT
276 description: "Override GIT_BASE"
280 credentials-id: '{ssh-credentials}'
287 artifactDaysToKeep: -1
288 artifactNumToKeep: -1
294 name: 'functest-daily-{stream}'
296 # Job template for daily builders
298 # Required Variables:
299 # stream: branch with - in place of / (eg. stable)
300 # branch: branch (eg. stable)
302 varsetabove: '{somevar}'
307 - functest-parameter:
308 gs-pathname: '{gs-pathname}'
312 credentials-id: '{ssh-credentials}'
317 - 'functest-{stream}'
324 !include-raw ../opnfvdocs/docu-build.sh
330 name: 'functest-verify-{stream}'
335 artifactDaysToKeep: -1
336 artifactNumToKeep: -1
344 - gerrit-trigger-scm:
345 credentials-id: '{ssh-credentials}'
346 refspec: '$GERRIT_REFSPEC'
347 choosing-strategy: 'gerrit'
352 - patchset-created-event:
353 exclude-drafts: 'false'
354 exclude-trivial-rebase: 'false'
355 exclude-no-code-change: 'false'
356 - draft-published-event
357 - comment-added-contains-event:
358 comment-contains-value: 'recheck'
359 - comment-added-contains-event:
360 comment-contains-value: 'reverify'
362 - project-compare-type: 'ANT'
363 project-pattern: 'functest'
365 - branch-compare-type: 'ANT'
366 branch-pattern: '**/{branch}'
370 !include-raw ../opnfvdocs/docu-build.sh
373 name: 'functest-merge-{stream}'
375 # builder-merge job to run JJB update
377 # This job's purpose is to update all the JJB
386 - gerrit-trigger-scm:
387 credentials-id: '{ssh-credentials}'
389 choosing-strategy: 'default'
394 - change-merged-event
395 - comment-added-contains-event:
396 comment-contains-value: 'remerge'
398 - project-compare-type: 'ANT'
399 project-pattern: 'functest'
401 - branch-compare-type: 'ANT'
402 branch-pattern: '**/{branch}'
406 !include-raw ../opnfvdocs/docu-build.sh
408 ########################
410 ########################
412 name: functest-parameter
416 default: '{gs-pathname}'
417 description: "Version directory where the opnfv documents will be stored in gs repository"
419 name: FUNCTEST_REPO_DIR
420 default: "/home/opnfv/repos/functest"
421 description: "Directory where the Functest repository is cloned"
428 default: https://gerrit.opnfv.org/gerrit/$PROJECT
429 description: "Override GIT_BASE"
436 default: https://gerrit.opnfv.org/gerrit/$PROJECT
437 description: "Override GIT_BASE"
440 default: "/home/opnfv/repos/functest"
441 description: "Openstack credentials on the dev lab"
448 default: ssh://gerrit.opnfv.org:29418/$PROJECT
449 description: "Override GIT_BASE"
456 default: ssh://gerrit.opnfv.org:29418/$PROJECT
457 description: "Override GIT_BASE"
458 ########################
460 ########################
462 name: 'functest-master'
464 - pollscm: "H 9 * * *"
467 name: 'functest-stable-arno'
469 - pollscm: "H 21 * * *"
471 ########################
473 ########################
482 echo "Functest: running all the tests"
483 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
484 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
485 docker exec $container_id $cmd
488 name: set-functest-env
493 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
494 INSTALLER_IP=$(cat instack /var/lib/libvirt/dnsmasq/default.leases \
495 |sed 's/.*192/192/g' | sed 's/\ in.*//g')
497 echo "Functest: Start Docker and prepare environment"
498 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME}"
500 # If production lab then creds may be retrieved dynamically
501 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
502 if [ -n "${LAB_CONFIG}" ]; then
503 labconfig="-v ${LAB_CONFIG}:/home/opnfv/functest/conf/openstack.creds"
505 docker pull opnfv/functest:latest_stable
506 cmd="docker run -id -e $envs ${labconfig} opnfv/functest:latest_stable /bin/bash"
507 echo "Functest: Running docker run command: ${cmd}"
511 container_id=$(docker ps | grep 'opnfv/functest:latest_stable' | awk '{print $1}' | head -1)
512 echo "Container ID=${container_id}"
513 if [ -z ${container_id} ]; then
514 echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing."
518 echo "Starting the container: docker start ${container_id}"
519 docker start ${container_id}
522 if [ $(docker ps | grep 'opnfv/functest:latest_stable' | wc -l) == 0 ]; then
523 echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..."
526 cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
527 echo "Executing command inside the docker: ${cmd}"
528 docker exec ${container_id} ${cmd}
537 echo "Functest: run vPing"
538 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
539 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
540 docker exec $container_id $cmd
549 echo "Functest: run ODL suite"
550 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
551 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
552 docker exec $container_id $cmd
555 name: functest-tempest-smoke
562 echo "Functest: run Tempest suite"
563 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
564 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
565 docker exec $container_id $cmd
568 name: functest-rally-bench
574 echo "Functest: run Functest Rally Bench suites"
575 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
576 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
577 docker exec $container_id $cmd
586 echo "Functest: run Functest vIMS test"
587 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims"
588 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
589 docker exec $container_id $cmd
592 name: functest-store-results
595 !include-raw res-build.sh
598 name: functest-cleanup
603 echo "Cleaning up docker containers/images..."
605 # Remove previous running containers if exist
606 if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
607 echo "Removing existing opnfv/functest containers..."
608 docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop
609 docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm
612 # Remove existing images if exist
613 if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
614 echo "Docker images to remove:"
615 docker images | head -1 && docker images | grep opnfv/functest
616 image_tags=($(docker images | grep opnfv/functest | awk '{print $2}'))
617 for tag in "${image_tags[@]}"; do
618 echo "Removing docker image opnfv/functest:$tag..."
619 docker rmi opnfv/functest:$tag