neutron/neutron/tests/unit/objects
Miguel Lavalle 73e3f7d281 Fix list security groups performance with RBAC
After change [1], if the system has a high number of security groups
with no associated RBAC entries, a non admin user owning only one
security group will experience unacceptable response times when
listing her security groups.

Change [1] added methods get_object and get_objects to class
RbacNeutronDbObjectMixin in neutron.objects.rbac_db, which retrieve with
and admin context all the objects (networks, subnets or security groups)
in the DB and then decide in memory whether the project that made the
query has access to them or not, based on their associated RBAC
policies. This change proposes to remove those methods and revert to
their counterparts in NeutronDbObject (neutron.objects.base), which use
a DB query scoped to the project to retrieve the objects based on their
associated RBAC policies by calling [2]. In this way, the potential
number of objects that are retrieved from the DB and that have to be
converted to OVOs is greatly reduced, improving significantly the
response time to the user.

[1] https://review.opendev.org/#/c/635311
[2] 7a58374fde/neutron_lib/db/model_query.py (L100)

Change-Id: Idd303778d83089da8fbeff40e3dda2bd19008d8e
Closes-Bug: #1830679
(cherry picked from commit a240c68022)
2019-07-10 14:34:50 +00:00
..
db remove the neutron.db._model_query module 2019-01-25 08:55:25 -07:00
extensions [OVO] Switch to use own registry 2017-11-22 17:44:22 +01:00
logapi Enable an update test in UT of logging 2017-07-07 12:01:49 +09:00
plugins OVO for FlatAllocation 2016-12-22 13:25:50 +00:00
port Add propagate_uplink_status to port 2018-11-29 19:33:16 +00:00
qos Fix list security groups performance with RBAC 2019-07-10 14:34:50 +00:00
__init__.py objects.base: avoid db access if object does not have changes 2015-07-03 02:02:17 +03:00
test_address_scope.py Use BaseDbObjectTestCase in AddressScope UT 2016-10-12 14:17:15 -05:00
test_agent.py New agent attribute: resources_synced 2019-02-21 13:45:15 +01:00
test_auto_allocate.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_base.py Add qos_network_policy_id to Port OVO 2019-07-05 14:10:44 +00:00
test_common_types.py Support Network Segment Range CRUD as extensions 2019-03-07 08:20:30 +00:00
test_flavor.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_floatingip.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_ipam.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_l3_hamode.py tests: generate unique network ids for L3HARouterVRIdAllocation 2017-09-15 13:25:35 -06:00
test_l3agent.py Add specific values to specific fields in get_random_object_fields() 2017-07-25 15:16:25 +09:00
test_metering.py Metering to OVO 2017-04-26 11:44:58 -07:00
test_network.py Allow sharing of security groups via RBAC mechanism 2019-03-09 17:30:14 -06:00
test_network_segment_range.py Support Network Segment Range CRUD as extensions 2019-03-07 08:20:30 +00:00
test_objects.py Add qos_network_policy_id to Port OVO 2019-07-05 14:10:44 +00:00
test_port_forwarding.py Support fetching specific db column in OVO 2018-12-11 19:29:28 +00:00
test_ports.py Add qos_network_policy_id to Port OVO 2019-07-05 14:10:44 +00:00
test_provisioning_blocks.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_quota.py Use flake8-import-order plugin 2017-07-05 03:15:27 +00:00
test_rbac.py Allow sharing of security groups via RBAC mechanism 2019-03-09 17:30:14 -06:00
test_rbac_db.py Allow sharing of security groups via RBAC mechanism 2019-03-09 17:30:14 -06:00
test_router.py Use Router OVO in external_net_db 2018-02-08 14:42:29 +00:00
test_securitygroup.py Allow sharing of security groups via RBAC mechanism 2019-03-09 17:30:14 -06:00
test_servicetype.py ProviderResourceAssociation to OVO 2016-11-18 13:09:29 -06:00
test_subnet.py tests: don't configure plugin for tests that don't need it 2018-04-12 16:01:58 -07:00
test_subnetpool.py Use constant IP_VERSION_4/6 in unit tests 2018-08-27 21:45:39 +00:00
test_tag.py Refactoring _create_test methods for OVO UTs 2017-04-17 12:05:19 -07:00
test_trunk.py objects: support tenant_id filter for get_* if project_id is present 2017-06-30 11:08:29 -04:00