Showing with 78 additions and 10 deletions.
  1. +8 −0 CHANGELOG.md
  2. +1 −1 CODEOWNERS
  3. +3 −2 Gemfile
  4. +1 −1 lib/puppet/type/yumrepo.rb
  5. +1 −1 metadata.json
  6. +60 −0 spec/acceptance/tests/yumrepo_spec.rb
  7. +4 −5 spec/spec_helper_acceptance.rb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [1.0.6](https://github.com/puppetlabs/puppetlabs-yumrepo_core/tree/1.0.6) (2019-12-19)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.5...1.0.6)

### Fixed

- \(MODULES-10357\) Fix `proxy =\> absent` [\#24](https://github.com/puppetlabs/puppetlabs-yumrepo_core/pull/24) ([alexjfisher](https://github.com/alexjfisher))

## [1.0.5](https://github.com/puppetlabs/puppetlabs-yumrepo_core/tree/1.0.5) (2019-12-18)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.4...1.0.5)
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @puppetlabs/team-coremunity
* @puppetlabs/night-s-watch
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.34')
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.0')
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~>1.0')
gem "beaker-vmpooler", *location_for(ENV['BEAKER_VMPOOLER_VERSION'] || '~> 1.3')
gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.5')
gem "beaker-pe", require: false
gem "beaker-hostgenerator"
gem "beaker-rspec"
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || '~> 0.14')
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/yumrepo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@

munge do |value|
return '' if Facter.value(:operatingsystemmajrelease).to_i >= 8 && value.to_s == '_none_'
value.to_s
super(value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-yumrepo_core",
"version": "1.0.5",
"version": "1.0.6",
"author": "puppetlabs",
"summary": "Manage client yum repo configurations by parsing yum INI configuration files.",
"license": "Apache-2.0",
Expand Down
60 changes: 60 additions & 0 deletions spec/acceptance/tests/yumrepo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,65 @@ def resource(host, type, name)
assert_match(res['descr'], 'Puppet Labs Products El 7 - $basearch')
end
end

describe '`proxy` property' do
context 'when set to a URL' do
it 'applies idempotently' do
pp = <<-MANIFEST
yumrepo {'proxied-repo':
baseurl => 'http://myownmirror',
proxy => 'http://proxy.example.com:3128',
}
MANIFEST

apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe file('/etc/yum.repos.d/proxied-repo.repo') do
its(:content) { is_expected.to contain('proxy=http://proxy.example.com:3128') }
end
end
context 'when set to `absent`' do
it 'applies idempotently' do
pp = <<-MANIFEST
yumrepo {'proxied-repo':
baseurl => 'http://myownmirror',
proxy => absent,
}
MANIFEST

apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe file('/etc/yum.repos.d/proxied-repo.repo') do
its(:content) { is_expected.not_to contain('proxy') }
end
end
context 'when set to `_none_`' do
it 'applies idempotently' do
pp = <<-MANIFEST
yumrepo {'proxied-repo':
baseurl => 'http://myownmirror',
proxy => '_none_',
}
MANIFEST

apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

if fact('os.release.major').to_i >= 8
describe file('/etc/yum.repos.d/proxied-repo.repo') do
its(:content) { is_expected.to match(%r{^proxy=$}) }
end
else
describe file('/etc/yum.repos.d/proxied-repo.repo') do
its(:content) { is_expected.to match(%r{^proxy=_none_$}) }
end
end
end
end
end
end
9 changes: 4 additions & 5 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

$LOAD_PATH << File.join(__dir__, 'acceptance/lib')

run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'

RSpec.configure do |c|
c.before :suite do
unless ENV['BEAKER_provision'] == 'no'
run_puppet_install_helper
install_module_on(hosts)
install_module_dependencies_on(hosts)
end
install_module
install_module_dependencies
end
end