diff options
Diffstat (limited to 'jjb/functest')
-rw-r--r-- | jjb/functest/functest-ci-jobs.yml | 59 | ||||
-rwxr-xr-x | jjb/functest/functest-cleanup.sh | 42 | ||||
-rw-r--r-- | jjb/functest/functest-exit.sh | 5 | ||||
-rwxr-xr-x | jjb/functest/functest-loop.sh | 6 | ||||
-rw-r--r-- | jjb/functest/functest-project-jobs.yml | 10 | ||||
-rwxr-xr-x | jjb/functest/functest-suite.sh | 13 | ||||
-rwxr-xr-x | jjb/functest/set-functest-env.sh | 24 |
7 files changed, 92 insertions, 67 deletions
diff --git a/jjb/functest/functest-ci-jobs.yml b/jjb/functest/functest-ci-jobs.yml index a578fcecd..49901bea2 100644 --- a/jjb/functest/functest-ci-jobs.yml +++ b/jjb/functest/functest-ci-jobs.yml @@ -14,8 +14,8 @@ branch: '{stream}' gs-pathname: '' docker-tag: 'latest' - colorado: &colorado - stream: colorado + danube: &danube + stream: danube branch: 'stable/{stream}' gs-pathname: '/{stream}' docker-tag: 'stable' @@ -40,11 +40,11 @@ - baremetal: slave-label: fuel-baremetal installer: fuel - <<: *colorado + <<: *danube - virtual: slave-label: fuel-virtual installer: fuel - <<: *colorado + <<: *danube # joid CI PODs - baremetal: slave-label: joid-baremetal @@ -57,11 +57,11 @@ - baremetal: slave-label: joid-baremetal installer: joid - <<: *colorado + <<: *danube - virtual: slave-label: joid-virtual installer: joid - <<: *colorado + <<: *danube # compass CI PODs - baremetal: slave-label: compass-baremetal @@ -74,11 +74,11 @@ - baremetal: slave-label: compass-baremetal installer: compass - <<: *colorado + <<: *danube - virtual: slave-label: compass-virtual installer: compass - <<: *colorado + <<: *danube # apex CI PODs - apex-verify-master: slave-label: '{pod}' @@ -88,14 +88,14 @@ slave-label: '{pod}' installer: apex <<: *master - - apex-verify-colorado: - slave-label: '{pod}' - installer: apex - <<: *colorado - - apex-daily-colorado: - slave-label: '{pod}' - installer: apex - <<: *colorado +# - apex-verify-danube: +# slave-label: '{pod}' +# installer: apex +# <<: *danube +# - apex-daily-danube: +# slave-label: '{pod}' +# installer: apex +# <<: *danube # armband CI PODs - armband-baremetal: slave-label: armband-baremetal @@ -108,11 +108,11 @@ - armband-baremetal: slave-label: armband-baremetal installer: fuel - <<: *colorado + <<: *danube - armband-virtual: slave-label: armband-virtual installer: fuel - <<: *colorado + <<: *danube # netvirt 3rd party ci - virtual: slave-label: odl-netvirt-virtual @@ -133,8 +133,8 @@ slave-label: '{pod}' installer: joid <<: *master - - huawei-pod5: - slave-label: '{pod}' + - baremetal-centos: + slave-label: 'intel-pod8' installer: compass <<: *master - nokia-pod1: @@ -156,7 +156,7 @@ - zte-pod1: slave-label: '{pod}' installer: fuel - <<: *colorado + <<: *danube - zte-pod2: slave-label: '{pod}' installer: fuel @@ -168,15 +168,15 @@ - zte-pod3: slave-label: '{pod}' installer: fuel - <<: *colorado + <<: *danube - arm-pod2: slave-label: '{pod}' installer: fuel - <<: *colorado + <<: *danube - arm-pod3: slave-label: '{pod}' installer: fuel - <<: *colorado + <<: *danube # PODs for verify jobs triggered by each patch upload - ool-virtual1: slave-label: '{pod}' @@ -204,6 +204,7 @@ concurrent: true properties: + - logrotate-default - throttle: enabled: true max-per-node: 1 @@ -219,6 +220,7 @@ parameters: - project-parameter: project: '{project}' + branch: '{branch}' - '{installer}-defaults' - '{slave-label}-defaults' - 'functest-{testsuite}-parameter' @@ -232,15 +234,12 @@ - string: name: CLEAN_DOCKER_IMAGES default: 'false' - description: 'Remove downloaded docker images (opnfv/functest:*)' + description: 'Remove downloaded docker images (opnfv/functest*:*)' - functest-parameter: gs-pathname: '{gs-pathname}' scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' + - git-scm builders: - description-setter: @@ -348,6 +347,8 @@ - 'functest-cleanup' - 'set-functest-env' - 'functest-suite' + - 'functest-store-results' + - 'functest-exit' - builder: name: functest-daily diff --git a/jjb/functest/functest-cleanup.sh b/jjb/functest/functest-cleanup.sh index 3c4c7f965..3ef9b90dd 100755 --- a/jjb/functest/functest-cleanup.sh +++ b/jjb/functest/functest-cleanup.sh @@ -3,19 +3,39 @@ [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" echo "Cleaning up docker containers/images..." +HOST_ARCH=$(uname -m) +FUNCTEST_IMAGE=opnfv/functest +if [ "$HOST_ARCH" = "aarch64" ]; then + FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}" +fi + +# Remove containers along with image opnfv/functest*:<none> +dangling_images=($(docker images -f "dangling=true" | grep $FUNCTEST_IMAGE | awk '{print $3}')) +if [[ -n ${dangling_images} ]]; then + echo " Removing $FUNCTEST_IMAGE:<none> images and their containers..." + for image_id in "${dangling_images[@]}"; do + echo " Removing image_id: $image_id and its containers" + docker ps -a | grep $image_id | awk '{print $1}'| xargs docker rm -f >${redirect} + docker rmi $image_id >${redirect} + done +fi + # Remove previous running containers if exist -if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then - echo "Removing existing opnfv/functest containers..." - docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm -f >${redirect} +functest_containers=$(docker ps -a | grep $FUNCTEST_IMAGE | awk '{print $1}') +if [[ -n ${functest_containers} ]]; then + echo " Removing existing $FUNCTEST_IMAGE containers..." + docker rm -f $functest_containers >${redirect} fi # Remove existing images if exist -if [[ $CLEAN_DOCKER_IMAGES ]] && [[ ! -z $(docker images | grep opnfv/functest) ]]; then - echo "Docker images to remove:" - docker images | head -1 && docker images | grep opnfv/functest >${redirect} - image_tags=($(docker images | grep opnfv/functest | awk '{print $2}')) - for tag in "${image_tags[@]}"; do - echo "Removing docker image opnfv/functest:$tag..." - docker rmi opnfv/functest:$tag >/dev/null - done +if [[ $CLEAN_DOCKER_IMAGES == true ]]; then + functest_image_tags=($(docker images | grep $FUNCTEST_IMAGE | awk '{print $2}')) + if [[ -n ${functest_image_tags} ]]; then + echo " Docker images to be removed:" >${redirect} + (docker images | head -1 && docker images | grep $FUNCTEST_IMAGE) >${redirect} + for tag in "${functest_image_tags[@]}"; do + echo " Removing docker image $FUNCTEST_IMAGE:$tag..." + docker rmi $FUNCTEST_IMAGE:$tag >${redirect} + done + fi fi diff --git a/jjb/functest/functest-exit.sh b/jjb/functest/functest-exit.sh index 10edab005..925a3cfbb 100644 --- a/jjb/functest/functest-exit.sh +++ b/jjb/functest/functest-exit.sh @@ -1,7 +1,6 @@ #!/bin/bash -branch=${GIT_BRANCH##*/} -ret_val_file="${HOME}/opnfv/functest/results/${branch}/return_value" +ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" if [ ! -f ${ret_val_file} ]; then echo "Return value not found!" exit -1 @@ -9,4 +8,4 @@ fi ret_val=`cat ${ret_val_file}` -exit ${ret_val}
\ No newline at end of file +exit ${ret_val} diff --git a/jjb/functest/functest-loop.sh b/jjb/functest/functest-loop.sh index 4528c00d1..893c428a2 100755 --- a/jjb/functest/functest-loop.sh +++ b/jjb/functest/functest-loop.sh @@ -3,9 +3,9 @@ set +e branch=${GIT_BRANCH##*/} [[ "$PUSH_RESULTS_TO_DB" == "true" ]] && flags+="-r" -if [[ ${branch} == *"brahmaputra"* ]]; then +if [[ "$BRANCH" =~ 'brahmaputra' ]]; then cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh -s ${flags}" -elif [[ ${branch} == *"colorado"* ]]; then +elif [[ "$BRANCH" =~ 'colorado' ]]; then cmd="python ${FUNCTEST_REPO_DIR}/ci/run_tests.py -t all ${flags}" else cmd="python ${FUNCTEST_REPO_DIR}/functest/ci/run_tests.py -t all ${flags}" @@ -14,7 +14,7 @@ container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) docker exec $container_id $cmd ret_value=$? -ret_val_file="${HOME}/opnfv/functest/results/${branch}/return_value" +ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" echo ${ret_value}>${ret_val_file} exit 0 diff --git a/jjb/functest/functest-project-jobs.yml b/jjb/functest/functest-project-jobs.yml index 888f0ed79..42c19a777 100644 --- a/jjb/functest/functest-project-jobs.yml +++ b/jjb/functest/functest-project-jobs.yml @@ -15,10 +15,10 @@ branch: '{stream}' gs-pathname: '' disabled: false - - colorado: + - danube: branch: 'stable/{stream}' gs-pathname: '/{stream}' - disabled: true + disabled: false - job-template: name: 'functest-verify-{stream}' @@ -28,15 +28,11 @@ parameters: - project-parameter: project: '{project}' - - gerrit-parameter: branch: '{branch}' - 'opnfv-build-ubuntu-defaults' scm: - - gerrit-trigger-scm: - credentials-id: '{ssh-credentials}' - refspec: '$GERRIT_REFSPEC' - choosing-strategy: 'gerrit' + - git-scm-gerrit triggers: - gerrit: diff --git a/jjb/functest/functest-suite.sh b/jjb/functest/functest-suite.sh index a30fb5973..f28d3d037 100755 --- a/jjb/functest/functest-suite.sh +++ b/jjb/functest/functest-suite.sh @@ -1,14 +1,19 @@ #!/bin/bash set -e -branch=${GIT_BRANCH##*/} -echo "Functest: run $FUNCTEST_SUITE_NAME on branch ${branch}" -if [[ ${branch} == *"brahmaputra"* ]]; then +echo "Functest: run $FUNCTEST_SUITE_NAME on branch $BRANCH" +if [[ "$BRANCH" =~ 'brahmaputra' ]]; then cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test $FUNCTEST_SUITE_NAME" -elif [[ ${branch} == *"colorado"* ]]; then +elif [[ "$BRANCH" =~ 'colorado' ]]; then cmd="python ${FUNCTEST_REPO_DIR}/ci/run_tests.py -t $FUNCTEST_SUITE_NAME" else cmd="functest testcase run $FUNCTEST_SUITE_NAME" fi container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) docker exec $container_id $cmd + +ret_value=$? +ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" +echo ${ret_value}>${ret_val_file} + +exit 0 diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh index 583ce8041..5224793dc 100755 --- a/jjb/functest/set-functest-env.sh +++ b/jjb/functest/set-functest-env.sh @@ -56,8 +56,7 @@ DEPLOY_TYPE=baremetal echo "Functest: Start Docker and prepare environment" -branch=${GIT_BRANCH##*/} -dir_result="${HOME}/opnfv/functest/results/${branch}" +dir_result="${HOME}/opnfv/functest/results/${BRANCH##*/}" mkdir -p ${dir_result} sudo rm -rf ${dir_result}/* results_vol="-v ${dir_result}:/home/opnfv/functest/results" @@ -71,17 +70,22 @@ envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ volumes="${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" +HOST_ARCH=$(uname -m) +FUNCTEST_IMAGE="opnfv/functest" +if [ "$HOST_ARCH" = "aarch64" ]; then + FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}" +fi -echo "Functest: Pulling image opnfv/functest:${DOCKER_TAG}" -docker pull opnfv/functest:$DOCKER_TAG >/dev/null +echo "Functest: Pulling image ${FUNCTEST_IMAGE}:${DOCKER_TAG}" +docker pull ${FUNCTEST_IMAGE}:$DOCKER_TAG >/dev/null cmd="sudo docker run --privileged=true -id ${envs} ${volumes} \ ${custom_params} ${TESTCASE_OPTIONS} \ - opnfv/functest:${DOCKER_TAG} /bin/bash" + ${FUNCTEST_IMAGE}:${DOCKER_TAG} /bin/bash" echo "Functest: Running docker run command: ${cmd}" ${cmd} >${redirect} sleep 5 -container_id=$(docker ps | grep "opnfv/functest:${DOCKER_TAG}" | awk '{print $1}' | head -1) +container_id=$(docker ps | grep "${FUNCTEST_IMAGE}:${DOCKER_TAG}" | 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." @@ -92,13 +96,13 @@ echo "Starting the container: docker start ${container_id}" docker start ${container_id} sleep 5 docker ps >${redirect} -if [ $(docker ps | grep "opnfv/functest:${DOCKER_TAG}" | wc -l) == 0 ]; then - echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..." +if [ $(docker ps | grep "${FUNCTEST_IMAGE}:${DOCKER_TAG}" | wc -l) == 0 ]; then + echo "The container ${FUNCTEST_IMAGE} with ID=${container_id} has not been properly started. Exiting..." exit 1 fi -if [[ ${branch} == *"brahmaputra"* ]]; then +if [[ "$BRANCH" =~ 'brahmaputra' ]]; then cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh" -elif [[ ${branch} == *"colorado"* ]]; then +elif [[ "$BRANCH" =~ 'colorado' ]]; then cmd="python ${FUNCTEST_REPO_DIR}/ci/prepare_env.py start" else cmd="python ${FUNCTEST_REPO_DIR}/functest/ci/prepare_env.py start" |