]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix test MAC addresses to be valid
authorBrian Haley <brian.haley@hp.com>
Mon, 31 Mar 2014 16:14:59 +0000 (12:14 -0400)
committerMark McClain <mmcclain@yahoo-inc.com>
Fri, 4 Apr 2014 22:38:49 +0000 (18:38 -0400)
MAC addresses should have 6 octets - 'ff:ff:ff:ff:ff:ff'.

Change-Id: I9c2457d978ccce15549d3258961093a130375bff
Closes-bug: #1302282
(cherry picked from commit 5f042a64308cb00698b454da09b4a87f2ac3fafd)

neutron/tests/unit/test_iptables_firewall.py

index e64080356c858bab548a5074af6525b600e6a796..c1451fb312e9edb38eb955bf81f41a32741f0463 100644 (file)
@@ -59,7 +59,7 @@ class IptablesFirewallTestCase(base.BaseTestCase):
 
     def _fake_port(self):
         return {'device': 'tapfake_dev',
-                'mac_address': 'ff:ff:ff:ff',
+                'mac_address': 'ff:ff:ff:ff:ff:ff',
                 'fixed_ips': [FAKE_IP['IPv4'],
                               FAKE_IP['IPv6']]}
 
@@ -100,7 +100,7 @@ class IptablesFirewallTestCase(base.BaseTestCase):
                                '-j $ofake_dev'),
                  call.add_chain('sfake_dev'),
                  call.add_rule(
-                     'sfake_dev', '-m mac --mac-source ff:ff:ff:ff '
+                     'sfake_dev', '-m mac --mac-source ff:ff:ff:ff:ff:ff '
                      '-s 10.0.0.1 -j RETURN'),
                  call.add_rule('sfake_dev', '-j DROP'),
                  call.add_rule(
@@ -861,7 +861,7 @@ class IptablesFirewallTestCase(base.BaseTestCase):
                   call.add_chain('sfake_dev'),
                   call.add_rule(
                       'sfake_dev',
-                      '-m mac --mac-source ff:ff:ff:ff -s %s -j RETURN'
+                      '-m mac --mac-source ff:ff:ff:ff:ff:ff -s %s -j RETURN'
                       % prefix),
                   call.add_rule('sfake_dev', '-j DROP'),
                   dhcp_rule,
@@ -932,7 +932,7 @@ class IptablesFirewallTestCase(base.BaseTestCase):
                  call.add_chain('sfake_dev'),
                  call.add_rule(
                      'sfake_dev',
-                     '-m mac --mac-source ff:ff:ff:ff -s 10.0.0.1 '
+                     '-m mac --mac-source ff:ff:ff:ff:ff:ff -s 10.0.0.1 '
                      '-j RETURN'),
                  call.add_rule('sfake_dev', '-j DROP'),
                  call.add_rule(
@@ -986,7 +986,8 @@ class IptablesFirewallTestCase(base.BaseTestCase):
                  call.add_chain('sfake_dev'),
                  call.add_rule(
                      'sfake_dev',
-                     '-m mac --mac-source ff:ff:ff:ff -s 10.0.0.1 -j RETURN'),
+                     '-m mac --mac-source ff:ff:ff:ff:ff:ff -s 10.0.0.1 '
+                     '-j RETURN'),
                  call.add_rule('sfake_dev', '-j DROP'),
                  call.add_rule(
                      'ofake_dev',
@@ -1098,7 +1099,7 @@ class IptablesFirewallTestCase(base.BaseTestCase):
 
     def test_ip_spoofing_filter_with_multiple_ips(self):
         port = {'device': 'tapfake_dev',
-                'mac_address': 'ff:ff:ff:ff',
+                'mac_address': 'ff:ff:ff:ff:ff:ff',
                 'fixed_ips': ['10.0.0.1', 'fe80::1', '10.0.0.2']}
         self.firewall.prepare_port_filter(port)
         calls = [call.add_chain('sg-fallback'),
@@ -1136,10 +1137,12 @@ class IptablesFirewallTestCase(base.BaseTestCase):
                  call.add_chain('sfake_dev'),
                  call.add_rule(
                      'sfake_dev',
-                     '-m mac --mac-source ff:ff:ff:ff -s 10.0.0.1 -j RETURN'),
+                     '-m mac --mac-source ff:ff:ff:ff:ff:ff -s 10.0.0.1 '
+                     '-j RETURN'),
                  call.add_rule(
                      'sfake_dev',
-                     '-m mac --mac-source ff:ff:ff:ff -s 10.0.0.2 -j RETURN'),
+                     '-m mac --mac-source ff:ff:ff:ff:ff:ff -s 10.0.0.2 '
+                     '-j RETURN'),
                  call.add_rule('sfake_dev', '-j DROP'),
                  call.add_rule(
                      'ofake_dev',
@@ -1159,7 +1162,7 @@ class IptablesFirewallTestCase(base.BaseTestCase):
 
     def test_ip_spoofing_no_fixed_ips(self):
         port = {'device': 'tapfake_dev',
-                'mac_address': 'ff:ff:ff:ff',
+                'mac_address': 'ff:ff:ff:ff:ff:ff',
                 'fixed_ips': []}
         self.firewall.prepare_port_filter(port)
         calls = [call.add_chain('sg-fallback'),
@@ -1197,7 +1200,7 @@ class IptablesFirewallTestCase(base.BaseTestCase):
                  call.add_chain('sfake_dev'),
                  call.add_rule(
                      'sfake_dev',
-                     '-m mac --mac-source ff:ff:ff:ff -j RETURN'),
+                     '-m mac --mac-source ff:ff:ff:ff:ff:ff -j RETURN'),
                  call.add_rule('sfake_dev', '-j DROP'),
                  call.add_rule(
                      'ofake_dev',