2 require 'beaker/puppet_install_helper'
3 require 'beaker/module_install_helper'
4 require 'beaker-task_helper'
6 run_puppet_install_helper
7 install_bolt_on(hosts) unless pe_install?
8 install_module_on(hosts)
9 install_module_dependencies_on(hosts)
11 UNSUPPORTED_PLATFORMS = ['RedHat', 'Suse', 'windows', 'AIX', 'Solaris'].freeze
14 ERROR_MATCHER = %r{(no valid OpenPGP data found|keyserver timed out|keyserver receive failed)}
16 # This method allows a block to be passed in and if an exception is raised
17 # that matches the 'error_matcher' matcher, the block will wait a set number
18 # of seconds before retrying.
20 # - max_retry_count - Max number of retries
21 # - retry_wait_interval_secs - Number of seconds to wait before retry
22 # - error_matcher - Matcher which the exception raised must match to allow retry
24 # retry_on_error_matching(3, 5, /OpenGPG Error/) do
25 # apply_manifest(pp, :catch_failures => true)
27 def retry_on_error_matching(max_retry_count = MAX_RETRY_COUNT, retry_wait_interval_secs = RETRY_WAIT, error_matcher = ERROR_MATCHER)
30 puts "retry_on_error_matching: try #{try}" unless try.zero?
33 rescue StandardError => e
34 raise unless try < max_retry_count && (error_matcher.nil? || e.message =~ error_matcher)
35 sleep retry_wait_interval_secs
40 RSpec.configure do |c|
41 File.expand_path(File.join(File.dirname(__FILE__), '..'))
43 # Readable test descriptions
44 c.formatter = :documentation
46 # Configure all nodes in nodeset
48 run_puppet_access_login(user: 'admin') if pe_install? && puppet_version =~ %r{(5\.\d\.\d)}