Skip to content

Commit

Permalink
Merge pull request #726 from mhaskel/rhel5-fixes
Browse files Browse the repository at this point in the history
Fix failing tests on RHEL5.
  • Loading branch information
Ashley Penney committed May 13, 2014
2 parents fbf9678 + fc9e519 commit 862c481
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
11 changes: 8 additions & 3 deletions spec/acceptance/apache_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,17 @@ class { 'apache':
describe 'setup' do
it 'applies cleanly' do
pp = <<-EOS
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7' {
package { 'policycoreutils-python': ensure => installed }
if $::osfamily == 'RedHat' and $::selinux == 'true' {
$semanage_package = $::operatingsystemmajrelease ? {
'5' => 'policycoreutils',
'default' => 'policycoreutils-python',
}
package { $semanage_package: ensure => installed }
exec { 'set_apache_defaults':
command => 'semanage fcontext -a -t httpd_log_t "/apache_spec(/.*)?"',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
require => Package['policycoreutils-python'],
require => Package[$semanage_package],
}
exec { 'restorecon_apache':
command => 'restorecon -Rv /apache_spec',
Expand Down
11 changes: 8 additions & 3 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ class { 'apache': }
# Using puppet_apply as a helper
it 'should work with no errors' do
pp = <<-EOS
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7' {
package { 'policycoreutils-python': ensure => installed }
if $::osfamily == 'RedHat' and $::selinux == 'true' {
$semanage_package = $::operatingsystemmajrelease ? {
'5' => 'policycoreutils',
'default' => 'policycoreutils-python',
}
package { $semanage_package: ensure => installed }
exec { 'set_apache_defaults':
command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
require => Package['policycoreutils-python'],
require => Package[$semanage_package],
}
exec { 'restorecon_apache':
command => 'restorecon -Rv /apache_spec',
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/mod_passenger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class { 'apache::mod::passenger': }
end

when 'RedHat'
# no fedora 18 passenger package yet
unless (fact('operatingsystem') == 'Fedora' and fact('operatingsystemrelease').to_f >= 18)
# no fedora 18 passenger package yet, and rhel5 packages only exist for ruby 1.8.5
unless (fact('operatingsystem') == 'Fedora' and fact('operatingsystemrelease').to_f >= 18) or (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '5' and fact('rubyversion') != '1.8.5')

context "default passenger config" do
it 'succeeds in puppeting passenger' do
Expand Down
5 changes: 4 additions & 1 deletion spec/acceptance/mod_proxy_html_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
class { 'apache': }
class { 'apache::mod::proxy': }
class { 'apache::mod::proxy_http': }
class { 'apache::mod::proxy_html': }
# mod_proxy_html doesn't exist in RHEL5
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease != '5' {
class { 'apache::mod::proxy_html': }
}
EOS
apply_manifest(pp, :catch_failures => true)
end
Expand Down
11 changes: 8 additions & 3 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1041,13 +1041,18 @@ class { 'apache::mod::fastcgi': }
describe 'additional_includes' do
it 'applies cleanly' do
pp = <<-EOS
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7' {
if $::osfamily == 'RedHat' and $::selinux == 'true' {
exec { 'set_apache_defaults':
command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
require => Package['policycoreutils-python'],
require => Package[$semanage_package],
}
package { 'policycoreutils-python': ensure => installed }
$semanage_package = $::operatingsystemmajrelease ? {
'5' => 'policycoreutils',
'default' => 'policycoreutils-python',
}
package { $semanage_package: ensure => installed }
exec { 'restorecon_apache':
command => 'restorecon -Rv /apache_spec',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
Expand Down

0 comments on commit 862c481

Please sign in to comment.