22require 'beaker-rspec'
33require 'beaker-puppet'
44require 'beaker/module_install_helper'
5- require 'beaker/puppet_install_helper'
65require 'voxpupuli/acceptance/spec_helper_acceptance'
76
87$LOAD_PATH << File . join ( __dir__ , 'acceptance/lib' )
@@ -16,6 +15,30 @@ def non_windows_agents
1615end
1716
1817RSpec . configure do |c |
18+ def run_puppet_install_helper
19+ return unless ENV [ 'PUPPET_INSTALL_TYPE' ] == 'agent'
20+ if ENV [ 'BEAKER_PUPPET_COLLECTION' ] . match? %r{/-nightly$/}
21+ # Workaround for RE-10734
22+ options [ :release_apt_repo_url ] = 'http://nightlies.puppet.com/apt'
23+ options [ :win_download_url ] = 'http://nightlies.puppet.com/downloads/windows'
24+ options [ :mac_download_url ] = 'http://nightlies.puppet.com/downloads/mac'
25+ end
26+
27+ agent_sha = ENV [ 'BEAKER_PUPPET_AGENT_SHA' ] || ENV [ 'PUPPET_AGENT_SHA' ]
28+ if agent_sha . nil? || agent_sha . empty?
29+ install_puppet_agent_on ( hosts , options . merge ( version : version ) )
30+ else
31+ # If we have a development sha, assume we're testing internally
32+ dev_builds_url = ENV [ 'DEV_BUILDS_URL' ] || 'http://builds.delivery.puppetlabs.net'
33+ install_from_build_data_url ( 'puppet-agent' , "#{ dev_builds_url } /puppet-agent/#{ agent_sha } /artifacts/#{ agent_sha } .yaml" , hosts )
34+ end
35+
36+ # XXX install_puppet_agent_on() will only add_aio_defaults_on when the
37+ # nodeset type == 'aio', but we don't want to depend on that.
38+ add_aio_defaults_on ( hosts )
39+ add_puppet_paths_on ( hosts )
40+ end
41+
1942 c . before :suite do
2043 unless ENV [ 'BEAKER_provision' ] == 'no'
2144 hosts . each { |host | host [ :type ] = 'aio' }
0 commit comments