]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(MODULES-8855) Move ipvs test to exception spec
authorEimhin Laverty <eimhin.laverty@puppet.com>
Wed, 3 Apr 2019 16:30:27 +0000 (17:30 +0100)
committerEimhin Laverty <eimhin.laverty@puppet.com>
Thu, 4 Apr 2019 08:08:43 +0000 (09:08 +0100)
spec/acceptance/firewall_attributes_exceptions_spec.rb
spec/acceptance/firewall_attributes_happy_path_spec.rb

index f3be1353e6a28997c26373b1e0d686d0bc287bfe..41a5e58c4756d1592406a0dfd68ad7d6c4f795fb 100644 (file)
@@ -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
index 80a8c0c0a162eaff75315044300b7bb1475091e1..accb748ce5a7bae435796cf6a43e5a09f8952320 100644 (file)
@@ -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