From 324e5c4f57376d21bcd9843dd37da023f4435f44 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Tue, 22 Sep 2015 17:23:21 -0700 Subject: [PATCH] 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 --- tools/apply-test.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/apply-test.sh b/tools/apply-test.sh index f45571b52e..4881a5ee2d 100755 --- a/tools/apply-test.sh +++ b/tools/apply-test.sh @@ -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