Skip to content

Commit 95426e5

Browse files
author
Morgan Haskel
committed
Updates to mod::fcgid test don't work on RHEL5
1 parent 0b0a226 commit 95426e5

File tree

1 file changed

+46
-51
lines changed

1 file changed

+46
-51
lines changed

spec/acceptance/mod_fcgid_spec.rb

Lines changed: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,57 @@
11
require 'spec_helper_acceptance'
22

33
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',
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',
1724
},
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
4440

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
4945

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)
5550
end
51+
end
5652

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])
6055
end
6156
end
6257
end

0 commit comments

Comments
 (0)