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