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: 'apex'
28 installer_ip: '192.168.X.X'
32 installer_type: 'fuel'
33 installer_ip: '172.30.10.73'
36 node: 'orange-fr-pod2'
37 installer_type: 'joid'
38 installer_ip: '127.0.0.1'
41 - 'set-functest-env-{pod}'
43 - 'clean-functest-env-{pod}'
44 - 'set-functest-env-{installer}-{stream}'
45 - 'functest-{installer}-{stream}'
46 - 'clean-functest-env-{installer}-{stream}'
47 - 'functest-openstack-bench-test-{pod}'
48 - 'functest-openstack-tempest-smoke-test-{pod}'
49 - 'functest-odl-test-{pod}'
50 - 'functest-vims-{installer}-{stream}'
51 - 'functest-vping-test-{pod}'
52 - 'functest-daily-{stream}'
53 - 'functest-merge-{stream}'
54 - 'functest-verify-{stream}'
56 # stream: branch with - in place of / (eg. stable-arno)
57 # branch: branch (eg. stable/arno)
68 ################################
70 ################################
72 name: set-functest-env-{pod}
80 name: clean-functest-env-{pod}
88 name: set-functest-env-{installer}-{stream}
96 name: clean-functest-env-{installer}-{stream}
104 name: functest-openstack-bench-test-{pod}
109 - 'functest-rally-bench'
112 name: functest-openstack-tempest-smoke-test-{pod}
117 - 'functest-tempest-smoke'
120 name: functest-odl-test-{pod}
129 name: functest-vping-test-{pod}
147 default: '{installer_type}'
148 description: "Installer name that is used for deployment."
151 default: '{installer_ip}'
152 description: "Installer IP."
157 credentials-id: '{ssh-credentials}'
165 - 'functest-store-results'
168 name: functest-{installer}-{stream}
178 default: '{installer_type}'
179 description: "Installer name that is used for deployment."
182 default: '{installer_ip}'
183 description: "Installer IP."
186 default: ssh://gerrit.opnfv.org:29418/$PROJECT
187 description: "Override GIT_BASE"
191 credentials-id: '{ssh-credentials}'
199 - 'functest-store-results'
202 name: functest-vims-{installer}-{stream}
212 default: '{installer_type}'
213 description: "Installer name that is used for deployment."
216 default: '{installer_ip}'
217 description: "Installer IP."
220 default: ssh://gerrit.opnfv.org:29418/$PROJECT
221 description: "Override GIT_BASE"
225 credentials-id: '{ssh-credentials}'
233 name: 'functest-daily-{stream}'
235 # Job template for daily builders
237 # Required Variables:
238 # stream: branch with - in place of / (eg. stable)
239 # branch: branch (eg. stable)
241 varsetabove: '{somevar}'
246 - functest-parameter:
247 gs-pathname: '{gs-pathname}'
251 credentials-id: '{ssh-credentials}'
256 - 'functest-{stream}'
263 !include-raw ../opnfvdocs/docu-build.sh
269 name: 'functest-verify-{stream}'
277 - gerrit-trigger-scm:
278 credentials-id: '{ssh-credentials}'
279 refspec: '$GERRIT_REFSPEC'
280 choosing-strategy: 'gerrit'
285 - patchset-created-event:
286 exclude-drafts: 'false'
287 exclude-trivial-rebase: 'false'
288 exclude-no-code-change: 'false'
289 - draft-published-event
290 - comment-added-contains-event:
291 comment-contains-value: 'recheck'
292 - comment-added-contains-event:
293 comment-contains-value: 'reverify'
295 - project-compare-type: 'ANT'
296 project-pattern: 'functest'
298 - branch-compare-type: 'ANT'
299 branch-pattern: '**/{branch}'
303 !include-raw ../opnfvdocs/docu-build.sh
306 name: 'functest-merge-{stream}'
308 # builder-merge job to run JJB update
310 # This job's purpose is to update all the JJB
319 - gerrit-trigger-scm:
320 credentials-id: '{ssh-credentials}'
322 choosing-strategy: 'default'
327 - change-merged-event
328 - comment-added-contains-event:
329 comment-contains-value: 'remerge'
331 - project-compare-type: 'ANT'
332 project-pattern: 'functest'
334 - branch-compare-type: 'ANT'
335 branch-pattern: '**/{branch}'
339 !include-raw ../opnfvdocs/docu-build.sh
341 ########################
343 ########################
345 name: functest-parameter
349 default: '{gs-pathname}'
350 description: "Version directory where the opnfv documents will be stored in gs repository"
352 name: FUNCTEST_REPO_DIR
353 default: "/home/opnfv/repos/functest"
354 description: "Directory where the Functest repository is cloned"
361 default: https://gerrit.opnfv.org/gerrit/$PROJECT
362 description: "Override GIT_BASE"
369 default: https://gerrit.opnfv.org/gerrit/$PROJECT
370 description: "Override GIT_BASE"
373 default: "/home/opnfv/repos/functest"
374 description: "Openstack credentials on the dev lab"
381 default: ssh://gerrit.opnfv.org:29418/$PROJECT
382 description: "Override GIT_BASE"
385 default: "/root/.ssh/id_rsa"
386 description: "SSH public key to access the installer VM"
393 default: ssh://gerrit.opnfv.org:29418/$PROJECT
394 description: "Override GIT_BASE"
395 ########################
397 ########################
399 name: 'functest-master'
401 - pollscm: "H 9 * * *"
404 name: 'functest-stable-arno'
406 - pollscm: "H 21 * * *"
408 ########################
410 ########################
419 echo "Functest: running all the tests"
420 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
421 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
422 docker exec $container_id $cmd
425 name: set-functest-env
430 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
431 INSTALLER_IP=$(cat instack /var/lib/libvirt/dnsmasq/default.leases \
432 |sed 's/.*192/192/g' | sed 's/\ in.*//g')
434 echo "Functest: Start Docker and prepare environment"
435 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME}"
437 # If production lab then creds may be retrieved dynamically
438 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
439 if [ -n "${LAB_CONFIG}" ]; then
440 labconfig="-v ${LAB_CONFIG}:/home/opnfv/functest/conf/openstack.creds"
442 if [ -n "${SSH_KEY}" ]; then
443 sshkey="-v ${SSH_KEY}:/root/.ssh/id_rsa"
446 docker pull opnfv/functest:latest_stable
447 cmd="docker run -id -e $envs ${labconfig} ${sshkey} opnfv/functest:latest_stable /bin/bash"
448 echo "Functest: Running docker run command: ${cmd}"
452 container_id=$(docker ps | grep 'opnfv/functest:latest_stable' | awk '{print $1}' | head -1)
453 echo "Container ID=${container_id}"
454 if [ -z ${container_id} ]; then
455 echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing."
459 echo "Starting the container: docker start ${container_id}"
460 docker start ${container_id}
463 if [ $(docker ps | grep 'opnfv/functest:latest_stable' | wc -l) == 0 ]; then
464 echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..."
467 cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
468 echo "Executing command inside the docker: ${cmd}"
469 docker exec ${container_id} ${cmd}
478 echo "Functest: run vPing"
479 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
480 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
481 docker exec $container_id $cmd
490 echo "Functest: run ODL suite"
491 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
492 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
493 docker exec $container_id $cmd
496 name: functest-tempest-smoke
503 echo "Functest: run Tempest suite"
504 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
505 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
506 docker exec $container_id $cmd
509 name: functest-rally-bench
515 echo "Functest: run Functest Rally Bench suites"
516 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
517 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
518 docker exec $container_id $cmd
527 echo "Functest: run Functest vIMS test"
528 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims"
529 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
530 docker exec $container_id $cmd
533 name: functest-store-results
536 !include-raw res-build.sh
539 name: functest-cleanup
544 echo "Cleaning up docker containers/images..."
546 # Remove previous running containers if exist
547 if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
548 echo "Removing existing opnfv/functest containers..."
549 docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop
550 docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm
553 # Remove existing images if exist
554 if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
555 echo "Docker images to remove:"
556 docker images | head -1 && docker images | grep opnfv/functest
557 image_tags=($(docker images | grep opnfv/functest | awk '{print $2}'))
558 for tag in "${image_tags[@]}"; do
559 echo "Removing docker image opnfv/functest:$tag..."
560 docker rmi opnfv/functest:$tag