forked from puppetlabs/puppetlabs-apache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod_spec.rb
166 lines (155 loc) · 5.18 KB
/
mod_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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
require 'spec_helper'
describe 'apache::mod', :type => :define do
let :pre_condition do
'include apache'
end
context "on a RedHat osfamily" do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '6',
:concat_basedir => '/dne',
:operatingsystem => 'RedHat',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:is_pe => false,
}
end
describe "for non-special modules" do
let :title do
'spec_m'
end
it { is_expected.to contain_class("apache::params") }
it "should manage the module load file" do
is_expected.to contain_file('spec_m.load').with({
:path => '/etc/httpd/conf.d/spec_m.load',
:content => "LoadModule spec_m_module modules/mod_spec_m.so\n",
:owner => 'root',
:group => 'root',
:mode => '0644',
} )
end
end
describe "with file_mode set" do
let :pre_condition do
"class {'::apache': file_mode => '0640'}"
end
let :title do
'spec_m'
end
it "should manage the module load file" do
is_expected.to contain_file('spec_m.load').with({
:mode => '0640',
} )
end
end
describe "with shibboleth module and package param passed" do
# name/title for the apache::mod define
let :title do
'xsendfile'
end
# parameters
let(:params) { {:package => 'mod_xsendfile'} }
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_package('mod_xsendfile') }
end
end
context "on a Debian osfamily" do
let :facts do
{
:osfamily => 'Debian',
:operatingsystemrelease => '6',
:concat_basedir => '/dne',
:lsbdistcodename => 'squeeze',
:operatingsystem => 'Debian',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:is_pe => false,
}
end
describe "for non-special modules" do
let :title do
'spec_m'
end
it { is_expected.to contain_class("apache::params") }
it "should manage the module load file" do
is_expected.to contain_file('spec_m.load').with({
:path => '/etc/apache2/mods-available/spec_m.load',
:content => "LoadModule spec_m_module /usr/lib/apache2/modules/mod_spec_m.so\n",
:owner => 'root',
:group => 'root',
:mode => '0644',
} )
end
it "should link the module load file" do
is_expected.to contain_file('spec_m.load symlink').with({
:path => '/etc/apache2/mods-enabled/spec_m.load',
:target => '/etc/apache2/mods-available/spec_m.load',
:owner => 'root',
:group => 'root',
:mode => '0644',
} )
end
end
end
context "on a FreeBSD osfamily" do
let :facts do
{
:osfamily => 'FreeBSD',
:operatingsystemrelease => '9',
:concat_basedir => '/dne',
:operatingsystem => 'FreeBSD',
:id => 'root',
:kernel => 'FreeBSD',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:is_pe => false,
}
end
describe "for non-special modules" do
let :title do
'spec_m'
end
it { is_expected.to contain_class("apache::params") }
it "should manage the module load file" do
is_expected.to contain_file('spec_m.load').with({
:path => '/usr/local/etc/apache24/Modules/spec_m.load',
:content => "LoadModule spec_m_module /usr/local/libexec/apache24/mod_spec_m.so\n",
:owner => 'root',
:group => 'wheel',
:mode => '0644',
} )
end
end
end
context "on a Gentoo osfamily" do
let :facts do
{
:osfamily => 'Gentoo',
:operatingsystem => 'Gentoo',
:operatingsystemrelease => '3.16.1-gentoo',
:concat_basedir => '/dne',
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin',
:is_pe => false,
}
end
describe "for non-special modules" do
let :title do
'spec_m'
end
it { is_expected.to contain_class("apache::params") }
it "should manage the module load file" do
is_expected.to contain_file('spec_m.load').with({
:path => '/etc/apache2/modules.d/spec_m.load',
:content => "LoadModule spec_m_module /usr/lib/apache2/modules/mod_spec_m.so\n",
:owner => 'root',
:group => 'wheel',
:mode => '0644',
} )
end
end
end
end