diff options
author | Tim Meusel <tim@bastelfreak.de> | 2019-09-12 15:01:58 +0200 |
---|---|---|
committer | Tim Meusel <tim@bastelfreak.de> | 2019-09-12 22:54:38 +0200 |
commit | 221c45769e56ffda0ac82bd035e0ef5f37706836 (patch) | |
tree | a28cc8e9d862abac0491b4d2cfd412461567a05c /spec/acceptance | |
parent | 439e71b110e769d8164c4491a6662ac6f2b089db (diff) | |
download | puppet-ferm-221c45769e56ffda0ac82bd035e0ef5f37706836.tar.gz puppet-ferm-221c45769e56ffda0ac82bd035e0ef5f37706836.tar.bz2 |
readd Debian 9/10 support
Diffstat (limited to 'spec/acceptance')
-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 |