system-config/test.sh
Jonathan Harker 4f25a69a89 Run the puppet apply test (requires sudo)
The test.sh script is not currently being run in any jobs, this change
removes the redundant validation code that's also in the puppet-syntax
job and creates a puppet-apply-test job that runs the test.sh script.

Running `puppet apply --noop` requires sudo, otherwise it will give
errors about refusing to run commands as other users.

Change-Id: Ie6b278d98390a8a5dd8bb24899c8c4083f5755c9
2014-05-28 17:02:16 -07:00

17 lines
513 B
Bash
Executable File

#!/bin/bash -e
ROOT=$(readlink -fn $(dirname $0))
MODULE_PATH="${ROOT}/modules:/etc/puppet/modules"
if [ ! -d applytest ] ; then
mkdir applytest
fi
csplit -sf applytest/puppetapplytest manifests/site.pp '/^$/' {*}
sed -i -e 's/^[^[:space:]]/#&/g' applytest/puppetapplytest*
sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' applytest/puppetapplytest*
for f in `find applytest -name 'puppetapplytest*' -print` ; do
sudo puppet apply --modulepath=${MODULE_PATH} --noop --verbose --debug $f >/dev/null
done