|
1 | 1 | require 'spec_helper_acceptance' |
2 | 2 |
|
3 | | -describe 'apache::mod::fcgid class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do |
4 | | - case fact('osfamily') |
5 | | - when 'Debian' |
6 | | - # Not implemented |
7 | | - when 'RedHat' |
8 | | - context "default fcgid config" do |
9 | | - it 'succeeds in puppeting fcgid' do |
10 | | - pp = <<-EOS |
11 | | - class { 'epel': } # mod_fcgid lives in epel |
12 | | - class { 'apache': } |
13 | | - class { 'apache::mod::php': } # For /usr/bin/php-cgi |
14 | | - class { 'apache::mod::fcgid': |
15 | | - options => { |
16 | | - 'FcgidIPCDir' => '/var/run/fcgidsock', |
| 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 |
| 6 | + pp = <<-EOS |
| 7 | + class { 'epel': } # mod_fcgid lives in epel |
| 8 | + class { 'apache': } |
| 9 | + class { 'apache::mod::php': } # For /usr/bin/php-cgi |
| 10 | + class { 'apache::mod::fcgid': |
| 11 | + options => { |
| 12 | + 'FcgidIPCDir' => '/var/run/fcgidsock', |
| 13 | + }, |
| 14 | + } |
| 15 | + apache::vhost { 'fcgid.example.com': |
| 16 | + port => '80', |
| 17 | + docroot => '/var/www/fcgid', |
| 18 | + directories => { |
| 19 | + path => '/var/www/fcgid', |
| 20 | + options => '+ExecCGI', |
| 21 | + addhandlers => { |
| 22 | + handler => 'fcgid-script', |
| 23 | + extensions => '.php', |
17 | 24 | }, |
18 | | - } |
19 | | - apache::vhost { 'fcgid.example.com': |
20 | | - port => '80', |
21 | | - docroot => '/var/www/fcgid', |
22 | | - directories => { |
23 | | - path => '/var/www/fcgid', |
24 | | - options => '+ExecCGI', |
25 | | - addhandlers => { |
26 | | - handler => 'fcgid-script', |
27 | | - extensions => '.php', |
28 | | - }, |
29 | | - fcgiwrapper => { |
30 | | - command => '/usr/bin/php-cgi', |
31 | | - suffix => '.php', |
32 | | - } |
33 | | - }, |
34 | | - } |
35 | | - file { '/var/www/fcgid/index.php': |
36 | | - ensure => file, |
37 | | - owner => 'root', |
38 | | - group => 'root', |
39 | | - content => "<?php echo 'Hello world'; ?>\\n", |
40 | | - } |
41 | | - EOS |
42 | | - apply_manifest(pp, :catch_failures => true) |
43 | | - end |
| 25 | + fcgiwrapper => { |
| 26 | + command => '/usr/bin/php-cgi', |
| 27 | + suffix => '.php', |
| 28 | + } |
| 29 | + }, |
| 30 | + } |
| 31 | + file { '/var/www/fcgid/index.php': |
| 32 | + ensure => file, |
| 33 | + owner => 'root', |
| 34 | + group => 'root', |
| 35 | + content => "<?php echo 'Hello world'; ?>\\n", |
| 36 | + } |
| 37 | + EOS |
| 38 | + apply_manifest(pp, :catch_failures => true) |
| 39 | + end |
44 | 40 |
|
45 | | - describe service('httpd') do |
46 | | - it { is_expected.to be_enabled } |
47 | | - it { is_expected.to be_running } |
48 | | - end |
| 41 | + describe service('httpd') do |
| 42 | + it { is_expected.to be_enabled } |
| 43 | + it { is_expected.to be_running } |
| 44 | + end |
49 | 45 |
|
50 | | - it 'should answer to fcgid.example.com' do |
51 | | - shell("/usr/bin/curl -H 'Host: fcgid.example.com' 127.0.0.1:80") do |r| |
52 | | - expect(r.stdout).to match(/^Hello world$/) |
53 | | - expect(r.exit_code).to eq(0) |
54 | | - end |
| 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) |
55 | 50 | end |
| 51 | + end |
56 | 52 |
|
57 | | - it 'should run a php-cgi process' do |
58 | | - shell("pgrep -u apache php-cgi", :acceptable_exit_codes => [0]) |
59 | | - end |
| 53 | + it 'should run a php-cgi process' do |
| 54 | + shell("pgrep -u apache php-cgi", :acceptable_exit_codes => [0]) |
60 | 55 | end |
61 | 56 | end |
62 | 57 | end |
0 commit comments