]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/spec/acceptance/prefork_worker_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / apache / spec / acceptance / prefork_worker_spec.rb
1 require 'spec_helper_acceptance'
2
3 case fact('osfamily')
4 when 'RedHat'
5   servicename = 'httpd'
6 when 'Debian'
7   servicename = 'apache2'
8 when 'FreeBSD'
9   servicename = 'apache24'
10 when 'Gentoo'
11   servicename = 'apache2'
12 end
13
14 case fact('osfamily')
15 when 'FreeBSD'
16   describe 'apache::mod::event class' do
17     describe 'running puppet code' do
18       # Using puppet_apply as a helper
19       it 'should work with no errors' do
20         pp = <<-EOS
21           class { 'apache':
22             mpm_module => 'event',
23           }
24         EOS
25
26         # Run it twice and test for idempotency
27         apply_manifest(pp, :catch_failures => true)
28         expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
29       end
30     end
31
32     describe service(servicename) do
33       it { is_expected.to be_running }
34       it { is_expected.to be_enabled }
35     end
36   end
37 end
38
39 describe 'apache::mod::worker class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
40   describe 'running puppet code' do
41     # Using puppet_apply as a helper
42     it 'should work with no errors' do
43       pp = <<-EOS
44         class { 'apache':
45           mpm_module => 'worker',
46         }
47       EOS
48
49       # Run it twice and test for idempotency
50       apply_manifest(pp, :catch_failures => true)
51       expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
52     end
53   end
54
55   describe service(servicename) do
56     it { is_expected.to be_running }
57     it { is_expected.to be_enabled }
58   end
59 end
60
61 describe 'apache::mod::prefork class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
62   describe 'running puppet code' do
63     # Using puppet_apply as a helper
64     it 'should work with no errors' do
65       pp = <<-EOS
66         class { 'apache':
67           mpm_module => 'prefork',
68         }
69       EOS
70
71       # Run it twice and test for idempotency
72       apply_manifest(pp, :catch_failures => true)
73       expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
74     end
75   end
76
77   describe service(servicename) do
78     it { is_expected.to be_running }
79     it { is_expected.to be_enabled }
80   end
81 end