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

« back to all changes in this revision

Viewing changes to acceptance/tests/resource/host/should_modify_alias.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 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 -vf #{file}"