Skip to content

Commit

Permalink
(BKR-931) Ensure that :type = 'aio' works in EL
Browse files Browse the repository at this point in the history
EL and Fedora systems were not installing the pc1 version of Puppet
when :type = aio. This ensures that the case is properly addressed.

Closes BKR-931
  • Loading branch information
trevor-vaughan authored and petems committed Feb 17, 2017
1 parent a247d5e commit 688a1c8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/beaker/dsl/install_utils/foss_utils.rb
Expand Up @@ -436,7 +436,11 @@ def configure_puppet_on(hosts, opts = {})
# @api private
def install_puppet_from_rpm_on( hosts, opts )
block_on hosts do |host|
install_puppetlabs_release_repo(host)
if host[:type] == 'aio'
install_puppetlabs_release_repo(host,'pc1',opts)
else
install_puppetlabs_release_repo(host,nil,opts)
end

if opts[:facter_version]
host.install_package("facter-#{opts[:facter_version]}")
Expand Down Expand Up @@ -922,6 +926,7 @@ def install_puppetlabs_release_repo_on( hosts, repo = nil, opts = options )
# cisco ios xr requires using yum to localinstall the repo
on host, "yum -y localinstall #{remote}"
else
opts[:package_proxy] ||= false
host.install_package_with_rpm( remote, '--replacepkgs',
{ :package_proxy => opts[:package_proxy] } )
end
Expand Down
25 changes: 25 additions & 0 deletions spec/beaker/dsl/install_utils/foss_utils_spec.rb
Expand Up @@ -57,6 +57,17 @@ def logger
:working_dir => '/tmp',
:type => 'foss',
:dist => 'puppet-enterprise-3.7.1-rc0-78-gffc958f-eos-4-i386' } ) }
let(:el6hostaio) { make_host( 'el6hostaio', { :platform => Beaker::Platform.new('el-6-i386'),
:pe_ver => '3.0',
:working_dir => '/tmp',
:type => 'aio',
:dist => 'puppet-enterprise-3.1.0-rc0-230-g36c9e5c-centos-6-i386' } ) }
let(:el6hostfoss) { make_host( 'el6hostfoss', { :platform => Beaker::Platform.new('el-6-i386'),
:pe_ver => '3.0',
:working_dir => '/tmp',
:type => 'foss',
:dist => 'puppet-enterprise-3.1.0-rc0-230-g36c9e5c-centos-6-i386' } ) }

let(:win_temp) { 'C:\\Windows\\Temp' }


Expand Down Expand Up @@ -257,6 +268,20 @@ def logger
end
end

context 'install_puppet_from_rpm_on' do
it 'installs PC1 release repo when AIO' do
expect(subject).to receive(:install_puppetlabs_release_repo).with(el6hostaio,'pc1',{})

subject.install_puppet_from_rpm_on( el6hostaio, {} )
end

it 'installs non-PC1 package when not-AIO' do
expect(subject).to receive(:install_puppetlabs_release_repo).with(el6hostfoss,nil,{})

subject.install_puppet_from_rpm_on( el6hostfoss, {} )
end
end

context 'install_puppet_from_freebsd_ports_on' do
it 'installs puppet on FreeBSD 9' do
expect(freebsdhost9).to receive(:install_package).with('puppet')
Expand Down

0 comments on commit 688a1c8

Please sign in to comment.