yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #05548
[Bug 1228212] Re: TestNecPortBindingValidatePortInfo unit tests failing on longinteger conversion
** Changed in: neutron
Status: Fix Committed => Fix Released
** Changed in: neutron
Milestone: None => havana-rc1
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1228212
Title:
TestNecPortBindingValidatePortInfo unit tests failing on longinteger
conversion
Status in OpenStack Neutron (virtual network service):
Fix Released
Bug description:
These two tests in neutron trunk are failing on my 64-bit xubuntu
12.04 using python 2.7:
http://paste.openstack.org/show/47323/
When I run the NECPluginV2._validate_portinfo method in python, I get
this:
mriedem@ubuntu:~$ python
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> datapath_id = '0x1234567890abcdef'
>>> dpid = int(datapath_id, 16)
>>> dpid
1311768467294899695L
>>> dpid > 0xffffffffffffffffL
False
>>> hex(dpid)
'0x1234567890abcdefL'
>>>
So the int(datapath_id, 16) conversion is returning it as a longinteger, so the 'L' is appended at the end.
http://docs.python.org/2/library/functions.html#int
"If the argument is outside the integer range, the function returns a
long object instead."
http://docs.python.org/2/reference/lexical_analysis.html#integers
I'm able to fix this in the tests by simply using assertIn rather than
assertEqual:
self.assertIn('0x1234567890abcdef', portinfo['datapath_id'])
I'm not sure if this is a bug in the tests though or something that
should be handled in the _validate_portinfo method, i.e. if you get
past all of the current validation OK, then simply return the input
argument in the dict that goes back.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1228212/+subscriptions