(FM-7795) Cleanup java tests (#350)
* Add idempotent_apply function * Remove unsupported OS specific code * Remove outdated comments * Improve unit test coverage * Fix typo
This commit is contained in:
@@ -21,3 +21,17 @@ RSpec.configure do |c|
|
||||
# Readable test descriptions
|
||||
c.formatter = :documentation
|
||||
end
|
||||
|
||||
def idempotent_apply(hosts, manifest, opts = {}, &block)
|
||||
block_on hosts, opts do |host|
|
||||
file_path = host.tmpfile('apply_manifest.pp')
|
||||
create_remote_file(host, file_path, manifest + "\n")
|
||||
|
||||
puppet_apply_opts = { :verbose => nil, 'detailed-exitcodes' => nil }
|
||||
on_options = { acceptable_exit_codes: [0, 2] }
|
||||
on host, puppet('apply', file_path, puppet_apply_opts), on_options, &block
|
||||
puppet_apply_opts2 = { :verbose => nil, 'detailed-exitcodes' => nil }
|
||||
on_options2 = { acceptable_exit_codes: [0] }
|
||||
on host, puppet('apply', file_path, puppet_apply_opts2), on_options2, &block
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user