Cleanup in neutron_tempest_plugin.api.admin.test_external_network_extension.ExternalNetworksRBACTestJSON may fail in dvr deployments

Bug #1875344 reported by Slawek Kaplonski
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Slawek Kaplonski

Bug Description

I saw it couple of times in our d/s testing job with DVR enabled that test neutron_tempest_plugin.api.admin.test_external_network_extension.ExternalNetworksRBACTestJSON.test_delete_policies_while_tenant_attached_to_net was failing in cleanup phase.

Error was like
ft4.1: tearDownClass (neutron_tempest_plugin.api.admin.test_external_network_extension.ExternalNetworksRBACTestJSON)testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tempest/test.py", line 242, in tearDownClass
    six.reraise(etype, value, trace)
  File "/usr/lib/python3.6/site-packages/six.py", line 675, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/tempest/test.py", line 214, in tearDownClass
    teardown()
  File "/usr/lib/python3.6/site-packages/neutron_tempest_plugin/api/base.py", line 196, in resource_cleanup
    subnet['id'])
  File "/usr/lib/python3.6/site-packages/neutron_tempest_plugin/api/base.py", line 281, in _try_delete_resource
    delete_callable(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/neutron_tempest_plugin/services/network/json/network_client.py", line 112, in _delete
    resp, body = self.delete(uri)
  File "/usr/lib/python3.6/site-packages/tempest/lib/common/rest_client.py", line 314, in delete
    return self.request('DELETE', url, extra_headers, headers, body)
  File "/usr/lib/python3.6/site-packages/tempest/lib/common/rest_client.py", line 687, in request
    self._error_checker(resp, resp_body)
  File "/usr/lib/python3.6/site-packages/tempest/lib/common/rest_client.py", line 808, in _error_checker
    raise exceptions.Conflict(resp_body, resp=resp)
tempest.lib.exceptions.Conflict: Conflict with state of target resource
Details: {'type': 'SubnetInUse', 'message': 'Unable to complete operation on subnet 7f774581-bb05-4c71-ac4e-1a338c1e3fa1: One or more ports have an IP allocation from this subnet.', 'detail': ''}

The issue is that in the dvr deployment, when router with external network is created, Neutron creates in the background floatingip gateway port. And as test is performing fast it may happen that this port is created after router is already deleted so it's not cleaned properly and causes failure during network removal.

We didn't saw it in u/s CI as we don't have any dvr based job which would run neutron_tempest_plugin.api tests.

Tags: tempest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-tempest-plugin (master)

Fix proposed to branch: master
Review: https://review.opendev.org/723387

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-tempest-plugin (master)

Reviewed: https://review.opendev.org/723387
Committed: https://git.openstack.org/cgit/openstack/neutron-tempest-plugin/commit/?id=03700aa12b4e22552f8626ffb9d5261d7a7c44c8
Submitter: Zuul
Branch: master

commit 03700aa12b4e22552f8626ffb9d5261d7a7c44c8
Author: Slawek Kaplonski <email address hidden>
Date: Mon Apr 27 13:31:01 2020 +0200

    Ensure that external network don't have any ports before deletion

    In module
    neutron_tempest_plugin.api.admin.test_external_network_extension
    we need to ensure that there is no any leftover ports, like e.g.
    floatingip_agent_gateway port before network deletion.

    Closes-bug: #1875344

    Change-Id: I8226e999d9ec8e521b39ab915aaa503425174987

Changed in neutron:
status: In Progress → Fix Released
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.