neutron/neutron/tests/unit/extensions
Rodolfo Alonso Hernandez e135a8221d New Quota driver ``DbQuotaNoLockDriver``
This new quota driver, ``DbQuotaNoLockDriver``, does not create a lock
per (resource, project_id) but retrieves the instant (resource,
project_id) usage and the current (resource, project_id) reservations.
If the requested number of resources fit the available quota, a new
``Reservation`` register is created with the amount of units requested.

All those operations are done inside a DB transaction context. That
means the amount of resources and reservations is guaranteed inside
this transaction (depending on the DB backend isolation level defined)
and the new reservation created will not clash with other DB transation.
That will guarantee the number of resources and instant reservations
never exceed the quota limits defined for this (resource, project_id).

NOTES:
- This change tries to be as unobtrusive as possible. The new driver
  uses the same ``DbQuotaDriver`` dabatase tables (except for
  ``QuotaUsage``) and the same Quota engine API, located in
  ``neutron.quota``. However, the Quota engine resources implements some
  particular API actions like "dirty", that are not used in the new
  driver.
- The Pecan Quota enforcement hooks,
  ``neutron.pecan_wgsi.hooks.quota_enforcement``, execute actions like
  "resync", "mark_resources_dirty" or "set_resources_dirty", that has
  no meaning in the new driver.
- The isolation between the Quota engine and the Pecan hook, and the
  driver itself is not clearly defined. A refactor of the Quota engine,
  Quota service, Quota drivers and a common API between the driver and
  the engine is needed.
- If ``DbQuotaDriver`` is deprecated, ``CountableResource`` and
  ``TrackedResource`` will be joined in a single class. This resource
  class will have a count method (countable) or a hard dependency on a
  database table (tracked resource). The only difference will be the
  "count" method implementation.

Closes-Bug: #1926787

Change-Id: I4f98c6fcd781459fd7150aff426d19c7fdfa98c1
2021-05-20 07:55:59 +00:00
..
__init__.py Empty files should not contain copyright or license 2014-10-20 00:50:32 +00:00
base.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
extendedattribute.py Use ExtensionDescriptor from neutron-lib 2016-12-02 14:16:06 -05:00
extensionattribute.py Use ExtensionDescriptor from neutron-lib 2016-12-02 14:16:06 -05:00
foxinsocks.py Remove usage of six.add_metaclass 2020-05-21 14:41:18 -04:00
test_address_group.py Support address group in OVS firewall agent 2021-02-08 13:28:06 -06:00
test_address_scope.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_agent.py Set process name for agents 2020-07-01 12:28:29 +02:00
test_availability_zone.py Replace assertItemsEqual with assertCountEqual 2020-11-30 10:21:57 +01:00
test_data_plane_status.py Switch to new engine facade in extensions unit tests 2020-03-20 06:28:46 +01:00
test_default_subnetpools.py Fix dhcpv6-statefull typo 2020-05-01 10:50:37 -04:00
test_dns.py Replace assertItemsEqual with assertCountEqual 2020-11-30 10:21:57 +01:00
test_expose_port_forwarding_in_fip.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_external_net.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_extra_dhcp_opt.py Switch to new engine facade in extensions unit tests 2020-03-20 06:28:46 +01:00
test_extraroute.py Start enforcing E125 flake8 directive 2019-07-19 23:39:41 -04:00
test_fip_port_details.py use api def ALIAS in supported_extension_aliases 2019-04-08 08:30:20 -06:00
test_flavors.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_floating_ip_port_forwarding.py Fix incorrect exception catch when update floating ip port forwarding 2021-02-06 02:40:02 +00:00
test_floatingip_pools.py Set system_scope='all' in elevated context 2021-03-19 12:05:56 +01:00
test_l3.py Remove check if set_extra_attr_value is run in the transaction 2021-04-16 14:45:53 +02:00
test_l3_conntrack_helper.py Add extension unit tests for conntrack_helper plugin 2021-02-06 02:36:22 +00:00
test_l3_ext_gw_mode.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_network_ip_availability.py Subnet gateway should be a valid IP 2019-12-23 10:13:23 +00:00
test_network_segment_range.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_port_device_profile.py Add port device profile extension 2021-01-22 16:17:30 +00:00
test_port_numa_affinity_policy.py Rename PortNumaAffinityPolicyExtensionTestPlugin 2020-12-18 11:43:04 +00:00
test_portsecurity.py Finish the new DB engine facade migration 2020-11-24 09:20:35 +00:00
test_providernet.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_qos_fip.py [OVN] Implement floating IP QoS in OVN backend 2020-09-01 07:27:48 +00:00
test_qos_gateway_ip.py use api def ALIAS in supported_extension_aliases 2019-04-08 08:30:20 -06:00
test_quotasv2.py New Quota driver ``DbQuotaNoLockDriver`` 2021-05-20 07:55:59 +00:00
test_quotasv2_detail.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_router_availability_zone.py Replace assertItemsEqual with assertCountEqual 2020-11-30 10:21:57 +01:00
test_security_groups_normalized_cidr.py Add normalized_cidr column to SG rules 2021-01-07 12:23:59 +01:00
test_securitygroup.py Add normalized_cidr column to SG rules 2021-01-07 12:23:59 +01:00
test_segment.py Merge "use payloads for NETWORK callback events" 2021-05-16 08:50:19 +00:00
test_servicetype.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_subnet_dns_publish_fixed_ip.py Allow to select subnets to publish DNS records 2019-12-14 13:36:09 +00:00
test_subnet_onboard.py Start enforcing E125 flake8 directive 2019-07-19 23:39:41 -04:00
test_subnet_service_types.py use api def ALIAS in supported_extension_aliases 2019-04-08 08:30:20 -06:00
test_subnetpool_prefix_ops.py Start enforcing E125 flake8 directive 2019-07-19 23:39:41 -04:00
test_timestamp.py Remove "six" library 2020-07-28 16:55:52 +00:00
test_uplink_status_propagation.py Switch to new enginefacade in uplink_status_propagation UT module 2020-08-27 22:28:16 +02:00
test_vlantransparent.py Switch to new engine facade in extensions unit tests 2020-03-20 06:28:46 +01:00
v2attributes.py Use ExtensionDescriptor from neutron-lib 2016-12-02 14:16:06 -05:00