From c89a93fc544910daf66a1ad93bf9b4cdec0a238c Mon Sep 17 00:00:00 2001 From: Eimhin Laverty Date: Wed, 3 Apr 2019 17:30:27 +0100 Subject: [PATCH] (MODULES-8855) Move ipvs test to exception spec --- .../firewall_attributes_exceptions_spec.rb | 23 +++++++++++++++++++ .../firewall_attributes_happy_path_spec.rb | 9 -------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/spec/acceptance/firewall_attributes_exceptions_spec.rb b/spec/acceptance/firewall_attributes_exceptions_spec.rb index f3be135..41a5e58 100644 --- a/spec/acceptance/firewall_attributes_exceptions_spec.rb +++ b/spec/acceptance/firewall_attributes_exceptions_spec.rb @@ -954,6 +954,29 @@ describe 'firewall basics', docker: true do end unless (os[:family] == 'redhat' && os[:release].start_with?('5', '6')) || (os[:family] == 'sles') + describe 'ipvs' do + context 'when set' do + pp1 = <<-PUPPETCODE + class { '::firewall': } + firewall { '1002 - set ipvs': + proto => 'tcp', + action => accept, + chain => 'INPUT', + ipvs => true, + } + PUPPETCODE + it 'applies' do + apply_manifest(pp1, catch_failures: true) + end + + it 'contains the rule' do + shell('iptables-save') do |r| + expect(r.stdout).to match(%r{-A INPUT -p tcp -m ipvs --ipvs -m comment --comment "1002 - set ipvs" -j ACCEPT}) + end + end + end + end + describe 'tee_gateway' do context 'when 10.0.0.2' do pp1 = <<-PUPPETCODE diff --git a/spec/acceptance/firewall_attributes_happy_path_spec.rb b/spec/acceptance/firewall_attributes_happy_path_spec.rb index 80a8c0c..accb748 100644 --- a/spec/acceptance/firewall_attributes_happy_path_spec.rb +++ b/spec/acceptance/firewall_attributes_happy_path_spec.rb @@ -349,12 +349,6 @@ describe 'firewall attribute testing, happy path' do chain => 'OUTPUT', table => 'mangle', } - firewall { '1002 - set ipvs': - proto => 'tcp', - action => accept, - chain => 'INPUT', - ipvs => true, - } PUPPETCODE apply_manifest(pp, catch_failures: true) apply_manifest(pp, catch_changes: do_catch_changes) @@ -508,8 +502,5 @@ describe 'firewall attribute testing, happy path' do it 'jump is set' do expect(result.stdout).to match(%r{-A INPUT -p tcp -m comment --comment "567 - jump" -j TEST}) end - it 'ipvs is set' do - expect(result.stdout).to match(%r{-A INPUT -p tcp -m ipvs --ipvs -m comment --comment "1002 - set ipvs" -j ACCEPT}) - end end end -- 2.45.2