From d2a7b7ffb4e45dd0803f01c9b5328b7cfba2c572 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Wed, 10 Aug 2016 16:21:27 +0800 Subject: Add parser install script for functest As a tester; I want functest prepare the test env for parser; So it 's necessary to create parser_install.sh script for functest when building docker image. JIRA:PARSER-84 Change-Id: I3cc2cbba4d90b676ca362e54242f52afc3387e72 Signed-off-by: shangxdy --- tests/functest_run.sh | 10 +++++++--- tests/parser_install.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100755 tests/parser_install.sh (limited to 'tests') diff --git a/tests/functest_run.sh b/tests/functest_run.sh index f741912..f72dd09 100755 --- a/tests/functest_run.sh +++ b/tests/functest_run.sh @@ -8,7 +8,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -[[ "${CI_DEBUG:-true}" == "true" ]] && set -x +PARSER_CI_DEBUG=${CI_DEBUG:-true} +[[ "${PARSER_CI_DEBUG}" == "true" ]] && set -x PARSER_IMAGE_URL_FILE=cirros-0.3.0-x86_64-disk.img PARSER_IMAGE_URL=https://launchpad.net/cirros/trunk/0.3.0/+download/${PARSER_IMAGE_URL_FILE} @@ -138,7 +139,7 @@ reset_parser_test() { } # 3). Delete hot tmp file ${VRNC_OUTPUT_TEMPLATE_FILE} - [ -e ${VRNC_OUTPUT_TEMPLATE_FILE} -a ${CI_DEBUG} != "true" ] && { + [ -e ${VRNC_OUTPUT_TEMPLATE_FILE} -a ${PARSER_CI_DEBUG} != "true" ] && { echo "delete hot temp file ${VRNC_OUTPUT_TEMPLATE_FILE} after test." rm -fr ${VRNC_OUTPUT_TEMPLATE_FILE} } @@ -150,7 +151,7 @@ reset_parser_test() { } # 5). Delete tmp image ${PARSER_IMAGE_URL_FILE} - [ -e ${PARSER_IMAGE_URL_FILE} -a ${CI_DEBUG} != "true" ] && { + [ -e ${PARSER_IMAGE_URL_FILE} -a ${PARSER_CI_DEBUG} != "true" ] && { echo "delete local URL image file ${PARSER_IMAGE_URL_FILE} after test." rm -fr ${PARSER_IMAGE_URL_FILE} } @@ -184,6 +185,9 @@ echo "======================= Parser functest begin ==========================" trap reset_parser_test EXIT +# start syslog for loghander +service rsyslog restart + echo " ========= 1/4. Preparing VM image for parser... ========= " download_parser_image register_parser_image diff --git a/tests/parser_install.sh b/tests/parser_install.sh new file mode 100755 index 0000000..48f07ac --- /dev/null +++ b/tests/parser_install.sh @@ -0,0 +1,26 @@ +#!/bin/bash -e +############################################################################## +# Copyright (c) 2016 ZTE Corporation. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +parser_repos_dir=$1 + +# start syslog for loghander +service rsyslog restart && echo "syslog start successfully" + +# install requirements for parser +pip install -r ${parser_repos_dir}/parser/tosca2heat/tosca-parser/requirements.txt +pip install -r ${parser_repos_dir}/parser/tosca2heat/heat-translator/requirements.txt + +# uninstall other tosca-parser and heat-translator for parser +pip uninstall -y tosca-parser +pip uninstall -y heat-translator + +# install parser +cd ${parser_repos_dir}/parser/tosca2heat/tosca-parser && python setup.py install +cd ${parser_repos_dir}/parser/tosca2heat/heat-translator && python setup.py install -- cgit 1.2.3-korg