Mercurial > repos > other > Puppet
annotate modules/apache/spec/acceptance/mod_deflate_spec.rb @ 121:6709f2052217 puppet-3.6
Add eBay to Postscreen whitelist
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Fri, 02 Sep 2016 13:40:26 +0100 |
parents | 37675581a273 |
children | 675c1cc61eaf |
rev | line source |
---|---|
36
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 require 'spec_helper_acceptance' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 describe 'apache::mod::deflate class' do |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 case fact('osfamily') |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 when 'Debian' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 mod_dir = '/etc/apache2/mods-available' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 service_name = 'apache2' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 when 'RedHat' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 mod_dir = '/etc/httpd/conf.d' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 service_name = 'httpd' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 when 'FreeBSD' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 mod_dir = '/usr/local/etc/apache24/Modules' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 service_name = 'apache24' |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 end |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 context "default deflate config" do |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 it 'succeeds in puppeting deflate' do |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 pp= <<-EOS |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 class { 'apache': } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 include apache::mod::deflate |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 EOS |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 apply_manifest(pp, :catch_failures => true) |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 end |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 describe service(service_name) do |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 it { is_expected.to be_enabled } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 it { is_expected.to be_running } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 end |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 describe file("#{mod_dir}/deflate.conf") do |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 it { is_expected.to contain "AddOutputFilterByType DEFLATE text/html text/plain text/xml" } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 it { is_expected.to contain "AddOutputFilterByType DEFLATE text/css" } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 it { is_expected.to contain "AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript" } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 it { is_expected.to contain "AddOutputFilterByType DEFLATE application/rss+xml" } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 it { is_expected.to contain "DeflateFilterNote Input instream" } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 it { is_expected.to contain "DeflateFilterNote Output outstream" } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 it { is_expected.to contain "DeflateFilterNote Ratio ratio" } |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 end |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
39 end |
37675581a273
Update Puppet module for Apache (pulls in concat module)
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
40 end |