forked from saz/puppet-limits
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlimits_spec.rb
More file actions
57 lines (48 loc) · 1.23 KB
/
limits_spec.rb
File metadata and controls
57 lines (48 loc) · 1.23 KB
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
require 'spec_helper'
describe 'limits' do
let :default_params do
{
:manage_limits_d_dir => true,
:purge_limits_d_dir => true
}
end
[ {},
{
:purge_limits_d_dir => false
},
{
:manage_limits_d_dir => false
}
].each do |param_set|
describe "when #{param_set == {} ? "using default" : "specifying #{param_set}"} class parameters" do
let :param_hash do
default_params.merge(param_set)
end
let :params do
param_set
end
['Debian', 'Gentoo', 'RedHat', 'Suse'].each do |osfamily|
let :facts do
{
:osfamily => osfamily,
}
end
describe "on supported osfamily: #{osfamily}" do
it do
if params[:manage_limits_d_dir] == false
should_not contain_file('/etc/security/limits.d')
else
should contain_file('/etc/security/limits.d').with(
'ensure' => 'directory',
'owner' => 'root',
'group' => 'root',
'force' => true,
'recurse' => true,
'purge' => param_hash[:purge_limits_d_dir])
end
end
end
end
end
end
end