← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1534846] Re: IP address attribute test fails on OSX

 

Reviewed:  https://review.openstack.org/267850
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1962440d7bcfa15fefd0e73756b5a2fb745142f4
Submitter: Jenkins
Branch:    master

commit 1962440d7bcfa15fefd0e73756b5a2fb745142f4
Author: Brian Haley <brian.haley@xxxxxxx>
Date:   Thu Jan 14 17:35:02 2016 -0500

    Fix check in _validate_ip_address() to fail on OSX
    
    Don't check the IP address version if the data passed doesn't
    have either a ':' or three '.', as we have already found an
    invalid IP address.  This was failing on OSX because the
    netaddr.IPAddress() call does not throw an exception, but
    returns data assuming the address was IPv4.
    
    Change-Id: Idd87e06e9cd0aa588014ef6cdc871b531a2908cb
    Closes-Bug: #1534846


** Changed in: neutron
       Status: In Progress => Fix Released

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

Title:
  IP address attribute test fails on OSX

Status in neutron:
  Fix Released

Bug description:
  The "59 1's" IP address test fails on OSX because it's interpreted as
  an IPv4 address, which is different from a Linux system:

  Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      Traceback (most recent call last):
        File "neutron/tests/unit/api/v2/test_attributes.py", line 254, in test_validate_ip_address
          self.assertEqual("'%s' is not a valid IP address" % ip_addr, msg)
        File "/Users/haley/neutron/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
          self.assertThat(observed, matcher, message)
        File "/Users/haley/neutron/.tox/py27/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
          raise mismatch_error
      testtools.matchers._impl.MismatchError: !=:
      reference = "'11111111111111111111111111111111111111111111111111111111111' is not a valid IP address"
      actual    = u"'11111111111111111111111111111111111111111111111111111111111' is not an accepted IP address, '199.28.113.199' is recommended"

  The code in neutron/api/v2/attributes.py actually has a good
  description of the differences between Linux and BSD on this so I
  won't go into detail.

  The actual problem is that the code to detect the address has either a
  ':' or 3 '.' needs to raise an exception, instead of just setting
  'msg' since on OSX execution will continue, and the wrong error
  message will get returned.

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


References