Mercurial > repos > other > Puppet
comparison modules/firewall/spec/unit/classes/firewall_linux_debian_spec.rb @ 39:d6f2a0ee45c0 puppet-3.6
Add "Firewall" module
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 14 Mar 2015 20:58:03 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
38:a1960fb961c5 | 39:d6f2a0ee45c0 |
---|---|
1 require 'spec_helper' | |
2 | |
3 describe 'firewall::linux::debian', :type => :class do | |
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 | |
19 | |
20 context 'deb7 enable => false' do | |
21 let(:facts) {{ | |
22 :osfamily => 'Debian', | |
23 :operatingsystem => 'Debian', | |
24 :operatingsystemrelease => '7.0' | |
25 }} | |
26 let(:params) {{ :enable => 'false' }} | |
27 it { should contain_service('iptables-persistent').with( | |
28 :enable => 'false' | |
29 )} | |
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('iptables-persistent').with( | |
39 :ensure => 'present' | |
40 )} | |
41 it { should contain_service('netfilter-persistent').with( | |
42 :ensure => nil, | |
43 :enable => 'true', | |
44 :require => 'Package[iptables-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('iptables-persistent').with( | |
67 :ensure => 'present' | |
68 )} | |
69 it { should contain_service('netfilter-persistent').with( | |
70 :ensure => nil, | |
71 :enable => 'true', | |
72 :require => 'Package[iptables-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 | |
87 end |