Révision 5acb554a
Write some spec tests for init class
manifests/init.pp | ||
---|---|---|
20 | 20 |
group => 'root', |
21 | 21 |
mode => '0640'; |
22 | 22 |
'/etc/nftables/puppet.nft': |
23 |
ensure => file, |
|
23 | 24 |
source => 'puppet:///modules/nftables/config/puppet.nft'; |
24 | 25 |
'/etc/nftables/puppet': |
25 | 26 |
ensure => directory, |
27 |
mode => '0750', |
|
26 | 28 |
purge => true, |
27 | 29 |
force => true, |
28 | 30 |
recurse => true; |
spec/classes/nftables_spec.rb | ||
---|---|---|
8 | 8 |
let(:facts) { os_facts } |
9 | 9 |
|
10 | 10 |
it { is_expected.to compile } |
11 |
|
|
12 |
it { is_expected.to contain_package('nftables') } |
|
13 |
|
|
14 |
it { is_expected.to contain_file('/etc/nftables/puppet.nft').with( |
|
15 |
:ensure => 'file', |
|
16 |
:owner => 'root', |
|
17 |
:group => 'root', |
|
18 |
:mode => '0640', |
|
19 |
:source => 'puppet:///modules/nftables/config/puppet.nft', |
|
20 |
)} |
|
21 |
|
|
22 |
it { is_expected.to contain_file('/etc/nftables/puppet').with( |
|
23 |
:ensure => 'directory', |
|
24 |
:owner => 'root', |
|
25 |
:group => 'root', |
|
26 |
:mode => '0750', |
|
27 |
:purge => true, |
|
28 |
:force => true, |
|
29 |
:recurse => true, |
|
30 |
)} |
|
31 |
|
|
32 |
it { is_expected.to contain_service('nftables').with( |
|
33 |
:ensure => 'running', |
|
34 |
:enable => true, |
|
35 |
)} |
|
11 | 36 |
end |
12 | 37 |
end |
13 | 38 |
end |
Formats disponibles : Unified diff