forked from puppetlabs/puppetlabs-apache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodsec_link_spec.rb
53 lines (48 loc) · 1.75 KB
/
modsec_link_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
require 'spec_helper'
describe 'apache::security::rule_link', :type => :define do
let :pre_condition do
'class { "apache": }
class { "apache::mod::security": activated_rules => [] }
'
end
let :title do
'base_rules/modsecurity_35_bad_robots.data'
end
context "on RedHat based systems" do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemrelease => '7',
:kernel => 'Linux',
:id => 'root',
:concat_basedir => '/',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:is_pe => false,
}
end
it { should contain_file('modsecurity_35_bad_robots.data').with(
:path => '/etc/httpd/modsecurity.d/activated_rules/modsecurity_35_bad_robots.data',
:target => '/usr/lib/modsecurity.d/base_rules/modsecurity_35_bad_robots.data'
) }
end
context "on Debian based systems" do
let :facts do
{
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6',
:concat_basedir => '/',
:lsbdistcodename => 'squeeze',
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:kernel => 'Linux',
:is_pe => false,
}
end
it { should contain_file('modsecurity_35_bad_robots.data').with(
:path => '/etc/modsecurity/activated_rules/modsecurity_35_bad_robots.data',
:target => '/usr/share/modsecurity-crs/base_rules/modsecurity_35_bad_robots.data'
) }
end
end