summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/allow_symlinks_as_config_directories.rb
blob: 66c6ccca067ae646e4faa3defe85faab6d6e47fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
test_name "Should allow symlinks to directories as configuration directories"

step "Create the test confdir with a link to it"
confdir = "/tmp/puppet_conf-directory-#{$$}"
conflink = "/tmp/puppet_conf-symlink-#{$$}"

on agents, "rm -rf #{conflink} #{confdir}"

on agents, "mkdir #{confdir}"
on agents, "ln -s #{confdir} #{conflink}"

create_remote_file agents, "#{confdir}/puppet.conf", <<CONFFILE
[main]
certname = "awesome_certname"
CONFFILE

manifest = 'notify{"My certname is $clientcert": }'

step "Run Puppet and ensure it used the conf file in the confdir"
on agents, puppet_apply("--confdir #{conflink}"), :stdin => manifest do
  assert_match("My certname is awesome_certname", stdout)
end

step "Check that the symlink and confdir are unchanged"
on agents, "[ -L #{conflink} ]"
on agents, "[ -d #{confdir} ]"
on agents, "[ $(readlink #{conflink}) = #{confdir} ]"