diff --git a/acceptance/tests/allow_symlinks_as_config_directories.rb b/acceptance/tests/allow_symlinks_as_config_directories.rb index 66c6ccca0..1f450fe25 100644 --- a/acceptance/tests/allow_symlinks_as_config_directories.rb +++ b/acceptance/tests/allow_symlinks_as_config_directories.rb @@ -1,27 +1,34 @@ 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-#{$$}" +agents.each do |agent| + if agent['platform'].include?('windows') + skip_test "Test not supported on this platform" + next + end -on agents, "rm -rf #{conflink} #{confdir}" + step "Create the test confdir with a link to it" + confdir = agent.tmpdir('puppet_conf-directory') + conflink = agent.tmpfile('puppet_conf-symlink') -on agents, "mkdir #{confdir}" -on agents, "ln -s #{confdir} #{conflink}" + on agent, "rm -rf #{conflink} #{confdir}" -create_remote_file agents, "#{confdir}/puppet.conf", < manifest do - assert_match("My certname is awesome_certname", stdout) -end + step "Run Puppet and ensure it used the conf file in the confdir" + on agent, 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} ]" + step "Check that the symlink and confdir are unchanged" + on agent, "[ -L #{conflink} ]" + on agent, "[ -d #{confdir} ]" + on agent, "[ $(readlink #{conflink}) = #{confdir} ]" +end