1
test_name "should query hosts out of a hosts file"
3
file = "/tmp/hosts-#{Time.new.to_i}"
5
step "set up the system for the test"
6
on agents, "printf '127.0.0.1 localhost.local localhost\n' > #{file}"
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
14
step "clean up the system"
15
on agents, "rm -vf #{file}"