|
2275 | 2275 | it { is_expected.to compile } |
2276 | 2276 | it { is_expected.to contain_class('apache::mod::autoindex') } |
2277 | 2277 | end |
| 2278 | + |
| 2279 | + context 'mod_cgi is included when requested by array' do |
| 2280 | + let :params do |
| 2281 | + { |
| 2282 | + 'docroot' => '/var/www/foo', |
| 2283 | + 'directories' => [ |
| 2284 | + { |
| 2285 | + 'options' => ['ExecCGI'], |
| 2286 | + }, |
| 2287 | + ] |
| 2288 | + |
| 2289 | + } |
| 2290 | + end |
| 2291 | + |
| 2292 | + it { is_expected.to compile } |
| 2293 | + if os_facts[:os]['family'] == 'Debian' |
| 2294 | + it { is_expected.not_to contain_class('apache::mod::cgi') } |
| 2295 | + it { is_expected.to contain_class('apache::mod::cgid') } |
| 2296 | + else |
| 2297 | + it { is_expected.to contain_class('apache::mod::cgi') } |
| 2298 | + it { is_expected.not_to contain_class('apache::mod::cgid') } |
| 2299 | + end |
| 2300 | + end |
| 2301 | + |
| 2302 | + context 'mod_cgi is included when requested by string' do |
| 2303 | + let :params do |
| 2304 | + { |
| 2305 | + 'docroot' => '/var/www/foo', |
| 2306 | + 'directories' => [ |
| 2307 | + { |
| 2308 | + 'options' => 'Indexes ExecCGI', |
| 2309 | + }, |
| 2310 | + ] |
| 2311 | + |
| 2312 | + } |
| 2313 | + end |
| 2314 | + |
| 2315 | + it { is_expected.to compile } |
| 2316 | + if os_facts[:os]['family'] == 'Debian' |
| 2317 | + it { is_expected.not_to contain_class('apache::mod::cgi') } |
| 2318 | + it { is_expected.to contain_class('apache::mod::cgid') } |
| 2319 | + else |
| 2320 | + it { is_expected.to contain_class('apache::mod::cgi') } |
| 2321 | + it { is_expected.not_to contain_class('apache::mod::cgid') } |
| 2322 | + end |
| 2323 | + end |
| 2324 | + |
| 2325 | + context 'mod_cgi is not included when unrequested' do |
| 2326 | + let :params do |
| 2327 | + { |
| 2328 | + 'docroot' => '/var/www/foo', |
| 2329 | + 'directories' => [ |
| 2330 | + { |
| 2331 | + 'options' => '+Indexes -ExecCGI', |
| 2332 | + }, |
| 2333 | + ] |
| 2334 | + |
| 2335 | + } |
| 2336 | + end |
| 2337 | + |
| 2338 | + it { is_expected.to compile } |
| 2339 | + it { is_expected.not_to contain_class('apache::mod::cgi') } |
| 2340 | + it { is_expected.not_to contain_class('apache::mod::cgid') } |
| 2341 | + end |
2278 | 2342 | end |
2279 | 2343 | end |
2280 | 2344 | end |
|
0 commit comments