X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ffunctest_run.sh;h=b866ab9a177cfd4628e78e9afcb685ad8421a724;hb=a9ea7f6e9c495895ad5f1993687b1ee06e8aa00c;hp=7b65da00c9c48e594bab3e0d697824814f62735c;hpb=a04cdab7bd95502d9b537db790f4ecbbbf82b7d0;p=parser.git diff --git a/tests/functest_run.sh b/tests/functest_run.sh index 7b65da0..b866ab9 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,12 +18,23 @@ PARSER_CI_DEBUG=${CI_DEBUG:-false} set +x debug="" } +LOCAL_IMAGE_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_FILE=cirros-0.3.0-x86_64-disk.img -PARSER_IMAGE_URL_FILE=cirros-0.3.2-x86_64-disk.img -# 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 @@ -97,7 +110,9 @@ create_parser_user_and_project() { } || { openstack ${debug} role add ${PARSER_ROLE} --user ${PARSER_USER} \ --project ${PARSER_PROJECT} - echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} in project ${PARSER_PROJECT} successful." + openstack ${debug} role add heat_stack_owner --user ${PARSER_USER} \ + --project ${PARSER_PROJECT} + echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} and heat_stack_owner in project ${PARSER_PROJECT} successful." } } @@ -109,6 +124,9 @@ change_env_to_parser_user_project() { export OS_PROJECT_NAME=${PARSER_PROJECT} export OS_TENANT_NAME=${PARSER_TENANT} + export OS_PROJECT_DOMAIN_NAME=${OS_PROJECT_DOMAIN_NAME:-'Default'} + export OS_USER_DOMAIN_NAME=${OS_USER_DOMAIN_NAME:-'Default'} + } @@ -290,7 +308,7 @@ echo "" trap reset_parser_test EXIT # start syslog for loghander -service rsyslog restart +which service > /dev/null && service rsyslog restart || true echo "|========= 1/4. Preparing VM image for parser... =========|" download_parser_image