|
1 | 1 | require 'spec_helper'
|
2 | 2 |
|
3 | 3 | describe 'firewall::linux::debian', :type => :class do
|
4 |
| - it { should contain_package('iptables-persistent').with( |
5 |
| - :ensure => 'present' |
6 |
| - )} |
7 |
| - it { should contain_service('iptables-persistent').with( |
8 |
| - :ensure => nil, |
9 |
| - :enable => 'true', |
10 |
| - :require => 'Package[iptables-persistent]' |
11 |
| - )} |
| 4 | + context "Debian 7" do |
| 5 | + let(:facts) {{ |
| 6 | + :osfamily => 'Debian', |
| 7 | + :operatingsystem => 'Debian', |
| 8 | + :operatingsystemrelease => '7.0' |
| 9 | + }} |
| 10 | + it { should contain_package('iptables-persistent').with( |
| 11 | + :ensure => 'present' |
| 12 | + )} |
| 13 | + it { should contain_service('iptables-persistent').with( |
| 14 | + :ensure => nil, |
| 15 | + :enable => 'true', |
| 16 | + :require => 'Package[iptables-persistent]' |
| 17 | + )} |
| 18 | + end |
12 | 19 |
|
13 |
| - context 'enable => false' do |
| 20 | + context 'deb7 enable => false' do |
| 21 | + let(:facts) {{ |
| 22 | + :osfamily => 'Debian', |
| 23 | + :operatingsystem => 'Debian', |
| 24 | + :operatingsystemrelease => '7.0' |
| 25 | + }} |
14 | 26 | let(:params) {{ :enable => 'false' }}
|
15 | 27 | it { should contain_service('iptables-persistent').with(
|
16 | 28 | :enable => 'false'
|
17 | 29 | )}
|
18 | 30 | end
|
| 31 | + |
| 32 | + context "Debian 8" do |
| 33 | + let(:facts) {{ |
| 34 | + :osfamily => 'Debian', |
| 35 | + :operatingsystem => 'Debian', |
| 36 | + :operatingsystemrelease => 'jessie/sid' |
| 37 | + }} |
| 38 | + it { should contain_package('netfilter-persistent').with( |
| 39 | + :ensure => 'present' |
| 40 | + )} |
| 41 | + it { should contain_service('netfilter-persistent').with( |
| 42 | + :ensure => nil, |
| 43 | + :enable => 'true', |
| 44 | + :require => 'Package[netfilter-persistent]' |
| 45 | + )} |
| 46 | + end |
| 47 | + |
| 48 | + context 'deb8 enable => false' do |
| 49 | + let(:facts) {{ |
| 50 | + :osfamily => 'Debian', |
| 51 | + :operatingsystem => 'Debian', |
| 52 | + :operatingsystemrelease => 'jessie/sid' |
| 53 | + }} |
| 54 | + let(:params) {{ :enable => 'false' }} |
| 55 | + it { should contain_service('netfilter-persistent').with( |
| 56 | + :enable => 'false' |
| 57 | + )} |
| 58 | + end |
| 59 | + |
| 60 | + context "Debian 8, alt operatingsystem" do |
| 61 | + let(:facts) {{ |
| 62 | + :osfamily => 'Debian', |
| 63 | + :operatingsystem => 'Debian', |
| 64 | + :operatingsystemrelease => '8.0' |
| 65 | + }} |
| 66 | + it { should contain_package('netfilter-persistent').with( |
| 67 | + :ensure => 'present' |
| 68 | + )} |
| 69 | + it { should contain_service('netfilter-persistent').with( |
| 70 | + :ensure => nil, |
| 71 | + :enable => 'true', |
| 72 | + :require => 'Package[netfilter-persistent]' |
| 73 | + )} |
| 74 | + end |
| 75 | + |
| 76 | + context 'deb8, alt operatingsystem, enable => false' do |
| 77 | + let(:facts) {{ |
| 78 | + :osfamily => 'Debian', |
| 79 | + :operatingsystem => 'Debian', |
| 80 | + :operatingsystemrelease => '8.0' |
| 81 | + }} |
| 82 | + let(:params) {{ :enable => 'false' }} |
| 83 | + it { should contain_service('netfilter-persistent').with( |
| 84 | + :enable => 'false' |
| 85 | + )} |
| 86 | + end |
19 | 87 | end
|
0 commit comments