From 4bc87f5dc55cfbcc1cc7cdcbd1b6414d0da1e987 Mon Sep 17 00:00:00 2001 From: zhihui wu Date: Wed, 23 Aug 2017 10:34:52 +0800 Subject: Some Optimizations - remove container and image without -f - remove duplicated code from verify_storage.sh, replaced by the script launch_containers_by_testsuite.sh - move the common sentences from periodic.sh to launch_containers_by_testsuite.sh - add 'QTIP' as prompt for print messages Change-Id: Ia9aa61a3b60c1049af3499a06f2c6cd0dc181552 Signed-off-by: zhihui wu --- tests/ci/verify_storage.sh | 55 ++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 41 deletions(-) (limited to 'tests/ci/verify_storage.sh') diff --git a/tests/ci/verify_storage.sh b/tests/ci/verify_storage.sh index 00120211..32e94f9e 100755 --- a/tests/ci/verify_storage.sh +++ b/tests/ci/verify_storage.sh @@ -7,56 +7,29 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -WORKSPACE=${WORKSPACE:=`pwd`} +TEST_SUITE=storage +QTIP_REPO=/home/opnfv/repos/qtip export DOCKER_TAG=${DOCKER_TAG:-latest} export ENV_FILE=$WORKSPACE/env_file 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 - -git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng -$WORKSPACE/releng/utils/fetch_os_creds.sh -i $INSTALLER_TYPE -a $INSTALLER_IP -d $WORKSPACE/openrc - -grep "export" $WORKSPACE/openrc | sed "s/export //" > $WORKSPACE/env_file -echo "INSTALLER_TYPE=$INSTALLER_TYPE" >> $WORKSPACE/env_file -echo "INSTALLER_IP=$INSTALLER_IP" >> $WORKSPACE/env_file -echo "NODE_NAME=$NODE_NAME" >> $WORKSPACE/env_file -echo "SCENARIO=$DEPLOY_SCENARIO" >> $WORKSPACE/env_file -echo "TESTAPI_URL=$TESTAPI_URL" >> $WORKSPACE/env_file -echo "DOCKER_TAG=$DOCKER_TAG" >> $WORKSPACE/env_file - -echo "--------------------ENV_FILE----------------------------" -cat $WORKSPACE/env_file -echo "--------------------------------------------------------" - -source $script_dir/storperf/containers.sh -cd $script_dir/storperf -clean_containers -launch_containers +source $script_dir/launch_containers_by_testsuite.sh container_id=$(docker ps | grep "opnfv/qtip:${DOCKER_TAG}" | awk '{print $1}' | head -1) -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 +if [[ -z "$container_id" ]]; then + echo "QTIP: The container opnfv/qtip has not been properly started. Exiting..." + exit 1 +else + echo "QTIP: Copying current submit patch to the container ${container_id}" + cd $WORKSPACE + docker cp . ${container_id}:${QTIP_REPO} + docker exec ${container_id} bash -c "cd ${QTIP_REPO} && pip install -U -e ." + docker exec -t ${container_id} bash -c "bash ${QTIP_REPO}/tests/ci/run_${TEST_SUITE}_qpi.sh" + echo "QTIP: Verify ${TEST_SUITE} done!" + exit 0 fi -QTIP_REPO=/home/opnfv/repos/qtip - -echo "QTIP: Copying current submit patch to the container ${container_id}" -cd $WORKSPACE -docker cp . ${container_id}:${QTIP_REPO} -docker exec ${container_id} bash -c "cd ${QTIP_REPO} && pip install -U -e ." - -docker exec -t ${container_id} bash -c "bash ${QTIP_REPO}/tests/ci/run_storage_qpi.sh" -echo "Verify storage done!" -exit 0 \ No newline at end of file -- cgit 1.2.3-korg