1 require 'spec_helper_acceptance'
3 describe 'apache::mod::fcgid class', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) or (fact('operatingsystem') == 'OracleLinux' and fact('operatingsystemmajrelease') == '7')) do
4 context "default fcgid config", :if => (fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') != '5') do
5 it 'succeeds in puppeting fcgid' do
7 class { 'epel': } # mod_fcgid lives in epel
9 class { 'apache::mod::php': } # For /usr/bin/php-cgi
10 class { 'apache::mod::fcgid':
12 'FcgidIPCDir' => '/var/run/fcgidsock',
15 apache::vhost { 'fcgid.example.com':
17 docroot => '/var/www/fcgid',
19 path => '/var/www/fcgid',
20 options => '+ExecCGI',
22 handler => 'fcgid-script',
26 command => '/usr/bin/php-cgi',
31 file { '/var/www/fcgid/index.php':
35 content => "<?php echo 'Hello world'; ?>\\n",
38 apply_manifest(pp, :catch_failures => true)
41 describe service('httpd') do
42 it { is_expected.to be_enabled }
43 it { is_expected.to be_running }
46 it 'should answer to fcgid.example.com' do
47 shell("/usr/bin/curl -H 'Host: fcgid.example.com' 127.0.0.1:80") do |r|
48 expect(r.stdout).to match(/^Hello world$/)
49 expect(r.exit_code).to eq(0)
53 it 'should run a php-cgi process' do
54 shell("pgrep -u apache php-cgi", :acceptable_exit_codes => [0])