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/parser_install.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'tests/parser_install.sh') diff --git a/tests/parser_install.sh b/tests/parser_install.sh index 308b8bc..40b61d4 100755 --- a/tests/parser_install.sh +++ b/tests/parser_install.sh @@ -9,20 +9,33 @@ ############################################################################## set +e +BASE_WORK_DIR=$(cd $(dirname $0) && pwd) -parser_repos_dir=$1 +OPNFV_REPO_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 +if [ -n "${OPNFV_REPO_DIR}" ]; then + echo " OPNFV repository directory is ${OPNFV_REPO_DIR}" + pip install -r ${OPNFV_REPO_DIR}/parser/tosca2heat/tosca-parser/requirements.txt + pip install -r ${OPNFV_REPO_DIR}/parser/tosca2heat/heat-translator/requirements.txt +else + echo "No input for OPNFV repository directory, will use local directory" + pip install -r ${BASE_WORK_DIR}/../tosca2heat/tosca-parser/requirements.txt + pip install -r ${BASE_WORK_DIR}/../tosca2heat/heat-translator/requirements.txt +fi # 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 +if [ -n "${OPNFV_REPO_DIR}" ]; then + cd ${OPNFV_REPO_DIR}/parser/tosca2heat/tosca-parser && python setup.py install + cd ${OPNFV_REPO_DIR}/parser/tosca2heat/heat-translator && python setup.py install +else + cd ${BASE_WORK_DIR}/../tosca2heat/tosca-parser && python setup.py install + cd ${BASE_WORK_DIR}/../tosca2heat/heat-translator && python setup.py install +fi \ No newline at end of file -- cgit 1.2.3-korg