unit tests error in FIP creation

Bug #1736755 reported by Dongcan Ye
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Low
Dongcan Ye

Bug Description

While debugging unit test for [1] using tox command "tox -e venv -- python -m testtools.run neutron.tests.unit.extensions.test_l3.L3AgentDbIntTestCase.test_l3_agent_routers_query_floatingips".

I found that floatingip created with the params:
(Pdb) data
{'floatingip': {'tenant_id': '46f70361-ba71-4bd0-9769-3573fd227c4b', 'port_id': u'3dca5c4e-dee5-4a9c-afbe-d77494c42223', 'floating_network_id': u'2bdc683e-5b0c-46ad-a85a-9fc138e5778f'}}

But these params will error while using neutronclient:
# neutron floatingip-create --port-id 5b129110-d6ba-4e0f-8d56-3fce7d052213 public

DEBUG: keystoneauth.session REQ: curl -g -i -X POST http://20.30.40.5:9696/v2.0/floatingips -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d98e0f7fa754f69fc26bd427b244a335f7f8d97a" -d '{"floatingip": {"floating_network_id": "30c2a624-7c53-46a2-a733-b196e7d72b40", "port_id": "5b129110-d6ba-4e0f-8d56-3fce7d052213"}}'
DEBUG: keystoneauth.session RESP: [400] Content-Type: application/json Content-Length: 147 X-Openstack-Request-Id: req-9998bac0-3f87-4db3-98a3-9c98789d275b Date: Wed, 06 Dec 2017 15:02:58 GMT Connection: keep-alive
RESP BODY: {"NeutronError": {"message": "Invalid input for operation: IP allocation requires subnet_id or ip_address.", "type": "InvalidInput", "detail": ""}}

Function floatingip_with_assoc in[2] create a FIP only with FIP network and private port, so I think there are lots of UTs need to amend.

[1] https://review.openstack.org/#/c/521707/
[2] https://github.com/openstack/neutron/blob/master/neutron/tests/unit/extensions/test_l3.py#L484

Tags: unittest
Dongcan Ye (hellochosen)
Changed in neutron:
assignee: nobody → Dongcan Ye (hellochosen)
Changed in neutron:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/526362

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
Brian Haley (brian-haley) wrote :

I'm not sure this is a bug based on the API doc:

https://developer.openstack.org/api-ref/network/v2/#floating-ips-floatingips

Only network_id is required.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Dongcan Ye (<email address hidden>) on branch: master
Review: https://review.openstack.org/526362
Reason: This is a related fix in [1], but it seems unnecessary.

[1] https://review.openstack.org/#/c/521707/

Dongcan Ye (hellochosen)
Changed in neutron:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.