summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtests/functest_run.sh10
-rwxr-xr-xtests/parser_install.sh26
2 files changed, 33 insertions, 3 deletions
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