# 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}
}
# 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}
}
}
# 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}
}
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
--- /dev/null
+#!/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