Make apply test more configurable

The Infra Cloud project uses a different set of puppet modules than the
standard infra ones in order to avoid possible dependency conflicts[1].
Currently the puppet-apply test hard-codes the entry-point puppet
manifest and module list. This patch makes the manifest, currently
manifests/site.pp, and the module file, currently modules.env,
configurable, so that we can add a new job to test just these nodes
with the correct modules installed.

[1] https://review.openstack.org/#/c/209617/

Change-Id: I744123befef0bf27a1eb2a79f5d814e0cefe81f5
This commit is contained in:
Colleen Murphy 2015-09-22 17:23:21 -07:00
parent 764326fdec
commit 324e5c4f57

@ -16,6 +16,12 @@
ROOT=$(readlink -fn $(dirname $0)/..)
export MODULE_PATH="${ROOT}/modules:/etc/puppet/modules"
# MODULE_ENV_FILE sets the list of modules to read from and install and can be
# overridden by setting it outside the script.
export MODULE_ENV_FILE=${MODULE_ENV_FILE:-modules.env}
# PUPPET_MANIFEST sets the manifest that is being tested and can be overridden
# by setting it outside the script.
export PUPPET_MANIFEST=${PUPPET_MANIFEST:-manifests/site.pp}
export PUPPET_INTEGRATION_TEST=1
@ -40,7 +46,9 @@ declare -A INTEGRATION_MODULES
project_names=""
source modules.env
source $MODULE_ENV_FILE
for MOD in ${!INTEGRATION_MODULES[*]}; do
project_scope=$(basename `dirname $MOD`)
repo_name=`basename $MOD`
@ -57,7 +65,7 @@ if [[ ! -d applytest ]] ; then
fi
# First split the variables at the beginning of the file
csplit -sf applytest/prep manifests/site.pp '/^$/' {0}
csplit -sf applytest/prep $PUPPET_MANIFEST '/^$/' {0}
# Then split the class defs.
csplit -sf applytest/puppetapplytest applytest/prep01 '/^}$/' {*}
# Remove } header left by csplit