neutron/neutron/tests/unit/db
Slawek Kaplonski 062336e59b Set system_scope='all' in elevated context
In case when enforce_new_defaults is set to True and new policy rules
are used, context.is_admin flag isn't really working as it was with old
rules.
But in case when elevated context is needed, it means that we need
context which has full rights to the system. So we should also set
"system_scope" parameter to "all" to be sure that system scope queries
can be done with such elevated context always.

It is needed e.g. when elevated context is used to get some data from
db. In such case we need to have db query which will not be scoped to
the single project_id and with new defaults to achieve that system_scope
has to be set to "all".

Proper fix for that should be done in neutron-lib and it is proposed
in [1] already but as we are have frozen neutron-lib version for
stable/wallaby already this patch for neutron is temporary fix for that
issue.
We can revert that patch as soon as we will be in Xena development cycle
and [1] will be merged and released.

[1] https://review.opendev.org/c/openstack/neutron-lib/+/781625

Related-Bug: #1920001
Change-Id: I0068c1de09f5c6fae5bb5cd0d6f26f451e701939
2021-03-19 12:05:56 +01:00
..
metering Add source_ip_prefix and destination_ip_prefix to metering label rules 2020-09-29 09:06:03 -03:00
quota Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
__init__.py Empty files should not contain copyright or license 2014-10-20 00:50:32 +00:00
test__utils.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_agents_db.py Set process name for agents 2020-07-01 12:28:29 +02:00
test_agentschedulers_db.py Schedule networks to new segments if needed 2021-03-05 16:03:49 +00:00
test_allowedaddresspairs_db.py Switch to new engine facade in test_allowedaddresspairs_db module 2020-03-20 02:18:04 +01:00
test_db_base_plugin_common.py Replace to_dict() calls with a function decorator 2015-08-03 11:42:25 +03:00
test_db_base_plugin_v2.py Allow to manually define the gateway IP when using subnet pools 2021-02-27 10:06:35 +00:00
test_dvr_mac_db.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_extraroute_db.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_ipam_backend_mixin.py Merge "Floating IP for routed networks: network:routed API" 2021-01-06 17:32:23 +00:00
test_ipam_pluggable_backend.py [OVN] Allow IP allocation with different segments for OVN service ports 2020-07-22 07:38:49 +00:00
test_l3_db.py Finish the new DB engine facade migration 2020-11-24 09:20:35 +00:00
test_l3_dvr_db.py Set system_scope='all' in elevated context 2021-03-19 12:05:56 +01:00
test_l3_hamode_db.py Switch to new engine facade for l3_hamode_db leftovers 2020-12-10 10:07:35 +00:00
test_migration.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_ovn_hash_ring_db.py Match created_at and updated_at timestamp in TestHashRing 2020-10-08 14:45:51 +00:00
test_ovn_revision_numbers_db.py Merge "Support remote address group in SG rules" 2020-11-28 11:26:39 +00:00
test_portsecurity_db.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_portsecurity_db_common.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_provisioning_blocks.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_rbac_db_mixin.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_securitygroups_db.py Don't try to create default SG when security groups are disabled 2021-02-05 16:07:39 +01:00
test_segments_db.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00