← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1373756] [NEW] Unique check in allowed address pair's extension not work well

 

Public bug reported:

Test this case:

Assume a port's mac_address is 12:34:56:78:aa:bb

Then put these to allowed address pair:
[{"ip_address": "10.0.0.1"},
 {"ip_address": "10.0.0.2",
   "mac_address": "12:34:56:78:aa:bb"}]

This can pass in extension's validator, but will cause error in db, for mac_address is None in extension, but conver to
port's real mac_address in db.


Unit test code:

    def test_update_add_none_and_own_mac_address_pairs(self):
        with self.network() as net:
            res = self._create_port(self.fmt, net['network']['id'])
            port = self.deserialize(self.fmt, res)
            mac_address = port['port']['mac_address']
            address_pairs = [{'ip_address': '10.0.0.1'},
                             {'mac_address': mac_address,
                              'ip_address': '10.0.0.1'}]
            update_port = {'port': {addr_pair.ADDRESS_PAIRS:
                                    address_pairs}}
            req = self.new_update_request('ports', update_port,
                                          port['port']['id'])
            res = req.get_response(self.api)
            self.assertEqual(res.status_int, 400)
            self._delete('ports', port['port']['id'])

** Affects: neutron
     Importance: Undecided
     Assignee: Wei Wang (damon-devops)
         Status: New

** Description changed:

  Test this case:
  
  Assume a port's mac_address is 12:34:56:78:aa:bb
+ 
  Then put these to allowed address pair:
  [{"ip_address": "10.0.0.1"},
-  {"ip_address": "10.0.0.2",
-    "mac_address": "12:34:56:78:aa:bb"}]
+  {"ip_address": "10.0.0.2",
+    "mac_address": "12:34:56:78:aa:bb"}]
  
  This can pass in extension's validator, but will cause error in db, for mac_address is None in extension, but conver to
  port's real mac_address in db.
  
+ 
  Unit test code:
  
-     def test_update_add_none_and_own_mac_address_pairs(self):
-         with self.network() as net:
-             res = self._create_port(self.fmt, net['network']['id'])
-             port = self.deserialize(self.fmt, res)
-             mac_address = port['port']['mac_address']
-             address_pairs = [{'ip_address': '10.0.0.1'},
-                              {'mac_address': mac_address,
-                               'ip_address': '10.0.0.1'}]
-             update_port = {'port': {addr_pair.ADDRESS_PAIRS:
-                                     address_pairs}}
-             req = self.new_update_request('ports', update_port,
-                                           port['port']['id'])
-             res = req.get_response(self.api)
-             self.assertEqual(res.status_int, 400)
-             self._delete('ports', port['port']['id'])
+     def test_update_add_none_and_own_mac_address_pairs(self):
+         with self.network() as net:
+             res = self._create_port(self.fmt, net['network']['id'])
+             port = self.deserialize(self.fmt, res)
+             mac_address = port['port']['mac_address']
+             address_pairs = [{'ip_address': '10.0.0.1'},
+                              {'mac_address': mac_address,
+                               'ip_address': '10.0.0.1'}]
+             update_port = {'port': {addr_pair.ADDRESS_PAIRS:
+                                     address_pairs}}
+             req = self.new_update_request('ports', update_port,
+                                           port['port']['id'])
+             res = req.get_response(self.api)
+             self.assertEqual(res.status_int, 400)
+             self._delete('ports', port['port']['id'])

** Changed in: neutron
     Assignee: (unassigned) => Wei Wang (damon-devops)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1373756

Title:
  Unique check in allowed address pair's extension not work well

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  Test this case:

  Assume a port's mac_address is 12:34:56:78:aa:bb

  Then put these to allowed address pair:
  [{"ip_address": "10.0.0.1"},
   {"ip_address": "10.0.0.2",
     "mac_address": "12:34:56:78:aa:bb"}]

  This can pass in extension's validator, but will cause error in db, for mac_address is None in extension, but conver to
  port's real mac_address in db.

  
  Unit test code:

      def test_update_add_none_and_own_mac_address_pairs(self):
          with self.network() as net:
              res = self._create_port(self.fmt, net['network']['id'])
              port = self.deserialize(self.fmt, res)
              mac_address = port['port']['mac_address']
              address_pairs = [{'ip_address': '10.0.0.1'},
                               {'mac_address': mac_address,
                                'ip_address': '10.0.0.1'}]
              update_port = {'port': {addr_pair.ADDRESS_PAIRS:
                                      address_pairs}}
              req = self.new_update_request('ports', update_port,
                                            port['port']['id'])
              res = req.get_response(self.api)
              self.assertEqual(res.status_int, 400)
              self._delete('ports', port['port']['id'])

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1373756/+subscriptions


Follow ups

References