blob: 24d323373b8a1d3bef88ac816c6e40852480ff5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
test_name "should realize query"
out = "/tmp/hosts-#{Time.new.to_i}"
name = "test-#{Time.new.to_i}-host"
manifest = %Q{
@host { '#{name}':
ip => '127.0.0.2',
target => '#{out}',
host_aliases => 'alias',
ensure => present,
}
Host<| ip == '127.0.0.2' |>
}
step "clean up target system for test"
on agents, "rm -f #{out}"
step "run the manifest"
apply_manifest_on agents, manifest
step "verify the file output"
on(agents, "cat #{out}") do
fail_test "host not found in output" unless stdout.include? name
end
|