X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Ffunctest%2Ffunctest.yml;h=4df779d8c7273c2fa107e50a5655230c5b0829a8;hb=c21e64ac3e342f820ad31ba264d8b7c93b3cd91f;hp=0d776065f5925adc1bb8a814641e5506e73f8774;hpb=d96f2a6000e39a2ab5e725bd27736b9a58ca6288;p=releng.git diff --git a/jjb/functest/functest.yml b/jjb/functest/functest.yml index 0d776065f..4df779d8c 100644 --- a/jjb/functest/functest.yml +++ b/jjb/functest/functest.yml @@ -3,30 +3,39 @@ ################################### - project: name: functest - pod: - - opnfv-jump-1: - node: 'opnfv-jump-1' + + installer: + - fuel: + node: 'opnfv-jump-2' installer_type: 'fuel' installer_ip: '10.20.0.2' - - opnfv-jump-2: + functest_repo_dir: '/home/opnfv/repos/functest' + - foreman: node: 'opnfv-jump-2' installer_type: 'foreman' installer_ip: '172.30.10.73' + functest_repo_dir: '/home/opnfv/repos/functest' + pod: - orange-build: node: 'orange-build' installer_type: 'foreman' installer_ip: '172.30.10.73' + functest_repo_dir: '/home/opnfv/repos/functest' + jobs: - - 'functest-{pod}' - 'set-functest-env-{pod}' + - 'functest-{pod}' - 'clean-functest-env-{pod}' + - 'set-functest-env-{installer}-{stream}' + - 'functest-{installer}-{stream}' + - 'clean-functest-env-{installer}-{stream}' - 'functest-openstack-bench-test-{pod}' - 'functest-openstack-tempest-smoke-test-{pod}' - 'functest-odl-test-{pod}' - - 'functest-vims-test-{pod}' + - 'functest-vims-{installer}-{stream}' - 'functest-vping-test-{pod}' - 'functest-daily-{stream}' - - 'functest-merge' + - 'functest-merge-{stream}' - 'functest-verify-{stream}' # stream: branch with - in place of / (eg. stable-arno) @@ -58,26 +67,9 @@ artifactNumToKeep: -1 builders: - - shell: | - #!/bin/bash - set +e + - 'set-functest-env' - echo "Functest: prepare Functest environment" - mkdir -p $HOME/functest/ - # source openstack vars - if [[ ! -f $HOME/opnfv-openrc.sh ]]; then - echo "Unable to access file $HOME/opnfv-openrc.sh" - exit 1 - fi - source $HOME/opnfv-openrc.sh - # WORKSPACE is the root of the functest repo - # go into WORKSPACE where the functest repo is cloned - cd $WORKSPACE - - # prepare - echo "Functest: prepare Functest environment" - python $WORKSPACE/testcases/config_functest.py --debug $WORKSPACE/ start - job-template: name: clean-functest-env-{pod} @@ -93,29 +85,32 @@ artifactNumToKeep: -1 builders: - - shell: | - #!/bin/bash - set +e + - 'functest-cleanup' - # collect results - echo "Functest: copy results and clean Functest environment" - mkdir -p $HOME/functest/results - # save ODL results - cp -Rf $WORSPACE/testcases/Controllers/ODL/CI/logs $HOME/functest/results/ODL +- job-template: + name: set-functest-env-{installer}-{stream} + + project-type: freestyle + + node: '{node}' + + logrotate: + daysToKeep: 30 + numToKeep: 10 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 - # save tempest.conf for further troubleshooting - cp $HOME/.rally/tempest/for-deployment-*/tempest.conf $HOME/functest/results + builders: + - 'set-functest-env' - # cleanup - python $WORKSPACE/testcases/config_functest.py --debug --force $WORKSPACE/ clean - job-template: - name: functest-openstack-bench-test-{pod} + name: clean-functest-env-{installer}-{stream} project-type: freestyle - node: '{pod}' + node: '{node}' logrotate: daysToKeep: 30 @@ -124,15 +119,10 @@ artifactNumToKeep: -1 builders: - - shell: | - #!/bin/bash - set +e - - echo "Functest: run Functest Rally Bench suites" - python $WORKSPACE/testcases/VIM/OpenStack/CI/libraries/run_rally.py --debug $WORKSPACE/ all + - 'functest-cleanup' - job-template: - name: functest-openstack-tempest-smoke-test-{pod} + name: functest-openstack-bench-test-{pod} project-type: freestyle @@ -145,17 +135,11 @@ artifactNumToKeep: -1 builders: - - shell: | - #!/bin/bash - set +e + - 'functest-rally-bench' - # tempest - echo "Functest: run Tempest suite" - rally verify start smoke - rally verify list - job-template: - name: functest-odl-test-{pod} + name: functest-openstack-tempest-smoke-test-{pod} project-type: freestyle @@ -168,15 +152,10 @@ artifactNumToKeep: -1 builders: - - shell: | - #!/bin/bash - set +e - - echo "Functest: run ODL suite" - $WORKSPACE/testcases/Controllers/ODL/CI/start_tests.sh + - 'functest-tempest-smoke' - job-template: - name: functest-vims-test-{pod} + name: functest-odl-test-{pod} project-type: freestyle @@ -190,7 +169,7 @@ builders: - shell: | - echo "put your CI scenario here" + - 'functest-odl' - job-template: @@ -207,13 +186,8 @@ artifactNumToKeep: -1 builders: - - shell: | - #!/bin/bash - set +e + - 'functest-vping' - # vPing - echo "Functest: run vPing" - python $WORKSPACE/testcases/vPing/CI/libraries/vPing.py --debug $WORKSPACE/ - job-template: name: functest-{pod} @@ -233,6 +207,10 @@ name: INSTALLER_IP default: '{installer_ip}' description: "Installer IP." + - string: + name: FUNCTEST_REPO_DIR + default: '{functest_repo_dir}' + description: "Directory where the root functest repo is cloned in the docker." - '{pod}' scm: @@ -248,10 +226,97 @@ artifactNumToKeep: -1 builders: - - 'functest-fetch-os-creds' + - 'functest-cleanup' + - 'set-functest-env' - 'functest-all' - 'functest-store-results' + +- job-template: + name: functest-{installer}-{stream} + + project-type: freestyle + + node: '{node}' + + parameters: + - project-parameter: + project: '{project}' + - string: + name: INSTALLER_TYPE + default: '{installer_type}' + description: "Installer name that is used for deployment." + - string: + name: INSTALLER_IP + default: '{installer_ip}' + description: "Installer IP." + - string: + name: FUNCTEST_REPO_DIR + default: '{functest_repo_dir}' + description: "Directory where the root functest repo is cloned in the docker." + - string: + name: GIT_BASE + default: ssh://gerrit.opnfv.org:29418/$PROJECT + description: "Override GIT_BASE" + + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: master + + logrotate: + daysToKeep: 30 + numToKeep: 10 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + builders: - 'functest-cleanup' + - 'set-functest-env' + - 'functest-all' + - 'functest-store-results' + +- job-template: + name: functest-vims-{installer}-{stream} + + project-type: freestyle + + node: '{node}' + + parameters: + - project-parameter: + project: '{project}' + - string: + name: INSTALLER_TYPE + default: '{installer_type}' + description: "Installer name that is used for deployment." + - string: + name: INSTALLER_IP + default: '{installer_ip}' + description: "Installer IP." + - string: + name: FUNCTEST_REPO_DIR + default: '{functest_repo_dir}' + description: "Directory where the root functest repo is cloned in the docker." + - string: + name: GIT_BASE + default: ssh://gerrit.opnfv.org:29418/$PROJECT + description: "Override GIT_BASE" + + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: master + + logrotate: + daysToKeep: 30 + numToKeep: 10 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + builders: + - 'functest-vims' - job-template: name: 'functest-daily-{stream}' @@ -354,7 +419,7 @@ !include-raw ../opnfvdocs/docu-build.sh - job-template: - name: 'functest-merge' + name: 'functest-merge-{stream}' node: master @@ -374,7 +439,7 @@ - project-parameter: project: '{project}' - gerrit-parameter: - branch: 'master' + branch: '{branch}' scm: - gerrit-trigger-scm: @@ -397,7 +462,7 @@ project-pattern: 'functest' branches: - branch-compare-type: 'ANT' - branch-pattern: '**/master' + branch-pattern: '**/{branch}' builders: - shell: @@ -461,44 +526,111 @@ #!/bin/bash set +e - echo "Functest: prepare Functest environment" - mkdir -p $HOME/functest/ - source $HOME/functest/opnfv-openrc.sh + echo "Functest: running all the tests" + cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh" + container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) + docker exec $container_id $cmd - # WORKSPACE is the root of the functest repo - # go into WORKSPACE where the functest repo is cloned - cd $WORKSPACE - # prepare - echo "Functest: prepare Functest environment" - python $WORKSPACE/testcases/config_functest.py --debug $WORKSPACE/ start +- builder: + name: set-functest-env + builders: + - shell: | + #!/bin/bash + set +e + + echo "Functest: Start Docker and prepare environment" + envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}" + docker pull opnfv/functest:latest_stable + echo "Functest: Running docker run command: docker run -i -e $envs opnfv/functest /bin/bash &" + docker run -i -e $envs opnfv/functest /bin/bash & + docker ps -a + sleep 5 + container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) + echo "Container ID=${container_id}" + if [ -z ${container_id} ]; then + echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing." + docker ps -a + exit 1 + fi + echo "Starting the container: docker start ${container_id}" + docker start ${container_id} + sleep 5 + docker ps + if [ $(docker ps | grep opnfv/functest | wc -l) == 0 ]; then + echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..." + exit 1 + fi + cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh" + echo "Executing command inside the docker: ${cmd}" + docker exec ${container_id} ${cmd} + + +- builder: + name: functest-vping + builders: + - shell: | + #!/bin/bash + set +e - # vPing echo "Functest: run vPing" - python $WORKSPACE/testcases/vPing/CI/libraries/vPing.py --debug $WORKSPACE/ + cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping" + container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) + docker exec $container_id $cmd + +- builder: + name: functest-odl + builders: + - shell: | + #!/bin/bash + set +e - # ODL echo "Functest: run ODL suite" - $WORKSPACE/testcases/Controllers/ODL/CI/start_tests.sh + cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl" + container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) + docker exec $container_id $cmd - # rally - echo "Functest: run Functest Rally Bench suites" - python $WORKSPACE/testcases/VIM/OpenStack/CI/libraries/run_rally.py --debug $WORKSPACE/ all +- builder: + name: functest-tempest-smoke + builders: + - shell: | + #!/bin/bash + set +e # tempest echo "Functest: run Tempest suite" - rally verify start smoke - rally verify list + cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest" + container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) + docker exec $container_id $cmd + + + +- builder: + name: functest-rally-bench + builders: + - shell: | + #!/bin/bash + set +e + + echo "Functest: run Functest Rally Bench suites" + cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally" + container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) + docker exec $container_id $cmd - # collect results - echo "Functest: copy results and clean Functest environment" - mkdir -p $HOME/functest/results - # save ODL results - cp -Rf $WORKSPACE/testcases/Controllers/ODL/CI/logs $HOME/functest/results/ODL +- builder: + name: functest-vims + builders: + - shell: | + #!/bin/bash + set +e + + echo "Functest: run Functest vIMS test" + cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vims" + container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) + docker exec $container_id $cmd + - # save tempest.conf for further troubleshooting - cp $HOME/.rally/tempest/for-deployment-*/tempest.conf $HOME/functest/results - builder: name: functest-store-results @@ -513,11 +645,8 @@ #!/bin/bash set +e - # cleanup - python $WORKSPACE/testcases/config_functest.py --debug --force $WORKSPACE/ clean - -- builder: - name: functest-fetch-os-creds - builders: - - shell: - !include-raw ../../utils/fetch_os_creds.sh + # cleanup: remove any docker containers leftovers + echo "Removing existing Functest Docker containers..." + docker rm -f $(docker ps | grep opnfv/functest | awk '{print $1}') + echo "Removing existing Functest Docker image..." + docker rmi -f $(docker images | grep opnfv/functest | awk '{print $3}')