[test][unit] The method of creating resources does not support setting project_ id

Bug #1966354 reported by ZhouHeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Unassigned

Bug Description

Some basic unit test classes in neutron, contain basic methods for creating resources, which are often referenced by other unit tests.
eg:
MeteringPluginDbTestCaseMixin.metering_label
MeteringPluginDbTestCaseMixin.metering_label_rule
NeutronDbPluginV2TestCase.network
NeutronDbPluginV2TestCase.subnet
NeutronDbPluginV2TestCase.subnetpool
NeutronDbPluginV2TestCase.port
AddressScopeTestCase.address_scope
L3NatExtensionTestCase.router

these methods only distinguish parameter "tenant_id", if the parameter "project_id" passed into, will raise error or not working.
to write a new unit test, need to set "project_id", and then use the discarded "tenant_id" is not appropriate.

Changed in neutron:
status: New → In Progress
Revision history for this message
yatin (yatinkarel) wrote :

Fix is already Proposed, but bot missed updated here:- https://review.opendev.org/c/openstack/neutron/+/834874

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/834874
Committed: https://opendev.org/openstack/neutron/commit/cc50b45ca3c3e0f06034b4f1af581b83359e6172
Submitter: "Zuul (22348)"
Branch: master

commit cc50b45ca3c3e0f06034b4f1af581b83359e6172
Author: zhouhenglc <email address hidden>
Date: Wed Mar 23 21:11:21 2022 +0800

    [test][unit]creating resources support set project_id

    To write a new unit test, need to set "project_id", and then
    use the discarded "tenant_id" is not appropriate.

    this patch updated creating resources method, both "project_id"
    and "tenant_id" are acceptable. of course, "project_id" priority.

    Closes-bug: #1966354

    Change-Id: Ic24f03da169dd3d1549b05b35ec77d3e9a25f17b

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

This issue was fixed in the openstack/neutron 21.0.0.0rc1 release candidate.

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.