]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
Fix acceptance tests
authorJonathan Tripathy <jt@puppetlabs.com>
Mon, 30 Mar 2015 16:04:14 +0000 (17:04 +0100)
committerJonathan Tripathy <jt@puppetlabs.com>
Mon, 30 Mar 2015 16:04:14 +0000 (17:04 +0100)
spec/acceptance/firewall_spec.rb
spec/acceptance/rhel7_spec.rb [deleted file]

index 331d831ae598b252f2f0df10f6938f8778cf8df2..8fadcadfd23bced1388df3a24f996e0bd93a1fdd 100644 (file)
@@ -833,57 +833,60 @@ describe 'firewall type', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfami
     end
   end
 
-  describe 'checksum_fill' do
-    context 'virbr' do
-      it 'applies' do
-        pp = <<-EOS
-          class { '::firewall': }
-          firewall { '576 - test':
-            proto  => udp,
-            table  => 'mangle',
-            outiface => 'virbr0',
-            chain  => 'POSTROUTING',
-            dport => '68',
-            jump  => 'CHECKSUM',
-            checksum_fill => true,
-            provider => iptables,
-          }
-        EOS
+  
+  if default['platform'] !~ /el-5/ and default['platform'] !~ /ubuntu-10\.04/ and default['platform'] !~ /debian-6/ and default['platform'] !~ /sles/
+    describe 'checksum_fill' do
+      context 'virbr' do
+        it 'applies' do
+          pp = <<-EOS
+            class { '::firewall': }
+            firewall { '576 - test':
+              proto  => udp,
+              table  => 'mangle',
+              outiface => 'virbr0',
+              chain  => 'POSTROUTING',
+              dport => '68',
+              jump  => 'CHECKSUM',
+              checksum_fill => true,
+              provider => iptables,
+            }
+          EOS
 
-        apply_manifest(pp, :catch_failures => true)
-      end
+          apply_manifest(pp, :catch_failures => true)
+        end
 
-      it 'should contain the rule' do
-        shell('iptables-save -t mangle') do |r|
-          expect(r.stdout).to match(/-A POSTROUTING -o virbr0 -p udp -m multiport --dports 68 -m comment --comment "576 - test" -j CHECKSUM --checksum-fill/)
+        it 'should contain the rule' do
+          shell('iptables-save -t mangle') do |r|
+            expect(r.stdout).to match(/-A POSTROUTING -o virbr0 -p udp -m multiport --dports 68 -m comment --comment "576 - test" -j CHECKSUM --checksum-fill/)
+          end
         end
       end
     end
-  end
 
-  describe 'checksum_fill6' do
-    context 'virbr' do
-      it 'applies' do
-        pp = <<-EOS
-          class { '::firewall': }
-          firewall { '576 - test':
-            proto  => udp,
-            table  => 'mangle',
-            outiface => 'virbr0',
-            chain  => 'POSTROUTING',
-            dport => '68',
-            jump  => 'CHECKSUM',
-            checksum_fill => true,
-            provider => ip6tables,
-          }
-        EOS
+    describe 'checksum_fill6' do
+      context 'virbr' do
+        it 'applies' do
+          pp = <<-EOS
+            class { '::firewall': }
+            firewall { '576 - test':
+              proto  => udp,
+              table  => 'mangle',
+              outiface => 'virbr0',
+              chain  => 'POSTROUTING',
+              dport => '68',
+              jump  => 'CHECKSUM',
+              checksum_fill => true,
+              provider => ip6tables,
+            }
+          EOS
 
-        apply_manifest(pp, :catch_failures => true)
-      end
+          apply_manifest(pp, :catch_failures => true)
+        end
 
-      it 'should contain the rule' do
-        shell('ip6tables-save -t mangle') do |r|
-          expect(r.stdout).to match(/-A POSTROUTING -o virbr0 -p udp -m multiport --dports 68 -m comment --comment "576 - test" -j CHECKSUM --checksum-fill/)
+        it 'should contain the rule' do
+          shell('ip6tables-save -t mangle') do |r|
+            expect(r.stdout).to match(/-A POSTROUTING -o virbr0 -p udp -m multiport --dports 68 -m comment --comment "576 - test" -j CHECKSUM --checksum-fill/)
+          end
         end
       end
     end
diff --git a/spec/acceptance/rhel7_spec.rb b/spec/acceptance/rhel7_spec.rb
deleted file mode 100644 (file)
index 5754ada..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'spec_helper_acceptance'
-
-describe 'firewall on RHEL7', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) || !is_rhel7( !is_rhel7( fact('osfamily'), fact('operatingsystem'), fact('operatingsystemrelease') ) ) do
-  before :all do
-    iptables_flush_all_tables
-  end
-
-  it 'should run successfully' do
-    pp = "
-    class { 'firewall': 
-      remove_firewalld => true,
-    }
-    ->
-    resources { 'firewall':
-      purge   => true,
-    }
-    ->
-    firewall { '555 - test':
-      proto  => tcp,
-      port   => '555',
-      action => accept,
-    }
-    "
-
-    # Run it twice and test for idempotency
-    apply_manifest(pp, :catch_failures => true, :debug => true)
-    expect(apply_manifest(pp, :catch_failures => true, :debug => true).exit_code).to be_zero
-  end
-
-end