Fixing dependencies for tests
diff --git "a/\173\173cookiecutter.service_name\175\175/tests/pip_requirements.txt" "b/\173\173cookiecutter.service_name\175\175/tests/pip_requirements.txt"
deleted file mode 100644
index 8fad73f..0000000
--- "a/\173\173cookiecutter.service_name\175\175/tests/pip_requirements.txt"
+++ /dev/null
@@ -1 +0,0 @@
-+jsonschema
diff --git "a/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh" "b/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh"
index c1ed03c..007d5b6 100755
--- "a/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh"
+++ "b/\173\173cookiecutter.service_name\175\175/tests/run_tests.sh"
@@ -2,7 +2,8 @@
###
# Script requirments:
-# apt-get install -y python-yaml virtualenv git
+#apt-get install -y python-yaml virtualenv git
+
set -e
[ -n "$DEBUG" ] && set -x
@@ -42,9 +43,11 @@
setup_virtualenv() {
log_info "Setting up Python virtualenv"
+ dependency_check virtualenv
virtualenv $VENV_DIR
source ${VENV_DIR}/bin/activate
pip install salt${PIP_SALT_VERSION}
+ pip install jsonschema
if [[ -f ${CURDIR}/pip_requirements.txt ]]; then
pip install -r ${CURDIR}/pip_requirements.txt
fi
@@ -108,6 +111,7 @@
dep_root="${DEPSDIR}/$(basename $dep_source .git)"
dep_metadata="${dep_root}/metadata.yml"
+ dependency_check git
[ -d $dep_root ] && { log_info "Dependency $dep_name already fetched"; return 0; }
log_info "Fetching dependency $dep_name"
@@ -215,6 +219,14 @@
done
}
+dependency_check() {
+ local DEPENDENCY_COMMANDS=$*
+
+ for DEPENDENCY_COMMAND in $DEPENDENCY_COMMANDS; do
+ which $DEPENDENCY_COMMAND > /dev/null || ( log_err "Command \"$DEPENDENCY_COMMAND\" can not be found in default path."; exit 1; )
+ done
+}
+
_atexit() {
RETVAL=$?
trap true INT TERM EXIT
diff --git "a/\173\173cookiecutter.service_name\175\175/\173\173cookiecutter.service_name\175\175/schemas/server.yaml" "b/\173\173cookiecutter.service_name\175\175/\173\173cookiecutter.service_name\175\175/schemas/\173\173cookiecutter.role_name\175\175.yaml"
similarity index 100%
rename from "\173\173cookiecutter.service_name\175\175/\173\173cookiecutter.service_name\175\175/schemas/server.yaml"
rename to "\173\173cookiecutter.service_name\175\175/\173\173cookiecutter.service_name\175\175/schemas/\173\173cookiecutter.role_name\175\175.yaml"