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

« back to all changes in this revision

Viewing changes to acceptance/tests/resource/host/should_query.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 query hosts out of a hosts file"
2
 
 
3
 
file = "/tmp/hosts-#{Time.new.to_i}"
4
 
 
5
 
step "set up the system for the test"
6
 
on agents, "printf '127.0.0.1 localhost.local localhost\n' > #{file}"
7
 
 
8
 
step "fetch the list of hosts from puppet"
9
 
on(agents, puppet_resource('host', 'localhost', "target=#{file}")) do
10
 
    found = stdout.scan('present').length
11
 
    fail_test "found #{found} hosts, not 1" if found != 1
12
 
end
13
 
 
14
 
step "clean up the system"
15
 
on agents, "rm -vf #{file}"