neutron/neutron/tests/unit
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
..
agent Merge "[ovs fw] Restrict IPv6 NA and DHCP(v6) IP and MAC source addresses" 2021-05-14 13:57:02 +00:00
api Merge "use payloads for NETWORK callback events" 2021-05-16 08:50:19 +00:00
cmd Added common config and SR-IOV agent config to sanity check 2021-04-27 15:05:00 +00:00
common Merge "Replace assertItemsEqual with assertCountEqual" 2021-04-26 19:12:38 +00:00
conf Merge "trivial: Reduce duplication in project network tests" 2021-04-30 16:46:07 +00:00
core_extensions Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
db New Quota driver ``DbQuotaNoLockDriver`` 2021-05-20 07:55:59 +00:00
debug Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
extensions New Quota driver ``DbQuotaNoLockDriver`` 2021-05-20 07:55:59 +00:00
hacking Remove "six" library 2020-07-28 16:55:52 +00:00
ipam Allow to manually define the gateway IP when using subnet pools 2021-02-27 10:06:35 +00:00
notifiers Add config option ``http_retries`` 2020-06-29 22:07:46 -04:00
objects Merge "Replace assertItemsEqual with assertCountEqual" 2021-04-26 19:12:38 +00:00
pecan_wsgi Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
plugins Merge "Fix wrong assertion methods in a unit test" 2021-05-17 08:21:16 +00:00
privileged Migrate "netstat" to oslo.privsep 2020-06-19 14:59:11 +00:00
quota New Quota driver ``DbQuotaNoLockDriver`` 2021-05-20 07:55:59 +00:00
scheduler Merge "Replace assertItemsEqual with assertCountEqual" 2021-04-26 19:12:38 +00:00
services Merge "use payloads for NETWORK callback events" 2021-05-16 08:50:19 +00:00
tests Merge "Replace assertItemsEqual with assertCountEqual" 2021-04-26 19:12:38 +00:00
__init__.py Don't set use_stderr to False for tests 2017-04-15 01:41:29 +00:00
_test_extension_portbindings.py Remove "six" library 2020-07-28 16:55:52 +00:00
dummy_plugin.py Remove Neutron LBaaS 2019-09-20 07:46:06 +00:00
extension_stubs.py Consume ServicePluginBase from neutron-lib 2017-03-17 12:06:57 -06:00
fake_resources.py Merge "Use normalized_cidr of the SG in the OVN driver" 2021-03-22 18:57:57 +00:00
test_auth.py Fix context deprecation warnings 2018-02-13 15:02:49 -05:00
test_manager.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_neutron_plugin_base_v2.py Add unit test to validate non DB base core plugin can be loaded 2017-11-15 21:21:35 +00:00
test_opts.py
test_policy.py Always perform policy checks if enforce_new_defaults == true 2021-03-18 08:51:00 +01:00
test_service.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_worker.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_wsgi.py Remove "six" library 2020-07-28 16:55:52 +00:00
testlib_api.py Remove usage of six.text_type and six.string_type 2020-05-22 14:02:55 -04:00