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}
60 project-type: freestyle
67 artifactDaysToKeep: -1
76 name: clean-functest-env-{pod}
78 project-type: freestyle
85 artifactDaysToKeep: -1
93 name: set-functest-env-{installer}-{stream}
95 project-type: freestyle
102 artifactDaysToKeep: -1
103 artifactNumToKeep: -1
110 name: clean-functest-env-{installer}-{stream}
112 project-type: freestyle
119 artifactDaysToKeep: -1
120 artifactNumToKeep: -1
126 name: functest-openstack-bench-test-{pod}
128 project-type: freestyle
135 artifactDaysToKeep: -1
136 artifactNumToKeep: -1
139 - 'functest-rally-bench'
143 name: functest-openstack-tempest-smoke-test-{pod}
145 project-type: freestyle
152 artifactDaysToKeep: -1
153 artifactNumToKeep: -1
156 - 'functest-tempest-smoke'
159 name: functest-odl-test-{pod}
161 project-type: freestyle
168 artifactDaysToKeep: -1
169 artifactNumToKeep: -1
177 name: functest-vping-test-{pod}
179 project-type: freestyle
186 artifactDaysToKeep: -1
187 artifactNumToKeep: -1
196 project-type: freestyle
206 default: '{installer_type}'
207 description: "Installer name that is used for deployment."
210 default: '{installer_ip}'
211 description: "Installer IP."
216 credentials-id: '{ssh-credentials}'
223 artifactDaysToKeep: -1
224 artifactNumToKeep: -1
230 - 'functest-store-results'
233 name: functest-{installer}-{stream}
235 project-type: freestyle
245 default: '{installer_type}'
246 description: "Installer name that is used for deployment."
249 default: '{installer_ip}'
250 description: "Installer IP."
253 default: ssh://gerrit.opnfv.org:29418/$PROJECT
254 description: "Override GIT_BASE"
258 credentials-id: '{ssh-credentials}'
265 artifactDaysToKeep: -1
266 artifactNumToKeep: -1
272 - 'functest-store-results'
275 name: functest-vims-{installer}-{stream}
277 project-type: freestyle
287 default: '{installer_type}'
288 description: "Installer name that is used for deployment."
291 default: '{installer_ip}'
292 description: "Installer IP."
295 default: ssh://gerrit.opnfv.org:29418/$PROJECT
296 description: "Override GIT_BASE"
300 credentials-id: '{ssh-credentials}'
307 artifactDaysToKeep: -1
308 artifactNumToKeep: -1
314 name: 'functest-daily-{stream}'
318 # Job template for daily builders
320 # Required Variables:
321 # stream: branch with - in place of / (eg. stable)
322 # branch: branch (eg. stable)
324 project-type: freestyle
325 varsetabove: '{somevar}'
328 daysToKeep: '{build-days-to-keep}'
329 numToKeep: '{build-num-to-keep}'
330 artifactDaysToKeep: '{build-artifact-days-to-keep}'
331 artifactNumToKeep: '{build-artifact-num-to-keep}'
336 - functest-parameter:
337 gs-pathname: '{gs-pathname}'
341 credentials-id: '{ssh-credentials}'
346 - 'functest-{stream}'
353 !include-raw ../opnfvdocs/docu-build.sh
359 name: 'functest-verify-{stream}'
363 project-type: freestyle
368 artifactDaysToKeep: -1
369 artifactNumToKeep: -1
377 - gerrit-trigger-scm:
378 credentials-id: '{ssh-credentials}'
379 refspec: '$GERRIT_REFSPEC'
380 choosing-strategy: 'gerrit'
385 - patchset-created-event:
386 exclude-drafts: 'false'
387 exclude-trivial-rebase: 'false'
388 exclude-no-code-change: 'false'
389 - draft-published-event
390 - comment-added-contains-event:
391 comment-contains-value: 'recheck'
392 - comment-added-contains-event:
393 comment-contains-value: 'reverify'
395 - project-compare-type: 'ANT'
396 project-pattern: 'functest'
398 - branch-compare-type: 'ANT'
399 branch-pattern: '**/{branch}'
403 !include-raw ../opnfvdocs/docu-build.sh
406 name: 'functest-merge-{stream}'
410 # builder-merge job to run JJB update
412 # This job's purpose is to update all the JJB
414 project-type: freestyle
419 artifactDaysToKeep: -1
429 - gerrit-trigger-scm:
430 credentials-id: '{ssh-credentials}'
432 choosing-strategy: 'default'
437 - change-merged-event
438 - comment-added-contains-event:
439 comment-contains-value: 'remerge'
441 - project-compare-type: 'ANT'
442 project-pattern: 'functest'
444 - branch-compare-type: 'ANT'
445 branch-pattern: '**/{branch}'
449 !include-raw ../opnfvdocs/docu-build.sh
451 ########################
453 ########################
455 name: functest-parameter
459 default: '{gs-pathname}'
460 description: "Version directory where the opnfv documents will be stored in gs repository"
462 name: FUNCTEST_REPO_DIR
463 default: "/home/opnfv/repos/functest"
464 description: "Directory where the Functest repository is cloned"
471 default: https://gerrit.opnfv.org/gerrit/$PROJECT
472 description: "Override GIT_BASE"
479 default: ssh://gerrit.opnfv.org:29418/$PROJECT
480 description: "Override GIT_BASE"
487 default: ssh://gerrit.opnfv.org:29418/$PROJECT
488 description: "Override GIT_BASE"
489 ########################
491 ########################
493 name: 'functest-master'
495 - pollscm: "H 9 * * *"
498 name: 'functest-stable-arno'
500 - pollscm: "H 21 * * *"
502 ########################
504 ########################
513 echo "Functest: running all the tests"
514 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
515 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
516 docker exec $container_id $cmd
520 name: set-functest-env
525 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
526 INSTALLER_IP=$(cat instack /var/lib/libvirt/dnsmasq/default.leases \
527 |sed 's/.*192/192/g' | sed 's/\ in.*//g')
529 echo "Functest: Start Docker and prepare environment"
530 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}"
531 docker pull opnfv/functest:latest_stable
532 echo "Functest: Running docker run command: docker run -i -e $envs opnfv/functest /bin/bash &"
533 docker run -i -e $envs opnfv/functest /bin/bash &
536 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
537 echo "Container ID=${container_id}"
538 if [ -z ${container_id} ]; then
539 echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing."
543 echo "Starting the container: docker start ${container_id}"
544 docker start ${container_id}
547 if [ $(docker ps | grep opnfv/functest | wc -l) == 0 ]; then
548 echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..."
551 cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
552 echo "Executing command inside the docker: ${cmd}"
553 docker exec ${container_id} ${cmd}
563 echo "Functest: run vPing"
564 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
565 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
566 docker exec $container_id $cmd
575 echo "Functest: run ODL suite"
576 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
577 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
578 docker exec $container_id $cmd
581 name: functest-tempest-smoke
588 echo "Functest: run Tempest suite"
589 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
590 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
591 docker exec $container_id $cmd
596 name: functest-rally-bench
602 echo "Functest: run Functest Rally Bench suites"
603 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
604 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
605 docker exec $container_id $cmd
615 echo "Functest: run Functest vIMS test"
616 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims"
617 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
618 docker exec $container_id $cmd
623 name: functest-store-results
626 !include-raw res-build.sh
629 name: functest-cleanup
634 echo "Cleaning up docker containers/images..."
636 # Remove previous running containers if exist
637 if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
638 echo "Removing existing opnfv/functest containers..."
639 docker ps | grep opnfv/functest | awk '{{print $1}}' | xargs docker stop
640 docker ps -a | grep opnfv/functest | awk '{{print $1}}' | xargs docker rm
644 # Remove existing images if exist
645 if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
646 echo "Docker images to remove:"
647 docker images | head -1 && docker images | grep opnfv/functest
648 image_tags=($(docker images | grep opnfv/functest | awk '{{print $2}}'))
649 for tag in "${{image_tags[@]}}"; do
650 echo "Removing docker image opnfv/functest:$tag..."
651 docker rmi opnfv/functest:$tag