forked from CERIT-SC/puppet-yum
-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from traylenator/groups
New yum::groups parameter to manage groups
- Loading branch information
Showing
4 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'managing a yum::group' do | ||
context 'installing group RPM dev tools' do | ||
# Using puppet_apply as a helper | ||
it 'must work idempotently with no errors' do | ||
pp = <<-EOS | ||
yum::group { 'Development Tools': | ||
ensure => 'installed', | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
# On stupid 7 test package has to be leaf package | ||
# to be removed with a "groupremove". Can't find | ||
# a common package that works. | ||
case fact('os.release.major') | ||
when '7' | ||
describe package('libtool') do | ||
it { is_expected.to be_installed } | ||
end | ||
else | ||
describe package('make') do | ||
it { is_expected.to be_installed } | ||
end | ||
end | ||
end | ||
|
||
context 'removing group RPM dev tools' do | ||
# Using puppet_apply as a helper | ||
it 'must work idempotently with no errors' do | ||
pp = <<-EOS | ||
yum::group { 'Development Tools': | ||
ensure => 'absent', | ||
} | ||
EOS | ||
|
||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
case fact('os.release.major') | ||
when '7' | ||
describe package('libtool') do | ||
it { is_expected.not_to be_installed } | ||
end | ||
else | ||
describe package('make') do | ||
it { is_expected.not_to be_installed } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters