TestNecPortBindingValidatePortInfo unit tests failing on longinteger conversion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Undecided
|
Matt Riedemann |
Bug Description
These two tests in neutron trunk are failing on my 64-bit xubuntu 12.04 using python 2.7:
http://
When I run the NECPluginV2.
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 = '0x1234567890ab
>>> dpid = int(datapath_id, 16)
>>> dpid
131176846729489
>>> dpid > 0xffffffffffffffffL
False
>>> hex(dpid)
'0x1234567890ab
>>>
So the int(datapath_id, 16) conversion is returning it as a longinteger, so the 'L' is appended at the end.
http://
"If the argument is outside the integer range, the function returns a long object instead."
http://
I'm able to fix this in the tests by simply using assertIn rather than assertEqual:
self.assertIn(
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.
Changed in neutron: | |
milestone: | none → havana-rc1 |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | havana-rc1 → 2013.2 |
i think assertIn cannot ensure the two integer is same