addition of a trunk subport in a dict fails

Bug #1847588 reported by Onong Tayeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-vpp
Incomplete
Wishlist
Onong Tayeng

Bug Description

OPNFV functest neutron-trunk's test_remove_subport_passing_dict test case fails. What this test case tries is to add the subport as a dict:

@decorators.attr(type='negative')
    @decorators.idempotent_id('17ca7dd7-96a8-445a-941e-53c0c86c2fe2')
    def test_remove_subport_passing_dict(self):
        network = self.create_network()
        parent_port = self.create_port(network)
        subport_data = {'port_id': parent_port['id'],
                        'segmentation_type': 'vlan',
                        'segmentation_id': 2}
        trunk = self._create_trunk_with_network_and_parent([subport_data])
        self.assertRaises(lib_exc.BadRequest, self.client.remove_subports,
                          trunk['trunk']['id'], subport_data)

Here's the error from the trunk plugin:

2019-10-10 09:46:29.008 35019 DEBUG networking_vpp.services.trunk.trunk_vpp [req-6ac8e4ba-6d6e-4030-a9c4-b995720a81ec d05e959fd1cc4d08be25bec57541adbd 09ee7fc64a5a41e0b16d0a3aa15c0269 - default default] Removing subports {u'sub_ports': {u'segmentation_type': u'vlan', u'port_id': u'761f8090-8215-4730-bcee-3d74bea78215', u'segmentation_id': 2}} from trunk dde9305d-01ba-4201-b376-a7b49ff6ff60 remove_subports /usr/local/lib/python2.7/dist-packages/networking_vpp/services/trunk/trunk_vpp.py:471
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource [req-6ac8e4ba-6d6e-4030-a9c4-b995720a81ec d05e959fd1cc4d08be25bec57541adbd 09ee7fc64a5a41e0b16d0a3aa15c0269 - default default] remove_subports failed: No details.: TypeError: string indices must be integers
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource Traceback (most recent call last):
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 98, in resource
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource result = method(request=request, **args)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron_lib/db/api.py", line 140, in wrapped
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource self.force_reraise()
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron_lib/db/api.py", line 136, in wrapped
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_db/api.py", line 154, in wrapper
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource ectxt.value = e.inner_exc
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource self.force_reraise()
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_db/api.py", line 142, in wrapper
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource return f(*args, **kwargs)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron_lib/db/api.py", line 183, in wrapped
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource LOG.debug("Retry wrapper got retriable exception: %s", e)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource self.force_reraise()
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron_lib/db/api.py", line 179, in wrapped
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 253, in _handle_action
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource ret_value = getattr(self._plugin, name)(*arg_list, **kwargs)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/db/db_base_plugin_common.py", line 49, in inner
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource result = f(*args, **kwargs)
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/networking_vpp/services/trunk/trunk_vpp.py", line 477, in remove_subports
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource subports_to_remove = [pid['port_id'] for pid in subports['sub_ports']]
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource TypeError: string indices must be integers
2019-10-10 09:46:29.018 35019 ERROR neutron.api.v2.resource

Here's the debug log which shows what is being sent to neutron from the test case:

2019-10-10 09:48:26.651 391 INFO tempest.lib.common.rest_client [req-435f5564-5553-4d2b-8b73-0d50ea69d6d6 ] Request (TrunkTestJSON:test_remove_subport_passing_dict): 201 POST http://172.16.10.36:9696/v2.0/trunks 0.345s
2019-10-10 09:48:26.651 391 DEBUG tempest.lib.common.rest_client [req-435f5564-5553-4d2b-8b73-0d50ea69d6d6 ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"trunk": {"sub_ports": [{"segmentation_type": "vlan", "port_id": "761f8090-8215-4730-bcee-3d74bea78215", "segmentation_id": 2}], "port_id": "004ac8ef-3047-4296-8851-e83499cb588a"}}
    Response - Headers: {'status': '201', u'content-length': '509', 'content-location': 'http://172.16.10.36:9696/v2.0/trunks', u'date': 'Thu, 10 Oct 2019 09:46:28 GMT', u'content-type': 'application/json', u'connection': 'close', u'x-openstack-request-id': 'req-435f5564-5553-4d2b-8b73
        Body: {"trunk": {"status": "DOWN", "sub_ports": [{"segmentation_type": "vlan", "port_id": "761f8090-8215-4730-bcee-3d74bea78215", "segmentation_id": 2}], "name": "", "admin_state_up": true, "tenant_id": "09ee7fc64a5a41e0b16d0a3aa15c0269", "created_at": "2019-10-10T09:46:28Z", "
2019-10-10 09:48:26.682 391 INFO tempest.lib.common.rest_client [req-6ac8e4ba-6d6e-4030-a9c4-b995720a81ec ] Request (TrunkTestJSON:test_remove_subport_passing_dict): 500 PUT http://172.16.10.36:9696/v2.0/trunks/dde9305d-01ba-4201-b376-a7b49ff6ff60/remove_subports 0.029s
2019-10-10 09:48:26.682 391 DEBUG tempest.lib.common.rest_client [req-6ac8e4ba-6d6e-4030-a9c4-b995720a81ec ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"sub_ports": {"segmentation_type": "vlan", "port_id": "761f8090-8215-4730-bcee-3d74bea78215", "segmentation_id": 2}}
    Response - Headers: {'status': '500', u'content-length': '150', 'content-location': 'http://172.16.10.36:9696/v2.0/trunks/dde9305d-01ba-4201-b376-a7b49ff6ff60/remove_subports', u'date': 'Thu, 10 Oct 2019 09:46:29 GMT', u'content-type': 'application/json', u'connection': 'close', u'
        Body: {"NeutronError": {"message": "Request Failed: internal server error while processing your request.", "type": "HTTPInternalServerError", "detail": ""}} _log_request_full /root/.rally/verification/verifier-4d110db8-b995-41ae-b4f2-1c23118eed79/repo/tempest/lib/common/rest_cl

Revision history for this message
Onong Tayeng (onong) wrote :

This is what needs to be sent from the client to neutron:

{"trunk": {"sub_ports": [{"segmentation_type": "vlan", "port_id": "761f8090-8215-4730-bcee-3d74bea78215", "segmentation_id": 2}], "port_id": "004ac8ef-3047-4296-8851-e83499cb588a"}}

Onong Tayeng (onong)
Changed in networking-vpp:
assignee: nobody → Onong Tayeng (onong)
status: New → Incomplete
Jerome Tollet (jtollet)
Changed in networking-vpp:
importance: Undecided → Low
importance: Low → Wishlist
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.