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