Skip to content

Commit

Permalink
Merge pull request #1031 from cyberious/SuPhp
Browse files Browse the repository at this point in the history
SuPHP acceptance fixes?, chasing the test bug that is timing
  • Loading branch information
Morgan Haskel committed Feb 18, 2015
2 parents 095ed1c + 3a702ec commit cd4b1aa
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions spec/acceptance/mod_suphp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

describe 'apache::mod::suphp class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
case fact('osfamily')
when 'Debian'
context "default suphp config" do
it 'succeeds in puppeting suphp' do
pp = <<-EOS
when 'Debian'
context "default suphp config" do
it 'succeeds in puppeting suphp' do
pp = <<-EOS
class { 'apache':
mpm_module => 'prefork',
}
Expand All @@ -22,24 +22,28 @@ class { 'apache::mod::suphp': }
group => 'daemon',
content => "<?php echo get_current_user(); ?>\\n",
}
EOS
apply_manifest(pp, :catch_failures => true)
end
EOS
apply_manifest(pp, :catch_failures => true)
end

describe service('apache2') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
describe service('apache2') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

it 'should answer to suphp.example.com' do
shell("/bin/sleep 10")
shell("/usr/bin/curl suphp.example.com:80") do |r|
expect(r.stdout).to match(/^daemon$/)
expect(r.exit_code).to eq(0)
it 'should answer to suphp.example.com' do
timeout = 0
loop do
r = shell('curl suphp.example.com:80')
timeout += 1
break if timeout > 20 || r.stdout =~ /^daemon$/
sleep(1)
end
shell("/usr/bin/curl suphp.example.com:80") do |r|
expect(r.stdout).to match(/^daemon$/)
expect(r.exit_code).to eq(0)
end
end
end
end
when 'RedHat'
# Not implemented yet
end
end

0 comments on commit cd4b1aa

Please sign in to comment.