Skip to content

Commit

Permalink
Merge pull request #173 from MosesMendoza/MODULES-3953/master/accepta…
Browse files Browse the repository at this point in the history
…nce_for_manage_repo_param

(MODULES-3872) add acceptance test for manage_repo param
  • Loading branch information
highb authored Oct 11, 2016
2 parents 1d85b93 + 4bb954d commit a048349
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,45 @@ class { 'puppet_agent': }
is_expected.to_not match /parser[ ]*=[ ]*future/
}
end

describe 'manage_repo parameter' do
context 'when true (default)' do
it 'should create repo config' do
pp = "class { 'puppet_agent': }"
apply_manifest(pp, :catch_failures => true)
case default['platform']
when /debian|ubuntu/
pp = "include apt\napt::source { 'pc_repo': ensure => present, location => 'http://apt.puppetlabs.com', repos => 'PC1' }"
when /fedora|el|centos/
pp = "yumrepo { 'pc_repo': ensure => present }"
else
logger.notify("Cannot manage repo on #{default['platform']}, skipping test 'should create repo config'")
next
end
apply_manifest(pp, :catch_changes => true)
end
end

context 'when false' do
it 'should cease to manage repo config' do
pp = "class { 'puppet_agent': }"
apply_manifest(pp, :catch_failures => true)
case default['platform']
when /debian|ubuntu/
pp = "include apt\napt::source { 'pc_repo': ensure => absent }"
when /fedora|el|centos/
pp = "yumrepo { 'pc_repo': ensure => absent }"
else
logger.notify("Cannot manage repo on #{default['platform']}, skipping test 'should cease to manage repo config'")
next
end
apply_manifest(pp, :catch_failures => true)
pp = "class { 'puppet_agent': manage_repo => false }"
# expect no changes now that repo is unmanaged
apply_manifest(pp, :catch_changes => true)
end
end
end
end

context 'no services enabled on install' do
Expand Down

0 comments on commit a048349

Please sign in to comment.