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

« back to all changes in this revision

Viewing changes to acceptance/tests/resource/host/should_modify_alias.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 be able to modify a host alias"
 
2
 
 
3
file = "/tmp/hosts-#{Time.new.to_i}"
 
4
 
 
5
step "set up files for the test"
 
6
on agents, "printf '127.0.0.8 test alias\n' > #{file}"
 
7
 
 
8
step "modify the resource"
 
9
on(agents, puppet_resource('host', 'test', "target=#{file}",
 
10
              'ensure=present', 'ip=127.0.0.8', 'host_aliases=banzai'))
 
11
 
 
12
step "verify that the content was updated"
 
13
on(agents, "cat #{file}; rm -f #{file}") do
 
14
    fail_test "the alias was not updated" unless
 
15
        stdout =~ /^127\.0\.0\.8[[:space:]]+test[[:space:]]+banzai[[:space:]]*$/
 
16
end
 
17
 
 
18
step "clean up after the test"
 
19
on agents, "rm -f #{file}"