1 # This function is called inside the OS specific contexts
2 def general_info_specs_22
3 it { is_expected.to contain_apache__mod('info') }
5 context 'passing no parameters' do
7 is_expected.to contain_file('info.conf').with_content(
8 "<Location /server-info>\n"\
9 " SetHandler server-info\n"\
10 " Order deny,allow\n"\
12 " Allow from 127.0.0.1\n"\
18 context 'passing restrict_access => false' do
20 :restrict_access => false
24 is_expected.to contain_file('info.conf').with_content(
25 "<Location /server-info>\n"\
26 " SetHandler server-info\n"\
31 context "passing allow_from => ['10.10.1.2', '192.168.1.2', '127.0.0.1']" do
33 {:allow_from => ['10.10.1.2', '192.168.1.2', '127.0.0.1']}
36 is_expected.to contain_file('info.conf').with_content(
37 "<Location /server-info>\n"\
38 " SetHandler server-info\n"\
39 " Order deny,allow\n"\
41 " Allow from 10.10.1.2\n"\
42 " Allow from 192.168.1.2\n"\
43 " Allow from 127.0.0.1\n"\
48 context 'passing both restrict_access and allow_from' do
51 :restrict_access => false,
52 :allow_from => ['10.10.1.2', '192.168.1.2', '127.0.0.1']
56 is_expected.to contain_file('info.conf').with_content(
57 "<Location /server-info>\n"\
58 " SetHandler server-info\n"\
65 def general_info_specs_24
66 it { is_expected.to contain_apache__mod('info') }
68 context 'passing no parameters' do
70 is_expected.to contain_file('info.conf').with_content(
71 "<Location /server-info>\n"\
72 " SetHandler server-info\n"\
73 " Require ip 127.0.0.1 ::1\n"\
78 context 'passing restrict_access => false' do
80 :restrict_access => false
84 is_expected.to contain_file('info.conf').with_content(
85 "<Location /server-info>\n"\
86 " SetHandler server-info\n"\
91 context "passing allow_from => ['10.10.1.2', '192.168.1.2', '127.0.0.1']" do
93 {:allow_from => ['10.10.1.2', '192.168.1.2', '127.0.0.1']}
96 is_expected.to contain_file('info.conf').with_content(
97 "<Location /server-info>\n"\
98 " SetHandler server-info\n"\
99 " Require ip 10.10.1.2 192.168.1.2 127.0.0.1\n"\
104 context 'passing both restrict_access and allow_from' do
107 :restrict_access => false,
108 :allow_from => ['10.10.1.2', '192.168.1.2', '127.0.0.1']
112 is_expected.to contain_file('info.conf').with_content(
113 "<Location /server-info>\n"\
114 " SetHandler server-info\n"\
121 describe 'apache::mod::info', :type => :class do
122 let :pre_condition do
123 "class { 'apache': default_mods => false, }"
126 context 'On a Debian OS' do
129 :osfamily => 'Debian',
130 :operatingsystemrelease => '6',
131 :concat_basedir => '/dne',
132 :lsbdistcodename => 'squeeze',
133 :operatingsystem => 'Debian',
136 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
141 # Load the more generic tests for this context
142 general_info_specs_22()
144 it { is_expected.to contain_file('info.conf').with({
146 :path => '/etc/apache2/mods-available/info.conf',
148 it { is_expected.to contain_file('info.conf symlink').with({
150 :path => '/etc/apache2/mods-enabled/info.conf',
154 context 'on a RedHat OS' do
157 :osfamily => 'RedHat',
158 :operatingsystemrelease => '6',
159 :concat_basedir => '/dne',
160 :operatingsystem => 'RedHat',
163 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
168 # Load the more generic tests for this context
169 general_info_specs_22()
171 it { is_expected.to contain_file('info.conf').with({
173 :path => '/etc/httpd/conf.d/info.conf',
177 context 'on a FreeBSD OS' do
180 :osfamily => 'FreeBSD',
181 :operatingsystemrelease => '10',
182 :concat_basedir => '/dne',
183 :operatingsystem => 'FreeBSD',
185 :kernel => 'FreeBSD',
186 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
191 # Load the more generic tests for this context
192 general_info_specs_24()
194 it { is_expected.to contain_file('info.conf').with({
196 :path => '/usr/local/etc/apache24/Modules/info.conf',
200 context 'on a Gentoo OS' do
203 :osfamily => 'Gentoo',
204 :operatingsystem => 'Gentoo',
205 :operatingsystemrelease => '3.16.1-gentoo',
206 :concat_basedir => '/dne',
209 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin',
214 # Load the more generic tests for this context
215 general_info_specs_24()
217 it { is_expected.to contain_file('info.conf').with({
219 :path => '/etc/apache2/modules.d/info.conf',