I tested this locally and it works for me, meaning I'm not able to
delete such a router interface. I also checked the patch
https://review.opendev.org/#/c/763198/ and it doesn't reach the part
where it tries to delete the interface, it fails much earlier:

2020-11-18 21:09:23.518 94641 INFO tempest.lib.common.rest_client 
[req-ac30968f-2c73-469d-9b73-9aeee999a02a ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 400 PUT 
https://10.209.129.60:9696/v2.0/routers/1cef36f8-c0ea-43a9-a5ea-af8ea1efae42/add_router_interface
 1.635s
2020-11-18 21:09:23.519 94641 DEBUG tempest.lib.common.rest_client 
[req-ac30968f-2c73-469d-9b73-9aeee999a02a ] Request - Headers: {'Content-Type': 
'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"subnet_id": "9804a35c-0d7e-4db0-95cf-b7c6485b295e"}
    Response - Headers: {'date': 'Wed, 18 Nov 2020 21:09:23 GMT', 'server': 
'Apache/2.4.41 (Ubuntu)', 'content-type': 'application/json', 'content-length': 
'162', 'x-openstack-request-id': 'req-ac30968f-2c73-469d-9b73-9aeee999a02a', 
'connection': 'close', 'status': '400', 'content-location': 
'https://10.209.129.60:9696/v2.0/routers/1cef36f8-c0ea-43a9-a5ea-af8ea1efae42/add_router_interface'}
        Body: b'{"NeutronError": {"type": "BadRequest", "message": "Bad router 
request: Router already has a port on subnet 
9804a35c-0d7e-4db0-95cf-b7c6485b295e.", "detail": ""}}' _log_request_full 
/opt/stack/tempest/tempest/lib/common/rest_client.py:449


** Changed in: neutron
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1904751

Title:
  Neutron – it’s possible to delete router’s port related to external
  gateway

Status in neutron:
  Invalid

Bug description:
  ### Scenario ###
  Create a router, set external gateway and add internal interface.
  List router’s ports and try to delete them.
  There is a patch you can use in order to reproduce the problem:
  https://review.opendev.org/#/c/763198/
  Note: it's also possible to reroduce the same problem with scenario script 
(includes VM creation and connectivity check before and after deleting router's 
port). As expected after port deletion connectivity check fails!

  Just upload bug.py into the /home/stack/neutron-tempest-plugin on your 
undercloud host and run it with:
  python3 -m testtools.run  
neutron_tempest_plugin.scenario.bug.RoutersTest.test_delete_router


  ### Actual result ###
  Port related to external gateway is successfully deleted.

  ### Expected ###
  Should fail

  ### Test patch output in tempest.log ###
  It's possible to see that the list containing routers port IDs is changed 
from:
  ['74abfbfa-3e60-4b6f-971c-5224dd74db2f', 
'af0a74a0-2b14-499a-a871-96e5d804da15']
  to:
  ['74abfbfa-3e60-4b6f-971c-5224dd74db2f']
  means that the port was deleted.

  2020-11-18 10:41:47.998 95480 INFO tempest.lib.common.rest_client 
[req-cca60a65-1ce0-46f4-8d58-b5177f256115 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 200 GET 
http://10.0.0.109:9696/v2.0/routers/0e7fbc2d-d42b-43d2-873f-5311af9e5c96 0.446s
  2020-11-18 10:41:51.676 95480 INFO tempest.lib.common.rest_client 
[req-1ab5e603-95f9-4cc0-9497-11346dae7c51 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 200 PUT 
http://10.0.0.109:9696/v2.0/routers/0e7fbc2d-d42b-43d2-873f-5311af9e5c96 3.676s
  2020-11-18 10:41:55.970 95480 INFO tempest.lib.common.rest_client 
[req-e51bc925-41d3-46f3-81a3-ff80e5735e9f ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 200 PUT 
http://10.0.0.109:9696/v2.0/routers/0e7fbc2d-d42b-43d2-873f-5311af9e5c96/add_router_interface
 4.292s
  2020-11-18 10:41:56.046 95480 INFO tempest.lib.common.rest_client 
[req-2fa43806-cbcb-4d3a-93cc-019c98ad2b94 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 200 GET 
http://10.0.0.109:9696/v2.0/ports?router_id=0e7fbc2d-d42b-43d2-873f-5311af9e5c96
 0.075s
  2020-11-18 10:41:56.047 95480 INFO 
neutron_tempest_plugin.api.test_routers_negative [-] 
test_remove_associated_ports ['74abfbfa-3e60-4b6f-971c-5224dd74db2f', 
'af0a74a0-2b14-499a-a871-96e5d804da15']
  2020-11-18 10:41:56.128 95480 INFO tempest.lib.common.rest_client 
[req-fbed6aa9-0d27-47ec-9614-38f72b1ace20 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 200 GET 
http://10.0.0.109:9696/v2.0/ports/74abfbfa-3e60-4b6f-971c-5224dd74db2f 0.080s
  2020-11-18 10:41:56.129 95480 INFO 
neutron_tempest_plugin.api.test_routers_negative [-] 
test_remove_associated_portsresponse: {'content-type': 'application/json', 
'content-length': '898', 'x-openstack-request-id': 
'req-fbed6aa9-0d27-47ec-9614-38f72b1ace20', 'date': 'Wed, 18 Nov 2020 15:41:56 
GMT', 'connection': 'close', 'status': '200', 'content-location': 
'http://10.0.0.109:9696/v2.0/ports/74abfbfa-3e60-4b6f-971c-5224dd74db2f'}
  2020-11-18 10:41:56.424 95480 INFO tempest.lib.common.rest_client 
[req-61c2a22a-0db2-4cbb-a934-671e979d6b44 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 409 DELETE 
http://10.0.0.109:9696/v2.0/ports/74abfbfa-3e60-4b6f-971c-5224dd74db2f 0.294s
  2020-11-18 10:41:56.425 95480 ERROR 
neutron_tempest_plugin.api.test_routers_negative [-] 
test_remove_associated_portsConflict with state of target resource
  2020-11-18 10:41:56.504 95480 INFO tempest.lib.common.rest_client 
[req-f14dd173-0c96-470c-8bb5-74fb91be1a90 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 200 GET 
http://10.0.0.109:9696/v2.0/ports/af0a74a0-2b14-499a-a871-96e5d804da15 0.078s
  2020-11-18 10:41:56.505 95480 INFO 
neutron_tempest_plugin.api.test_routers_negative [-] 
test_remove_associated_portsresponse: {'content-type': 'application/json', 
'content-length': '892', 'x-openstack-request-id': 
'req-f14dd173-0c96-470c-8bb5-74fb91be1a90', 'date': 'Wed, 18 Nov 2020 15:41:56 
GMT', 'connection': 'close', 'status': '200', 'content-location': 
'http://10.0.0.109:9696/v2.0/ports/af0a74a0-2b14-499a-a871-96e5d804da15'}
  2020-11-18 10:41:57.552 95480 INFO tempest.lib.common.rest_client 
[req-bd795598-b016-4e57-ad95-df53e1fd2fa0 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 204 DELETE 
http://10.0.0.109:9696/v2.0/ports/af0a74a0-2b14-499a-a871-96e5d804da15 1.047s
  2020-11-18 10:41:57.652 95480 INFO tempest.lib.common.rest_client 
[req-2e0dfdeb-5892-40f0-b4a2-ba314ba8fd36 ] Request 
(RoutersNegativePolicyTest:test_remove_associated_ports): 200 GET 
http://10.0.0.109:9696/v2.0/ports?router_id=0e7fbc2d-d42b-43d2-873f-5311af9e5c96
 0.098s
  2020-11-18 10:41:57.653 95480 INFO 
neutron_tempest_plugin.api.test_routers_negative [-] 
test_remove_associated_ports ['74abfbfa-3e60-4b6f-971c-5224dd74db2f']

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1904751/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to