diff options
author | Kilian Engelhardt <kilian.engelhardt@gmail.com> | 2019-04-03 18:05:01 +0200 |
---|---|---|
committer | Kilian Engelhardt <kilian.engelhardt@gmail.com> | 2019-04-05 13:41:18 +0200 |
commit | d665af40e1073f9813236ec911af5afdd6608862 (patch) | |
tree | 4475c92aec247bcfaff49f189480eb52173b2d22 /spec | |
parent | d04c779ef9b64d6e4fb73c8dd8b2a1008ddab13a (diff) | |
download | puppet-ferm-d665af40e1073f9813236ec911af5afdd6608862.tar.gz puppet-ferm-d665af40e1073f9813236ec911af5afdd6608862.tar.bz2 |
add test for RedHat-like to contain init script
Diffstat (limited to 'spec')
-rw-r--r-- | spec/classes/ferm_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/classes/ferm_spec.rb b/spec/classes/ferm_spec.rb index 0f9f854..aebcaae 100644 --- a/spec/classes/ferm_spec.rb +++ b/spec/classes/ferm_spec.rb @@ -22,6 +22,9 @@ describe 'ferm' do it { is_expected.to contain_file('/etc/ferm.d/chains') } it { is_expected.not_to contain_service('ferm') } it { is_expected.not_to contain_file('/etc/ferm.conf') } + if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i <= 6 + it { is_expected.not_to contain_file('/etc/init.d/ferm') } + end end context 'with managed service' do @@ -50,6 +53,17 @@ describe 'ferm' do it { is_expected.to contain_concat__fragment('ferm_header.conf') } it { is_expected.to contain_concat__fragment('ferm.conf') } end + context 'with managed initfile' do + let :params do + { manage_initfile: true } + end + + if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i <= 6 + it { is_expected.to contain_file('/etc/init.d/ferm') } + else + it { is_expected.not_to contain_file('/etc/init.d/ferm') } + end + end context 'it creates chains' do it { is_expected.to contain_concat__fragment('FORWARD-policy') } it { is_expected.to contain_concat__fragment('INPUT-policy') } |