diff options
| author | Fabien COMBERNOUS <Dan33l@users.noreply.github.com> | 2019-09-12 23:06:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-12 23:06:55 +0200 |
| commit | 2455de32311040de0d608d8cc151aa6395700e8f (patch) | |
| tree | a28cc8e9d862abac0491b4d2cfd412461567a05c /spec/acceptance/ferm_spec.rb | |
| parent | 439e71b110e769d8164c4491a6662ac6f2b089db (diff) | |
| parent | 221c45769e56ffda0ac82bd035e0ef5f37706836 (diff) | |
| download | puppet-ferm-2455de32311040de0d608d8cc151aa6395700e8f.tar.gz puppet-ferm-2455de32311040de0d608d8cc151aa6395700e8f.tar.bz2 | |
Merge pull request #69 from bastelfreak/debian
readd Debian 9/10 support
Diffstat (limited to 'spec/acceptance/ferm_spec.rb')
| -rw-r--r-- | spec/acceptance/ferm_spec.rb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/spec/acceptance/ferm_spec.rb b/spec/acceptance/ferm_spec.rb index b0c41a5..c5018da 100644 --- a/spec/acceptance/ferm_spec.rb +++ b/spec/acceptance/ferm_spec.rb @@ -12,6 +12,20 @@ manage_initfile = case sut_os false end +iptables_output = case sut_os + when 'Debian-10' + [ + '-A INPUT -p tcp -m tcp --dport 22 -m comment --comment allow_acceptance_tests -j ACCEPT', + '-A INPUT -p tcp -m tcp --dport 80 -m comment --comment jump_http -j HTTP', + '-A HTTP -s 127.0.0.1/32 -p tcp -m tcp --dport 80 -m comment --comment allow_http_localhost -j ACCEPT' + ] + else + [ + '-A INPUT -p tcp -m comment --comment ["]*allow_acceptance_tests["]* -m tcp --dport 22 -j ACCEPT', + '-A INPUT -p tcp -m comment --comment ["]*jump_http["]* -m tcp --dport 80 -j HTTP', + '-A HTTP -s 127.0.0.1/32 -p tcp -m comment --comment ["]*allow_http_localhost["]* -m tcp --dport 80 -j ACCEPT' + ] + end basic_manifest = %( class { 'ferm': manage_service => true, @@ -57,7 +71,7 @@ describe 'ferm' do describe iptables do it do - is_expected.to have_rule('-A INPUT -p tcp -m comment --comment ["]*allow_acceptance_tests["]* -m tcp --dport 22 -j ACCEPT'). \ + is_expected.to have_rule(iptables_output[0]). \ with_table('filter'). \ with_chain('INPUT') end @@ -97,12 +111,12 @@ describe 'ferm' do describe iptables do it do - is_expected.to have_rule('-A INPUT -p tcp -m comment --comment ["]*jump_http["]* -m tcp --dport 80 -j HTTP'). \ + is_expected.to have_rule(iptables_output[1]). \ with_table('filter'). \ with_chain('INPUT') end it do - is_expected.to have_rule('-A HTTP -s 127.0.0.1/32 -p tcp -m comment --comment ["]*allow_http_localhost["]* -m tcp --dport 80 -j ACCEPT'). \ + is_expected.to have_rule(iptables_output[2]). \ with_table('filter'). \ with_chain('HTTP') end |
