UT neutron.tests.unit.services.ovn_l3.test_plugin.OVNL3ExtrarouteTests failing with neutron-lib from master

Bug #1940224 reported by Slawek Kaplonski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Critical
Unassigned

Bug Description

Since 13.08.2021 one of our UT neutron.tests.unit.services.ovn_l3.test_plugin.OVNL3ExtrarouteTests.test_router_create_with_gwinfo_ext_ip_non_admin is failing with neutron-lib from master.

Failure example: https://5095d1cf5e3173e1d222-5acdef5dc10478cee5291df1596ec66a.ssl.cf5.rackcdn.com/periodic/opendev.org/openstack/neutron/master/openstack-tox-py36-with-neutron-lib-master/292883e/testr_results.html

Stacktrace:

ft1.182: neutron.tests.unit.services.ovn_l3.test_plugin.OVNL3ExtrarouteTests.test_router_create_with_gwinfo_ext_ip_non_admintesttools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 183, in func
    return f(self, *args, **kwargs)
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/base.py", line 183, in func
    return f(self, *args, **kwargs)
  File "/home/zuul/src/opendev.org/openstack/neutron/neutron/tests/unit/extensions/test_l3.py", line 749, in test_router_create_with_gwinfo_ext_ip_non_admin
    self.assertEqual(exc.HTTPForbidden.code, res.status_int)
  File "/home/zuul/src/opendev.org/openstack/neutron/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 393, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/zuul/src/opendev.org/openstack/neutron/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 480, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: 403 != 201

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

Since [1], we don't validate the sub-attributes in "external_gw_info". That means the policy rule to check is now:
  rule:create_router:external_gateway_info

Before this patch, the rule to check was:
  (rule:create_router:external_gateway_info and (rule:create_router:external_gateway_info:network_id and rule:create_router:external_gateway_info:external_fixed_ips))

For now we need to revert this patch or find a solution for this patch.

[1]https://review.opendev.org/c/openstack/neutron-lib/+/802029/3/neutron_lib/api/definitions/l3_ext_gw_mode.py#b16

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)
Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/804919

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lib (master)

Reviewed: https://review.opendev.org/c/openstack/neutron-lib/+/804894
Committed: https://opendev.org/openstack/neutron-lib/commit/c6f576e66b577b9929f080f1ffd83cd3783794a4
Submitter: "Zuul (22348)"
Branch: master

commit c6f576e66b577b9929f080f1ffd83cd3783794a4
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Tue Aug 17 16:39:38 2021 +0000

    Use explicit "dict_or_nodata" validation for "external_gateway_info"

    That API definition will be used during the policy check to create the
    needed rule for each internal GW info element, specifically with the
    external network fixed IPs. Only the owner of the external network or
    the administrator can create fixed IPs on the external network.

    Change-Id: Ia70485ed7713436dd6433ed39ae721500dbed7dd
    Closes-Bug: #1940224

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lib 2.14.0

This issue was fixed in the openstack/neutron-lib 2.14.0 release.

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

Change abandoned by "Slawek Kaplonski <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/804919

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.