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 - ssh-agent-credentials:
347 user: '{ssh-credentials}'
350 - 'functest-{stream}'
357 !include-raw ../opnfvdocs/docu-build.sh
363 name: 'functest-verify-{stream}'
367 project-type: freestyle
372 artifactDaysToKeep: -1
373 artifactNumToKeep: -1
381 - gerrit-trigger-scm:
382 credentials-id: '{ssh-credentials}'
383 refspec: '$GERRIT_REFSPEC'
384 choosing-strategy: 'gerrit'
387 - ssh-agent-credentials:
388 user: '{ssh-credentials}'
393 - patchset-created-event:
394 exclude-drafts: 'false'
395 exclude-trivial-rebase: 'false'
396 exclude-no-code-change: 'false'
397 - draft-published-event
398 - comment-added-contains-event:
399 comment-contains-value: 'recheck'
400 - comment-added-contains-event:
401 comment-contains-value: 'reverify'
403 - project-compare-type: 'ANT'
404 project-pattern: 'functest'
406 - branch-compare-type: 'ANT'
407 branch-pattern: '**/{branch}'
411 !include-raw ../opnfvdocs/docu-build.sh
414 name: 'functest-merge-{stream}'
418 # builder-merge job to run JJB update
420 # This job's purpose is to update all the JJB
422 project-type: freestyle
427 artifactDaysToKeep: -1
437 - gerrit-trigger-scm:
438 credentials-id: '{ssh-credentials}'
440 choosing-strategy: 'default'
443 - ssh-agent-credentials:
444 user: '{ssh-credentials}'
449 - change-merged-event
450 - comment-added-contains-event:
451 comment-contains-value: 'remerge'
453 - project-compare-type: 'ANT'
454 project-pattern: 'functest'
456 - branch-compare-type: 'ANT'
457 branch-pattern: '**/{branch}'
461 !include-raw ../opnfvdocs/docu-build.sh
463 ########################
465 ########################
467 name: functest-parameter
471 default: '{gs-pathname}'
472 description: "Version directory where the opnfv documents will be stored in gs repository"
474 name: FUNCTEST_REPO_DIR
475 default: "/home/opnfv/repos/functest"
476 description: "Directory where the Functest repository is cloned"
483 default: https://gerrit.opnfv.org/gerrit/$PROJECT
484 description: "Override GIT_BASE"
491 default: ssh://gerrit.opnfv.org:29418/$PROJECT
492 description: "Override GIT_BASE"
499 default: ssh://gerrit.opnfv.org:29418/$PROJECT
500 description: "Override GIT_BASE"
501 ########################
503 ########################
505 name: 'functest-master'
507 - pollscm: "H 9 * * *"
510 name: 'functest-stable-arno'
512 - pollscm: "H 21 * * *"
514 ########################
516 ########################
525 echo "Functest: running all the tests"
526 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
527 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
528 docker exec $container_id $cmd
532 name: set-functest-env
537 if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
538 INSTALLER_IP=$(cat instack /var/lib/libvirt/dnsmasq/default.leases \
539 |sed 's/.*192/192/g' | sed 's/\ in.*//g')
541 echo "Functest: Start Docker and prepare environment"
542 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}"
543 docker pull opnfv/functest:latest_stable
544 echo "Functest: Running docker run command: docker run -i -e $envs opnfv/functest /bin/bash &"
545 docker run -i -e $envs opnfv/functest /bin/bash &
548 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
549 echo "Container ID=${container_id}"
550 if [ -z ${container_id} ]; then
551 echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing."
555 echo "Starting the container: docker start ${container_id}"
556 docker start ${container_id}
559 if [ $(docker ps | grep opnfv/functest | wc -l) == 0 ]; then
560 echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..."
563 cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
564 echo "Executing command inside the docker: ${cmd}"
565 docker exec ${container_id} ${cmd}
575 echo "Functest: run vPing"
576 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
577 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
578 docker exec $container_id $cmd
587 echo "Functest: run ODL suite"
588 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
589 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
590 docker exec $container_id $cmd
593 name: functest-tempest-smoke
600 echo "Functest: run Tempest suite"
601 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
602 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
603 docker exec $container_id $cmd
608 name: functest-rally-bench
614 echo "Functest: run Functest Rally Bench suites"
615 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
616 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
617 docker exec $container_id $cmd
627 echo "Functest: run Functest vIMS test"
628 cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims"
629 container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
630 docker exec $container_id $cmd
635 name: functest-store-results
638 !include-raw res-build.sh
641 name: functest-cleanup
646 echo "Cleaning up docker containers/images..."
648 # Remove previous running containers if exist
649 if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then
650 echo "Removing existing opnfv/functest containers..."
651 docker ps | grep opnfv/functest | awk '{{print $1}}' | xargs docker stop
652 docker ps -a | grep opnfv/functest | awk '{{print $1}}' | xargs docker rm
656 # Remove existing images if exist
657 if [[ ! -z $(docker images | grep opnfv/functest) ]]; then
658 echo "Docker images to remove:"
659 docker images | head -1 && docker images | grep opnfv/functest
660 image_tags=($(docker images | grep opnfv/functest | awk '{{print $2}}'))
661 for tag in "${{image_tags[@]}}"; do
662 echo "Removing docker image opnfv/functest:$tag..."
663 docker rmi opnfv/functest:$tag