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

« back to all changes in this revision

Viewing changes to acceptance/tests/resource/host/ticket_4131_should_not_create_without_ip.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 "#4131: should not create host without IP attribute"
2
 
 
3
 
file = "/tmp/hosts-#{Time.new.to_i}"
4
 
 
5
 
step "configure the target system for the test"
6
 
on agents, "rm -vrf #{file} ; touch #{file}"
7
 
 
8
 
step "try to create the host, which should fail"
9
 
# REVISIT: This step should properly need to handle the non-zero exit code,
10
 
# and #5668 has been filed to record that.  When it is fixed this test will
11
 
# start to fail, and this comment will tell you why. --daniel 2010-12-24
12
 
on(agents, puppet_resource('host', 'test', "target=#{file}",
13
 
              "host_aliases=alias")) do
14
 
    fail_test "puppet didn't complain about the missing attribute" unless
15
 
        stdout.include? 'ip is a required attribute for hosts'
16
 
end
17
 
 
18
 
step "verify that the host was not added to the file"
19
 
on(agents, "cat #{file} ; rm -f #{file}") do
20
 
    fail_test "the host was apparently added to the file" if stdout.include? 'test'
21
 
end