forked from saz/puppet-limits
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_spec.rb
More file actions
82 lines (70 loc) · 1.82 KB
/
init_spec.rb
File metadata and controls
82 lines (70 loc) · 1.82 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
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
# frozen_string_literal: true
require 'spec_helper'
describe 'limits' do
let :node do
'rspec.puppet.com'
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
context 'with all defaults' do
it { is_expected.to compile.with_all_deps }
it do
is_expected.to contain_file('/etc/security/limits.d').with(
'ensure' => 'directory',
'owner' => 'root',
'group' => 'root',
'force' => true,
'recurse' => true,
'purge' => true
)
end
it do
is_expected.not_to contain_file('/etc/security/limits.conf')
end
end
describe 'with purge_limits_d_dir set to false' do
let :params do
{
purge_limits_d_dir: false
}
end
it do
is_expected.to contain_file('/etc/security/limits.d').with(
'ensure' => 'directory',
'owner' => 'root',
'group' => 'root',
'force' => true,
'recurse' => true,
'purge' => false
)
end
end
describe 'with manage_limits_d_dir set to false' do
let :params do
{
manage_limits_d_dir: false
}
end
it { is_expected.not_to contain_file('/etc/security/limits.d') }
end
describe 'with manage_limits_file set to true' do
let :params do
{
manage_limits_file: true
}
end
it do
is_expected.to contain_file('/etc/security/limits.conf').with(
'ensure' => 'file',
'owner' => 'root',
'group' => 'root',
'mode' => '0644'
)
end
end
end
end
end