forked from puppetlabs/puppetlabs-apache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbalancer_spec.rb
72 lines (70 loc) · 2.04 KB
/
balancer_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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require 'spec_helper'
describe 'apache::balancer', :type => :define do
let :title do
'myapp'
end
let :facts do
{
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6',
:lsbdistcodename => 'squeeze',
:id => 'root',
:concat_basedir => '/dne',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:kernel => 'Linux',
:is_pe => false,
}
end
describe 'apache pre_condition with defaults' do
let :pre_condition do
'include apache'
end
describe "accept a target parameter and use it" do
let :params do
{
:target => '/tmp/myapp.conf'
}
end
it { should contain_concat('apache_balancer_myapp').with({
:path => "/tmp/myapp.conf",
})}
it { should_not contain_apache__mod('slotmem_shm') }
it { should_not contain_apache__mod('lbmethod_byrequests') }
end
context "on jessie" do
let(:facts) { super().merge({
:operatingsystemrelease => '8',
:lsbdistcodename => 'jessie',
}) }
it { should contain_apache__mod('slotmem_shm') }
it { should contain_apache__mod('lbmethod_byrequests') }
end
end
describe 'apache pre_condition with conf_dir set' do
let :pre_condition do
'class{"apache":
confd_dir => "/junk/path"
}'
end
it { should contain_concat('apache_balancer_myapp').with({
:path => "/junk/path/balancer_myapp.conf",
})}
end
describe 'with lbmethod and with apache::mod::proxy_balancer::apache_version set' do
let :pre_condition do
'class{"apache::mod::proxy_balancer":
apache_version => "2.4"
}'
end
let :params do
{
:proxy_set => {
'lbmethod' => 'bytraffic',
},
}
end
it { should contain_apache__mod('slotmem_shm') }
it { should contain_apache__mod('lbmethod_bytraffic') }
end
end