Add test script

Add a test script to verify that the template can be processed.

Change-Id: Ie365c61dc1d10b78e4c85414978800a06b2e5ef0
This commit is contained in:
Doug Hellmann 2014-07-28 09:49:24 -04:00
parent d61681928c
commit 1ae38d7230
2 changed files with 36 additions and 0 deletions

26
tools/test_template.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash -x
#
# Test that the template can be applied
#
# Arguments:
#
# tmp_dir - Directory where it is possible to create temporary files.
tmp_dir="$1"
out_dir="$tmp_dir/output"
# The templates are above the tools directory.
template_dir=$(dirname $(dirname $0))
rm -rf $out_dir
mkdir -p $out_dir
cd $out_dir
cookiecutter -v $template_dir <<EOF
testing
openstack
This package is for testing the templates.
EOF
echo "Files created:"
find $out_dir

10
tox.ini Normal file
View File

@ -0,0 +1,10 @@
[tox]
minversion = 1.6
envlist = cookiecutter
skipsdist = True
[testenv:cookiecutter]
deps = cookiecutter
commands =
mkdir -p {envdir}/tmp
{toxinidir}/tools/test_template.sh {envdir}/tmp