Mercurial > repos > other > Puppet
comparison modules/apache/spec/acceptance/prefork_worker_spec.rb @ 257:675c1cc61eaf
Update Apache module to get CentOS 8 support
Unfortunately it only fixes some bits. mod_wsgi still needs
other approaches
This also overrides the vhost modification to make them come last
in the import order (after module loading)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 22 Dec 2019 14:43:29 -0500 |
parents | 37675581a273 |
children | d9352a684e62 |
comparison
equal
deleted
inserted
replaced
252:47750947f4dc | 257:675c1cc61eaf |
---|---|
1 require 'spec_helper_acceptance' | 1 require 'spec_helper_acceptance' |
2 | 2 require_relative './version.rb' |
3 case fact('osfamily') | |
4 when 'RedHat' | |
5 servicename = 'httpd' | |
6 when 'Debian' | |
7 servicename = 'apache2' | |
8 when 'FreeBSD' | |
9 servicename = 'apache24' | |
10 end | |
11 | 3 |
12 case fact('osfamily') | 4 case fact('osfamily') |
13 when 'FreeBSD' | 5 when 'FreeBSD' |
14 describe 'apache::mod::event class' do | 6 describe 'apache::mod::event class' do |
15 describe 'running puppet code' do | 7 describe 'running puppet code' do |
25 apply_manifest(pp, :catch_failures => true) | 17 apply_manifest(pp, :catch_failures => true) |
26 expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero | 18 expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero |
27 end | 19 end |
28 end | 20 end |
29 | 21 |
30 describe service(servicename) do | 22 describe service($service_name) do |
31 it { is_expected.to be_running } | 23 it { is_expected.to be_running } |
32 it { is_expected.to be_enabled } | 24 if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') |
25 pending 'Should be enabled - Bug 760616 on Debian 8' | |
26 else | |
27 it { should be_enabled } | |
28 end | |
33 end | 29 end |
34 end | 30 end |
35 end | 31 end |
36 | 32 |
37 describe 'apache::mod::worker class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | 33 describe 'apache::mod::worker class' do |
38 describe 'running puppet code' do | 34 describe 'running puppet code' do |
39 # Using puppet_apply as a helper | 35 # Using puppet_apply as a helper |
40 it 'should work with no errors' do | 36 let(:pp) do |
41 pp = <<-EOS | 37 <<-EOS |
42 class { 'apache': | 38 class { 'apache': |
43 mpm_module => 'worker', | 39 mpm_module => 'worker', |
44 } | 40 } |
45 EOS | 41 EOS |
42 end | |
46 | 43 |
47 # Run it twice and test for idempotency | 44 # Run it twice and test for idempotency |
48 apply_manifest(pp, :catch_failures => true) | 45 it_behaves_like "a idempotent resource" |
49 expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero | |
50 end | |
51 end | 46 end |
52 | 47 |
53 describe service(servicename) do | 48 describe service($service_name) do |
54 it { is_expected.to be_running } | 49 it { is_expected.to be_running } |
55 it { is_expected.to be_enabled } | 50 if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') |
51 pending 'Should be enabled - Bug 760616 on Debian 8' | |
52 else | |
53 it { should be_enabled } | |
54 end | |
56 end | 55 end |
57 end | 56 end |
58 | 57 |
59 describe 'apache::mod::prefork class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do | 58 describe 'apache::mod::prefork class' do |
60 describe 'running puppet code' do | 59 describe 'running puppet code' do |
61 # Using puppet_apply as a helper | 60 # Using puppet_apply as a helper |
62 it 'should work with no errors' do | 61 let(:pp) do |
63 pp = <<-EOS | 62 <<-EOS |
64 class { 'apache': | 63 class { 'apache': |
65 mpm_module => 'prefork', | 64 mpm_module => 'prefork', |
66 } | 65 } |
67 EOS | 66 EOS |
67 end | |
68 # Run it twice and test for idempotency | |
69 it_behaves_like "a idempotent resource" | |
70 end | |
68 | 71 |
69 # Run it twice and test for idempotency | 72 describe service($service_name) do |
70 apply_manifest(pp, :catch_failures => true) | 73 it { is_expected.to be_running } |
71 expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero | 74 if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8') |
75 pending 'Should be enabled - Bug 760616 on Debian 8' | |
76 else | |
77 it { should be_enabled } | |
72 end | 78 end |
73 end | 79 end |
74 | |
75 describe service(servicename) do | |
76 it { is_expected.to be_running } | |
77 it { is_expected.to be_enabled } | |
78 end | |
79 end | 80 end |