]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(#14455) Add tests for interface names containing a "+". Add a few missing tests...
authorSimon Deziel <simon.deziel@gmail.com>
Sat, 12 May 2012 15:24:59 +0000 (11:24 -0400)
committerKen Barber <ken@bob.sh>
Sun, 13 May 2012 21:52:11 +0000 (22:52 +0100)
spec/fixtures/iptables/conversion_hash.rb

index 4b95558141dcf2959735a93dbec7737b13c950d2..a52d8b10ff2a02e57240352f3a39f7235ec7d8ec 100644 (file)
@@ -196,8 +196,17 @@ ARGS_TO_HASH = {
       :iniface => 'eth0.234',
     },
   },
+  'iniface_with_plus_1' => {
+    :line => '-A INPUT -i eth+ -m comment --comment "060 iniface" -j DROP',
+    :table => 'filter',
+    :params => {
+      :action => 'drop',
+      :chain => 'INPUT',
+      :iniface => 'eth+',
+    },
+  },
   'outiface_1' => {
-    :line => '-A OUTPUT -o eth0 -m comment --comment "060 iniface" -j DROP',
+    :line => '-A OUTPUT -o eth0 -m comment --comment "060 outiface" -j DROP',
     :table => 'filter',
     :params => {
       :action => 'drop',
@@ -206,7 +215,7 @@ ARGS_TO_HASH = {
     },
   },
   'outiface_with_vlans_1' => {
-    :line => '-A OUTPUT -o eth0.234 -m comment --comment "060 iniface" -j DROP',
+    :line => '-A OUTPUT -o eth0.234 -m comment --comment "060 outiface" -j DROP',
     :table => 'filter',
     :params => {
       :action => 'drop',
@@ -214,6 +223,15 @@ ARGS_TO_HASH = {
       :outiface => 'eth0.234',
     },
   },
+  'outiface_with_plus_1' => {
+    :line => '-A OUTPUT -o eth+ -m comment --comment "060 outiface" -j DROP',
+    :table => 'filter',
+    :params => {
+      :action => 'drop',
+      :chain => 'OUTPUT',
+      :outiface => 'eth+',
+    },
+  },
 }
 
 # This hash is for testing converting a hash to an argument line.
@@ -404,6 +422,36 @@ HASH_TO_ARGS = {
     },
     :args => ['-t', :mangle, '-p', :tcp, '-m', 'comment', '--comment', '058 set-mark 1000', '-j', 'MARK', '--set-mark', '0x3e8'],
   },
+  'iniface_1' => {
+    :params => {
+      :name => '060 iniface',
+      :table => 'filter',
+      :action => 'drop',
+      :chain => 'INPUT',
+      :iniface => 'eth0',
+    },
+    :args => ["-t", :filter, "-i", "eth0", "-p", :tcp, "-m", "comment", "--comment", "060 iniface", "-j", "DROP"],
+  },
+  'iniface_with_vlans_1' => {
+    :params => {
+      :name => '060 iniface',
+      :table => 'filter',
+      :action => 'drop',
+      :chain => 'INPUT',
+      :iniface => 'eth0.234',
+    },
+    :args => ["-t", :filter, "-i", "eth0.234", "-p", :tcp, "-m", "comment", "--comment", "060 iniface", "-j", "DROP"],
+  },
+  'iniface_with_plus_1' => {
+    :params => {
+      :name => '060 iniface',
+      :table => 'filter',
+      :action => 'drop',
+      :chain => 'INPUT',
+      :iniface => 'eth+',
+    },
+    :args => ["-t", :filter, "-i", "eth+", "-p", :tcp, "-m", "comment", "--comment", "060 iniface", "-j", "DROP"],
+  },
   'outiface_1' => {
     :params => {
       :name => '060 outiface',
@@ -424,4 +472,14 @@ HASH_TO_ARGS = {
     },
     :args => ["-t", :filter, "-o", "eth0.234", "-p", :tcp, "-m", "comment", "--comment", "060 outiface", "-j", "DROP"],
   },
+  'outiface_with_plus_1' => {
+    :params => {
+      :name => '060 outiface',
+      :table => 'filter',
+      :action => 'drop',
+      :chain => 'OUTPUT',
+      :outiface => 'eth+',
+    },
+    :args => ["-t", :filter, "-o", "eth+", "-p", :tcp, "-m", "comment", "--comment", "060 outiface", "-j", "DROP"],
+  },
 }