forked from puppetlabs/puppetlabs-apache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_suphp_spec.rb
44 lines (41 loc) · 1.26 KB
/
mod_suphp_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'spec_helper_acceptance'
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
class { 'apache':
mpm_module => 'prefork',
}
class { 'apache::mod::php': }
class { 'apache::mod::suphp': }
apache::vhost { 'suphp.example.com':
port => '80',
docroot => '/var/www/suphp',
}
host { 'suphp.example.com': ip => '127.0.0.1', }
file { '/var/www/suphp/index.php':
ensure => file,
owner => 'daemon',
group => 'daemon',
content => "<?php echo get_current_user(); ?>\\n",
}
EOS
apply_manifest(pp, :catch_failures => true)
end
describe service('apache2') do
it { should be_enabled }
it { should be_running }
end
it 'should answer to suphp.example.com' do
shell("/usr/bin/curl suphp.example.com:80") do |r|
r.stdout.should =~ /^daemon$/
r.exit_code.should == 0
end
end
end
when 'RedHat'
# Not implemented yet
end
end