~ubuntu-branches/ubuntu/precise/puppet/precise-proposed

« back to all changes in this revision

Viewing changes to acceptance/tests/allow_symlinks_as_config_directories.rb

  • Committer: Package Import Robot
  • Author(s): Micah Anderson
  • Date: 2012-02-23 18:24:48 UTC
  • mfrom: (1.1.28) (3.1.36 sid)
  • Revision ID: package-import@ubuntu.com-20120223182448-belun93murza4w99
Tags: 2.7.11-1
* New upstream release
* Urgency set to high due to regressions in previous release
  and security vulnerabilities
* Execs when run with a user specified, but no group, get the root
  group. Similarly unexpected privileges are given to providers and
  types (egid remains as root), this is fixed with a patch from
  upstream (CVE-2012-1053)
* Fix Klogin write through symlink (CVE-2012-1054)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
test_name "Should allow symlinks to directories as configuration directories"
 
2
 
 
3
step "Create the test confdir with a link to it"
 
4
confdir = "/tmp/puppet_conf-directory-#{$$}"
 
5
conflink = "/tmp/puppet_conf-symlink-#{$$}"
 
6
 
 
7
on agents, "rm -rf #{conflink} #{confdir}"
 
8
 
 
9
on agents, "mkdir #{confdir}"
 
10
on agents, "ln -s #{confdir} #{conflink}"
 
11
 
 
12
create_remote_file agents, "#{confdir}/puppet.conf", <<CONFFILE
 
13
[main]
 
14
certname = "awesome_certname"
 
15
CONFFILE
 
16
 
 
17
manifest = 'notify{"My certname is $clientcert": }'
 
18
 
 
19
step "Run Puppet and ensure it used the conf file in the confdir"
 
20
on agents, puppet_apply("--confdir #{conflink}"), :stdin => manifest do
 
21
  assert_match("My certname is awesome_certname", stdout)
 
22
end
 
23
 
 
24
step "Check that the symlink and confdir are unchanged"
 
25
on agents, "[ -L #{conflink} ]"
 
26
on agents, "[ -d #{confdir} ]"
 
27
on agents, "[ $(readlink #{conflink}) = #{confdir} ]"