diff options
Diffstat (limited to 'tests/ci/periodic.sh')
-rwxr-xr-x | tests/ci/periodic.sh | 69 |
1 files changed, 6 insertions, 63 deletions
diff --git a/tests/ci/periodic.sh b/tests/ci/periodic.sh index 4235cdee..5c488b87 100755 --- a/tests/ci/periodic.sh +++ b/tests/ci/periodic.sh @@ -7,71 +7,14 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## set -e +set -x +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -case $INSTALLER_TYPE in - apex) - INSTALLER_IP=`sudo virsh domifaddr undercloud | grep ipv4 | awk '{print $4}' | cut -d/ -f1` - ;; -esac +source ${script_dir}/utils/start_services.sh -cat << EOF > $WORKSPACE/env_file -INSTALLER_TYPE=$INSTALLER_TYPE -INSTALLER_IP=$INSTALLER_IP -POD_NAME=$NODE_NAME -SCENARIO=$DEPLOY_SCENARIO -TESTAPI_URL=$TESTAPI_URL -EOF +docker exec -t ${TEST_SUITE}_qtip bash -x /home/opnfv/repos/qtip/qtip/scripts/quickstart.sh -echo "--------------------------------------------------------" -cat $WORKSPACE/env_file -echo "--------------------------------------------------------" +echo "${TEST_SUITE} QPI done!" -# Remove previous running containers if exist -if [[ ! -z $(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG") ]]; then - echo "Removing existing opnfv/qtip containers..." - # workaround: sometimes it throws an error when stopping qtip container. - # To make sure ci job unblocked, remove qtip container by force without stopping it. - docker rm -f $(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG" | awk '{print $1}') -fi - -# Remove existing images if exist -if [[ $(docker images opnfv/qtip:${DOCKER_TAG} | wc -l) -gt 1 ]]; then - echo "Removing docker image opnfv/qtip:$DOCKER_TAG..." - docker rmi -f opnfv/qtip:$DOCKER_TAG -fi - -echo "Qtip: Pulling docker image: opnfv/qtip:${DOCKER_TAG}" -docker pull opnfv/qtip:$DOCKER_TAG >/dev/null - -envs="--env-file $WORKSPACE/env_file" -docker_volume="-v /var/run/docker.sock:/var/run/docker.sock" - -cmd="docker run -id ${envs} ${docker_volume} opnfv/qtip:${DOCKER_TAG} /bin/bash" -echo "Qtip: Running docker command: ${cmd}" -${cmd} - -container_id=$(docker ps | grep "opnfv/qtip:${DOCKER_TAG}" | awk '{print $1}' | head -1) -if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then - echo "The container opnfv/qtip with ID=${container_id} has not been properly started. Exiting..." - exit 1 -fi - -echo "The container ID is: ${container_id}" -QTIP_REPO=/home/opnfv/repos/qtip - -if [[ "$INSTALLER_TYPE" == "apex" ]];then - if [ -f /root/.ssh/id_rsa ]; then - sudo chmod 600 /root/.ssh/id_rsa - sudo docker cp /root/.ssh/id_rsa ${container_id}:/root/.ssh/ - fi -fi - -case $TEST_SUITE in - compute) - docker exec -t ${container_id} bash -c "bash ${QTIP_REPO}/tests/ci/run_compute_qpi.sh" - ;; -esac - -echo "Qtip done!" -exit 0
\ No newline at end of file +exit 0 |