~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to acceptance/tests/resource/host/should_destroy.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
test_name "should be able to remove a host record"
2
 
 
3
 
file = "/tmp/hosts-#{Time.new.to_i}"
4
 
line = "127.0.0.7 test1"
5
 
 
6
 
step "set up files for the test"
7
 
on agents, "printf '#{line}\n' > #{file}"
8
 
 
9
 
step "delete the resource from the file"
10
 
on(agents, puppet_resource('host', 'test1', "target=#{file}",
11
 
              'ensure=absent', 'ip=127.0.0.7'))
12
 
 
13
 
step "verify that the content was removed"
14
 
on(agents, "cat #{file}; rm -f #{file}") do
15
 
    fail_test "the content was still present" if stdout.include? line
16
 
end
17
 
 
18
 
step "clean up after the test"
19
 
on agents, "rm -vf #{file}"