From 15591ae4c8c1260c37631526b5e18ebe84770e36 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Tue, 25 Jul 2017 17:33:53 +0800 Subject: Merge install and test script Merge installation and test script because functest will not called the script of parser_install.sh, and only call the script of functest_run.sh. JIRA: PARSER-130 Change-Id: I452010f0d635dfbd9fb802743f3b858d66b72b32 Signed-off-by: shangxdy --- tests/functest_run.sh | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'tests/functest_run.sh') diff --git a/tests/functest_run.sh b/tests/functest_run.sh index 5c219bb..2ee02bb 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -9,6 +9,8 @@ ############################################################################## PARSER_CI_DEBUG=${CI_DEBUG:-false} +PRASER_WORK_DIR=$(cd $(dirname $0) && pwd) + [[ "${PARSER_CI_DEBUG}" == "true" ]] && { set -x debug="--debug" @@ -16,15 +18,32 @@ PARSER_CI_DEBUG=${CI_DEBUG:-false} set +x debug="" } +LOCAL_IMAGE_FILE=${1:-""} + +# Install parser +echo "Prepare parser ..." +echo "===================" +echo "" +${PRASER_WORK_DIR}/parser_install.sh ${PRASER_WORK_DIR}/../.. +echo "" +echo "Prepare result: $?" +echo "===================" -if [ -n $1 ]; then - PARSER_IMAGE_URL_FILE=$1 +if [ -e "${LOCAL_IMAGE_FILE}" ]; then + echo "Input local image file: ${LOCAL_IMAGE_FILE}" + PARSER_IMAGE_URL_FILE=${LOCAL_IMAGE_FILE} else + echo "No local image file or the file(${LOCAL_IMAGE_FILE}) doesn't exsit!" + PARSER_IMAGE_URL_FILE=cirros-0.3.5-x86_64-disk.img + PARSER_IMAGE_VERSION=$(echo ${PARSER_IMAGE_URL_FILE} | awk -F- '{print $2}') + # PARSER_IMAGE_URL=https://launchpad.net/cirros/trunk/0.3.0/+download/${PARSER_IMAGE_URL_FILE} + PARSER_IMAGE_URL=http://download.cirros-cloud.net/${PARSER_IMAGE_VERSION}/${PARSER_IMAGE_URL_FILE} + echo "so will download image(${PARSER_IMAGE_URL_FILE}) from ${PARSER_IMAGE_URL}." fi -# PARSER_IMAGE_URL=https://launchpad.net/cirros/trunk/0.3.0/+download/${PARSER_IMAGE_URL_FILE} -PARSER_IMAGE_URL=http://download.cirros-cloud.net/0.3.2/${PARSER_IMAGE_URL_FILE} + # PARSER_IMAGE_NAME=rhel-6.5-test-image +# fiexd image name according to the translator default vlaue of images PARSER_IMAGE_NAME=cirros-0.3.2-x86_64-uec PARSER_IMAGE_FILE="${PARSER_IMAGE_NAME}.img" PARSER_IMAGE_FORMAT=qcow2 -- cgit 1.2.3-korg