Skip to content

Commit

Permalink
Resolve test failures on apache.
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Haskel committed May 22, 2014
1 parent cc7e927 commit 6a60fe4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
17 changes: 10 additions & 7 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ class { 'apache': }
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[$semanage_package],
command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
subscribe => Package[$semanage_package],
refreshonly => true,
}
exec { 'restorecon_apache':
command => 'restorecon -Rv /apache_spec',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
before => Service['httpd'],
require => Class['apache'],
command => 'restorecon -Rv /apache_spec',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
before => Service['httpd'],
require => Class['apache'],
subscribe => Exec['set_apache_defaults'],
refreshonly => true,
}
}
file { '/apache_spec': ensure => directory, }
Expand Down
10 changes: 5 additions & 5 deletions spec/acceptance/mod_passenger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class { 'apache::mod::passenger': }
end

it 'should output status via passenger-memory-stats' do
shell("sudo /usr/sbin/passenger-memory-stats") do |r|
shell("/usr/sbin/passenger-memory-stats") do |r|
r.stdout.should =~ /Apache processes/
r.stdout.should =~ /Nginx processes/
r.stdout.should =~ /Passenger processes/
Expand All @@ -97,7 +97,7 @@ class { 'apache::mod::passenger': }
unless fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '12.04'
it 'should output status via passenger-status' do
# xml output not available on ubunutu <= 10.04, so sticking with default pool output
shell("sudo /usr/sbin/passenger-status") do |r|
shell("/usr/sbin/passenger-status") do |r|
# spacing may vary
r.stdout.should =~ /[\-]+ General information [\-]+/
if fact('operatingsystem') == 'Ubuntu' && fact('operatingsystemrelease') == '14.04'
Expand Down Expand Up @@ -136,7 +136,7 @@ class { 'apache::mod::passenger': }
/* EPEL and passenger repositories */
class { 'epel': }
exec { 'passenger.repo GPG key':
command => '/usr/bin/sudo /usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
}
file { 'passenger.repo GPG key':
Expand Down Expand Up @@ -194,7 +194,7 @@ class { 'apache::mod::passenger':
end

it 'should output status via passenger-memory-stats' do
shell("sudo /usr/bin/passenger-memory-stats") do |r|
shell("/usr/bin/passenger-memory-stats") do |r|
r.stdout.should =~ /Apache processes/
r.stdout.should =~ /Nginx processes/
r.stdout.should =~ /Passenger processes/
Expand All @@ -206,7 +206,7 @@ class { 'apache::mod::passenger':
end

it 'should output status via passenger-status' do
shell("sudo PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r|
shell("PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status") do |r|
# spacing may vary
r.stdout.should =~ /[\-]+ General information [\-]+/
r.stdout.should =~ /max[ ]+= [0-9]+/
Expand Down
9 changes: 4 additions & 5 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1042,16 +1042,15 @@ class { 'apache::mod::fastcgi': }
it 'applies cleanly' do
pp = <<-EOS
if $::osfamily == 'RedHat' and $::selinux == 'true' {
$semanage_package = $::operatingsystemmajrelease ? {
'5' => 'policycoreutils',
default => 'policycoreutils-python',
}
exec { 'set_apache_defaults':
command => 'semanage fcontext -a -t httpd_sys_content_t "/apache_spec(/.*)?"',
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
require => Package[$semanage_package],
}
$semanage_package = $::operatingsystemmajrelease ? {
'5' => 'policycoreutils',
default => 'policycoreutils-python',
}
package { $semanage_package: ensure => installed }
exec { 'restorecon_apache':
command => 'restorecon -Rv /apache_spec',
Expand Down

0 comments on commit 6a60fe4

Please sign in to comment.