Skip to content

Commit 88d281c

Browse files
authored
Merge pull request #2243 from ekohl/fix-epel-in-acceptance
Acceptance tests: correct EPEL usage
2 parents dd36951 + f8c9449 commit 88d281c

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

spec/acceptance/mod_authnz_ldap_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
# We need to restrict this test to RHEL 7.x, 8.x derived OSs as there are too many unique
77
# dependency issues to solve on all supported platforms.
88
describe 'apache::mod::authnz_ldap', if: mod_supported_on_platform?('apache::mod::authnz_ldap') do
9-
before(:each) do
10-
if os[:family] == 'redhat'
11-
run_shell('yum clean all') # To clear some issues when configuring EPEL / Optional repos
12-
run_shell('dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y') if os[:release].to_i == 8
13-
end
14-
end
159
context 'Default mod_authnz_ldap module installation' do
1610
pp = if run_shell("grep 'Oracle Linux Server' /etc/os-release", expect_failures: true).exit_status == 0
1711
<<-MANIFEST
@@ -27,9 +21,6 @@ class { 'apache::mod::authnz_ldap': }
2721
MANIFEST
2822
else
2923
<<-MANIFEST
30-
package { 'epel-release':
31-
ensure => present,
32-
}
3324
class { 'apache': }
3425
class { 'apache::mod::authnz_ldap': }
3526
MANIFEST

spec/spec_helper_acceptance_local.rb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,18 @@ def print_parsing_errors
3333
c.filter_run_excluding ipv6: true
3434
end
3535
c.before :suite do
36-
# Make sure selinux is disabled so the tests work.
37-
LitmusHelper.instance.run_shell('setenforce 0', expect_failures: true) if %r{redhat|oracle}.match?(os[:family])
36+
if %r{redhat|oracle}.match?(os[:family])
37+
# Make sure selinux is disabled so the tests work.
38+
LitmusHelper.instance.run_shell('setenforce 0', expect_failures: true)
39+
40+
# Version 4.0.0 drops EL6 support
41+
if os[:release].to_i <= 6
42+
LitmusHelper.instance.run_shell('puppet module install --version 3.1.0 puppet/epel')
43+
else
44+
LitmusHelper.instance.run_shell('puppet module install puppet/epel')
45+
end
46+
end
3847

39-
LitmusHelper.instance.run_shell('puppet module install stahnma/epel')
4048
pp = <<-PUPPETCODE
4149
# needed by tests
4250
package { 'curl':
@@ -49,17 +57,12 @@ def print_parsing_errors
4957
}
5058
}
5159
if $::osfamily == 'RedHat' {
60+
# EPEL < 7 is EOL and removed from the official mirror network
5261
if $::operatingsystemmajrelease == '5' or $::operatingsystemmajrelease == '6'{
5362
class { 'epel':
5463
epel_baseurl => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
5564
epel_mirrorlist => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
5665
}
57-
} elsif $::operatingsystemmajrelease == '8' {
58-
class { 'epel':
59-
os_maj_release => "7",
60-
epel_baseurl => "http://osmirror.delivery.puppetlabs.net/epel7-\\$basearch/RPMS.all",
61-
epel_mirrorlist => "http://osmirror.delivery.puppetlabs.net/epel7-\\$basearch/RPMS.all",
62-
}
6366
} else {
6467
class { 'epel': }
6568
}

0 commit comments

Comments
 (0)