summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/language/resource_refs_with_nested_arrays.rb
blob: 7bc79788524ae8e0ef477967ec8651196fa2879f (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
25
26
27
test_name "#7681: Allow using array variables in resource references"

test_manifest = <<MANIFEST
$exec_names = ["first", "second"]
exec { "first":
  command => "echo the first command",
  path => "/usr/bin:/bin",
  logoutput => true,
}
exec { "second":
  command => "echo the second command",
  path => "/usr/bin:/bin",
  logoutput => true,
}
exec { "third":
  command => "echo the final command",
  path => "/usr/bin:/bin",
  logoutput => true,
  require => Exec[$exec_names],
}
MANIFEST

results = apply_manifest_on agents, test_manifest

results.each do |result|
  assert_match(/Exec\[third\].*the final command/, "#{result.stdout}")
end