Skip to content
Snippets Groups Projects
Commit 333b05cc authored by Ulrik Haugen's avatar Ulrik Haugen
Browse files

further tweaks to be able to use sudo as fakeroot.

update copyright statement.

fakeroot: tweak example sudoers config further.

%.testoutput targets: call env inside $(fakeroot) to keep it from
 dropping environment variables if it is sudo.

smoke-testing-state/var/lib/puppet, smoke-testing-state/var/run: merge
targets.

clean: chown smoke-testing-state recursively before attempting to
delete directories in smoke-testing-state/var.
parent f1732ae4
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
# Make instructions for smoke testing Puppet manifests.
# Copyright 2013 - 2015 Ulrik Haugen
# Copyright 2013 - 2014 Linköpings universitet
# Copyright 2013 - 2015 Linköpings universitet
# This program is free software: you can redistribute it and/or modify
# it under the terms of the Gnu general public license as published by
......@@ -167,8 +167,9 @@ osfamily := $(shell facter osfamily|tr A-Z a-z)
# Possible values for fakeroot are: fakeroot, fakeroot-ng
# (nonfunctional), empty (noop) and sudo.
# Sudo will require a line like
# Sudo will require lines like
# %puppet-devs ALL = (root) NOPASSWD: /usr/bin/env * puppet apply --noop *
# %puppet-devs ALL = (root) NOPASSWD: /bin/chown -R * smoke-testing-state
# in your sudoers configuration. Beware though that this will let all
# members of puppet-devs trivially escalate their priviliges.
# Set it to empty on Centos/Redhat and fakeroot elsewhere.
......@@ -209,8 +210,9 @@ puppet-paths := --confdir smoke-testing-state/etc \
# Apply test manifests with specified environment:
%.testoutput: %.testenv smoke-testing-state/share/global.testenv smoke-testing-state/etc/puppet.conf smoke-testing-state/var/lib/puppet smoke-testing-state/var/run FORCE
cat $< >$@
$(fakeroot) \
env `cat smoke-testing-state/share/global.testenv` `cat $<` \
$(fakeroot) puppet apply --noop \
puppet apply --noop \
$(puppet-extra-args) \
$(puppet-paths) --verbose --color no \
$(basename $*).pp >>$@ 2>&1 \
......@@ -218,8 +220,9 @@ puppet-paths := --confdir smoke-testing-state/etc \
# Apply test manifests without specified environment:
%.testoutput: %.pp smoke-testing-state/share/global.testenv smoke-testing-state/etc/puppet.conf smoke-testing-state/var/lib/puppet smoke-testing-state/var/run FORCE
$(fakeroot) \
env `cat smoke-testing-state/share/global.testenv` \
$(fakeroot) puppet apply --noop \
puppet apply --noop \
$(puppet-extra-args) \
$(puppet-paths) --verbose --color no \
$< >$@ 2>&1 \
......@@ -292,14 +295,12 @@ smoke-testing-state/share/global.testenv: smoke-testing-state/share/global.teste
echo -n "FACTER_$${envdef} "; \
done >$@
smoke-testing-state/var/lib/puppet:
mkdir -p $@
smoke-testing-state/var/run:
smoke-testing-state/var/lib/puppet smoke-testing-state/var/run:
mkdir -p $@
clean:
rm -f $(testartifacts)
$(fakeroot) chown -R `id -un` smoke-testing-state
rm -fr smoke-testing-state/share/global.testenv \
smoke-testing-state/var/lib/puppet smoke-testing-state/var/run \
smoke-testing-state/var/state smoke-testing-state/var/reports
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment