Commit eeab09b
Use agents beaker DSL method
Beaker's singular `agent` DSL method can either return a single host or an array
of hosts, depending on how many hosts have the agent role in your beaker config.
For example, when running with `redhat7-64m-ubuntu2004-64a`, then it will return
a single host. If running with `redhat7-64ma-ubuntu2004-64a`, then it will
return an array of hosts[1].
The beaker `agent` method should never be used as it can cause tests to pass in
agent CI, but fail in puppetserver CI, since they test the agent running on the
server host.
Instead reference the `agents` method, which is guaranteed to exist and return
an array, possible empty.
Also use the `fact_on` helper which parses the facter output as JSON and avoids
having to chomp newlines in the output.
[1] https://github.com/voxpupuli/beaker/blob/abd5b30e93061b44e45f2211bc6a73cb6e20b353/lib/beaker/dsl/roles.rb#L181-L187
(cherry picked from commit e3652a0)1 parent 9505b58 commit eeab09b
File tree
2 files changed
+6
-2
lines changed- acceptance/tests/resource/package
2 files changed
+6
-2
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
0 commit comments