1 require 'spec_helper_acceptance'
3 describe 'apache::mod::suphp class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
4 case fact('operatingsystem')
6 context "default suphp config" do
7 it 'succeeds in puppeting suphp' do
10 mpm_module => 'prefork',
12 host { 'suphp.example.com': ip => '127.0.0.1', }
13 apache::vhost { 'suphp.example.com':
15 docroot => '/var/www/suphp',
17 file { '/var/www/suphp/index.php':
21 content => "<?php echo get_current_user(); ?>\\n",
22 require => File['/var/www/suphp'],
23 before => Class['apache::mod::php'],
25 class { 'apache::mod::php': }
26 class { 'apache::mod::suphp': }
28 apply_manifest(pp, :catch_failures => true)
31 describe service('apache2') do
32 it { is_expected.to be_enabled }
33 it { is_expected.to be_running }
36 it 'should answer to suphp.example.com' do
39 r = shell('curl suphp.example.com:80')
41 break if r.stdout =~ /^daemon$/
43 expect(timeout < 40).to be true
48 shell("/usr/bin/curl suphp.example.com:80") do |r|
49 expect(r.stdout).to match(/^daemon$/)
50 expect(r.exit_code).to eq(0)