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'
23 installer_type: 'foreman'
24 installer_ip: '172.30.10.73'
27 - 'set-functest-env-{pod}'
29 - 'clean-functest-env-{pod}'
30 - 'set-functest-env-{installer}-{stream}'
31 - 'functest-{installer}-{stream}'
32 - 'clean-functest-env-{installer}-{stream}'
33 - 'functest-openstack-bench-test-{pod}'
34 - 'functest-openstack-tempest-smoke-test-{pod}'
35 - 'functest-odl-test-{pod}'
36 - 'functest-vims-{installer}-{stream}'
37 - 'functest-vping-test-{pod}'
38 - 'functest-daily-{stream}'
39 - 'functest-merge-{stream}'
40 - 'functest-verify-{stream}'
42 # stream: branch with - in place of / (eg. stable-arno)
43 # branch: branch (eg. stable/arno)
54 ################################
56 ################################
58 name: set-functest-env-{pod}
65 artifactDaysToKeep: -1
72 name: clean-functest-env-{pod}
79 artifactDaysToKeep: -1
86 name: set-functest-env-{installer}-{stream}
93 artifactDaysToKeep: -1
100 name: clean-functest-env-{installer}-{stream}
107 artifactDaysToKeep: -1
108 artifactNumToKeep: -1
114 name: functest-openstack-bench-test-{pod}
121 artifactDaysToKeep: -1
122 artifactNumToKeep: -1
125 - 'functest-rally-bench'
128 name: functest-openstack-tempest-smoke-test-{pod}
135 artifactDaysToKeep: -1
136 artifactNumToKeep: -1
139 - 'functest-tempest-smoke'
142 name: functest-odl-test-{pod}
149 artifactDaysToKeep: -1
150 artifactNumToKeep: -1
157 name: functest-vping-test-{pod}
164 artifactDaysToKeep: -1
165 artifactNumToKeep: -1
181 default: '{installer_type}'
182 description: "Installer name that is used for deployment."
185 default: '{installer_ip}'
186 description: "Installer IP."
191 credentials-id: '{ssh-credentials}'
198 artifactDaysToKeep: -1
199 artifactNumToKeep: -1
205 - 'functest-store-results'
208 name: functest-{installer}-{stream}
218 default: '{installer_type}'
219 description: "Installer name that is used for deployment."
222 default: '{installer_ip}'
223 description: "Installer IP."
226 default: ssh://gerrit.opnfv.org:29418/$PROJECT
227 description: "Override GIT_BASE"
231 credentials-id: '{ssh-credentials}'
238 artifactDaysToKeep: -1
239 artifactNumToKeep: -1
245 - 'functest-store-results'
248 name: functest-vims-{installer}-{stream}
258 default: '{installer_type}'
259 description: "Installer name that is used for deployment."
262 default: '{installer_ip}'
263 description: "Installer IP."
266 default: ssh://gerrit.opnfv.org:29418/$PROJECT
267 description: "Override GIT_BASE"
271 credentials-id: '{ssh-credentials}'
278 artifactDaysToKeep: -1
279 artifactNumToKeep: -1
285 name: 'functest-daily-{stream}'
287 # Job template for daily builders
289 # Required Variables:
290 # stream: branch with - in place of / (eg. stable)
291 # branch: branch (eg. stable)
293 varsetabove: '{somevar}'
298 - functest-parameter:
299 gs-pathname: '{gs-pathname}'
303 credentials-id: '{ssh-credentials}'
308 - 'functest-{stream}'
315 !include-raw ../opnfvdocs/docu-build.sh
321 name: 'functest-verify-{stream}'
326 artifactDaysToKeep: -1
327 artifactNumToKeep: -1
335 - gerrit-trigger-scm:
336 credentials-id: '{ssh-credentials}'
337 refspec: '$GERRIT_REFSPEC'
338 choosing-strategy: 'gerrit'
343 - patchset-created-event:
344 exclude-drafts: 'false'
345 exclude-trivial-rebase: 'false'
346 exclude-no-code-change: 'false'
347 - draft-published-event
348 - comment-added-contains-event:
349 comment-contains-value: 'recheck'
350 - comment-added-contains-event:
351 comment-contains-value: 'reverify'
353 - project-compare-type: 'ANT'
354 project-pattern: 'functest'
356 - branch-compare-type: 'ANT'
357 branch-pattern: '**/{branch}'
361 !include-raw ../opnfvdocs/docu-build.sh
364 name: 'functest-merge-{stream}'
366 # builder-merge job to run JJB update
368 # This job's purpose is to update all the JJB
377 - gerrit-trigger-scm:
378 credentials-id: '{ssh-credentials}'
380 choosing-strategy: 'default'
385 - change-merged-event
386 - comment-added-contains-event:
387 comment-contains-value: 'remerge'
389 - project-compare-type: 'ANT'
390 project-pattern: 'functest'
392 - branch-compare-type: 'ANT'
393 branch-pattern: '**/{branch}'
397 !include-raw ../opnfvdocs/docu-build.sh
399 ########################
401 ########################
403 name: functest-parameter
407 default: '{gs-pathname}'
408 description: "Version directory where the opnfv documents will be stored in gs repository"
410 name: FUNCTEST_REPO_DIR
411 default: "/home/opnfv/repos/functest"
412 description: "Directory where the Functest repository is cloned"
419 default: https://gerrit.opnfv.org/gerrit/$PROJECT
420 description: "Override GIT_BASE"
427 default: ssh://gerrit.opnfv.org:29418/$PROJECT
428 description: "Override GIT_BASE"
435 default: ssh://gerrit.opnfv.org:29418/$PROJECT
436 description: "Override GIT_BASE"
437 ########################
439 ########################
441 name: 'functest-master'
443 - pollscm: "H 9 * * *"
446 name: 'functest-stable-arno'
448 - pollscm: "H 21 * * *"
450 ########################
452 ########################
461 echo "Functest: running all the tests"
462 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
463 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
464 docker exec $container_id $cmd
467 name: set-functest-env
472 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
473 INSTALLER_IP=$(cat instack /var/lib/libvirt/dnsmasq/default.leases \
474 |sed 's/.*192/192/g' | sed 's/\ in.*//g')
476 echo "Functest: Start Docker and prepare environment"
477 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}"
478 docker pull opnfv/functest:latest_stable
479 echo "Functest: Running docker run command: docker run -i -e $envs opnfv/functest /bin/bash &"
480 docker run -i -e $envs opnfv/functest:latest_stable /bin/bash &
483 container_id=$(docker ps | grep 'opnfv/functest:latest_stable' | awk '{print $1}' | head -1)
484 echo "Container ID=${container_id}"
485 if [ -z ${container_id} ]; then
486 echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing."
490 echo "Starting the container: docker start ${container_id}"
491 docker start ${container_id}
494 if [ $(docker ps | grep 'opnfv/functest:latest_stable' | wc -l) == 0 ]; then
495 echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..."
498 cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
499 echo "Executing command inside the docker: ${cmd}"
500 docker exec ${container_id} ${cmd}
509 echo "Functest: run vPing"
510 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
511 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
512 docker exec $container_id $cmd
521 echo "Functest: run ODL suite"
522 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
523 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
524 docker exec $container_id $cmd
527 name: functest-tempest-smoke
534 echo "Functest: run Tempest suite"
535 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
536 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
537 docker exec $container_id $cmd
540 name: functest-rally-bench
546 echo "Functest: run Functest Rally Bench suites"
547 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
548 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
549 docker exec $container_id $cmd
558 echo "Functest: run Functest vIMS test"
559 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims"
560 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
561 docker exec $container_id $cmd
564 name: functest-store-results
567 !include-raw res-build.sh
570 name: functest-cleanup
575 echo "Cleaning up docker containers/images..."
577 # Remove previous running containers if exist
578 if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
579 echo "Removing existing opnfv/functest containers..."
580 docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop
581 docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm
584 # Remove existing images if exist
585 if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
586 echo "Docker images to remove:"
587 docker images | head -1 && docker images | grep opnfv/functest
588 image_tags=($(docker images | grep opnfv/functest | awk '{print $2}'))
589 for tag in "${image_tags[@]}"; do
590 echo "Removing docker image opnfv/functest:$tag..."
591 docker rmi opnfv/functest:$tag