summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/resource/host/should_create.rb
blob: f5c0a17a5d7177aa7a4e30861ca7bc33f0422329 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
test_name "host should create"

target = "/tmp/host-#{Time.new.to_i}"

step "clean up for the test"
on agents, "rm -f #{target}"

step "create the host record"
on(agents, puppet_resource("host", "test", "ensure=present",
              "ip=127.0.0.1", "target=#{target}"))

step "verify that the record was created"
on(agents, "cat #{target} ; rm -f #{target}") do
    fail_test "record was not present" unless stdout =~ /^127\.0\.0\.1[[:space:]]+test/
end