cinder/cinder/tests/unit
Gorka Eguileor 8469109016 RBD: Fix stats reporting
Current RBD code is incorrectly reporting the stats of the pool in the
following ways:

- `provisioned_capacity_gb` contains physical space used by cinder created
  volumes.
- `free_capacity_gb` is not taking into account that pools can have quota
  restrictions and they should be used as the reference for the free capacity.
- `total_capacity` dynamically changes, which means that there is no way to
  have a fixed over provisioning capacity.

This patch fixes the stats reporting making sure we return the right
values in `provisioned_capacity_gb` and `free_capacity_gb`, and allows
us to use a static calculation of the `total_capacity` using
`report_dynamic_total_capacity` configuration option.

We don't report `allocated_capacity_gb` because this is something that
is calculated by the Cinder core code and should not be reported by
drivers, even if it's not currently working as expected [1][2].

[1] https://bugs.launchpad.net/cinder/+bug/1712549
[2] https://bugs.launchpad.net/cinder/+bug/1706057

Change-Id: I1e82bf9d0b6cc0fb1d1fc2dd8b8ccc59aea3f73f
Closes-Bug: #1706060
2017-08-23 14:33:27 +02:00
..
api Merge "Clean up repl v1 volume creation from replication" 2017-08-18 16:49:40 +00:00
attachments Make attachment_update set status to attaching 2017-08-14 13:55:15 +00:00
backup cinder backup sets incorrect parent_id 2017-07-26 23:03:05 -04:00
brick Mock execute in unit test 2017-07-26 15:24:33 -07:00
compute Add ability to extend 'in-use' volume 2017-07-12 11:48:32 -04:00
consistencygroup Remove unused CG code 2017-03-19 00:49:10 -04:00
db Trivial fix PEP 8 coding style violation and typo 2017-05-03 19:47:22 +07:00
glance Files with no code must be left completely empty 2016-09-28 16:29:30 +07:00
group Do not delete group if group snapshot exists 2017-07-21 08:33:03 +08:00
image Fix image cache db query when limits are enabled 2017-06-30 11:22:19 -07:00
keymgr Modifies override logic for key_manager 2016-09-21 11:01:59 -04:00
message Merge "Explicit user messages" 2017-06-23 19:29:31 +00:00
monkey_patch_example
objects Make attachment_update set status to attaching 2017-08-14 13:55:15 +00:00
scheduler Update backend state when extending volume 2017-07-27 17:25:11 +08:00
targets LIO: Fix terminate_connection AttributeError 2017-04-27 09:38:12 -04:00
volume RBD: Fix stats reporting 2017-08-23 14:33:27 +02:00
windows Merge "SMBFS: enable thin provisioning support flag" 2017-08-18 14:23:10 +00:00
zonemanager Removed unnecessary setUp() call in unit test 2017-08-01 15:15:07 +02:00
__init__.py Remove nosetests i18n fix 2016-11-29 18:16:59 +02:00
cast_as_call.py
conf_fixture.py Move driver options to "backend_defaults" section 2017-07-03 16:42:03 +02:00
fake_cluster.py Update Versioned Objects with Cluster object 2016-07-22 21:00:08 +02:00
fake_constants.py Update db from drivers in default groups methods 2017-03-17 11:08:06 -04:00
fake_group.py Update db from drivers in default groups methods 2017-03-17 11:08:06 -04:00
fake_group_snapshot.py Update db from drivers in default groups methods 2017-03-17 11:08:06 -04:00
fake_notifier.py Short-circuit notifications when not enabled 2017-01-30 12:31:45 +01:00
fake_objects.py Use manifest to backport OVOs during upgrades 2016-06-12 13:49:01 +02:00
fake_service.py Update is_up from Service OVO class to match ORM 2016-12-21 20:55:37 +01:00
fake_snapshot.py Add volume to fake snapshot object 2017-01-17 16:55:44 +05:30
fake_utils.py Remove unused function from unit/fake_utils.py 2016-08-30 15:09:58 +07:00
fake_volume.py Add get_all capability to volume_attachments 2016-12-16 14:25:21 -07:00
policy.json Merge "Make VolumeTypeExtraSpecsController policy more granular" 2017-07-16 00:11:44 +00:00
test_api.py
test_api_urlmap.py Replace use of mox with mock in test_api_urlmap 2016-07-01 17:17:44 +03:00
test_cleanable_manager.py Make c-vol use workers table for cleanup 2016-11-03 10:17:38 +01:00
test_cmd.py Support metadata for backup resource 2017-07-26 14:23:58 +08:00
test_context.py Refactor internal context testcases with ddt 2017-05-12 16:48:59 +08:00
test_coordination.py coordination: use tooz builtin heartbeat feature 2017-07-19 07:17:50 -04:00
test_db_api.py Merge "Add group to cluster when init host" 2017-08-01 19:20:40 +00:00
test_db_worker_api.py Prevent claiming and updating races on worker 2017-01-19 10:42:24 +01:00
test_evaluator.py
test_exception.py Extracted HTTP response codes to constants 2017-05-26 17:07:06 +05:30
test_fixtures.py
test_hacking.py Update log translation hacking rule 2017-06-29 04:05:52 -04:00
test_image_utils.py Merge "Mapping parallel and ploop" 2017-08-01 19:16:44 +00:00
test_manager.py Add service dynamic log change/query 2017-05-16 13:37:35 +02:00
test_migrations.py Support metadata for backup resource 2017-07-26 14:23:58 +08:00
test_paginate_query.py Don't use None value for sql query. 2017-02-04 09:31:27 +08:00
test_qos_specs.py Replace assertDictMatch with assertDictEqual method in tests 2016-12-21 12:06:24 -05:00
test_quota.py Fix python 3.6 escape char warnings in strings 2017-07-11 17:04:54 -04:00
test_quota_utils.py Cinder consistency group returning generic error message 2016-12-21 12:52:06 +08:00
test_rpc.py Fix notification short-circuit 2017-02-01 17:11:14 +01:00
test_service.py Make Replication support Active-Active 2017-01-19 10:42:18 +01:00
test_setup_profiler.py Support new osprofiler API 2016-12-15 15:46:56 +07:00
test_ssh_utils.py Fix SSHPool current_size not work correctly 2017-07-11 10:58:20 +08:00
test_test.py Updated unit tests to use official unittest methods 2016-06-29 21:49:50 +00:00
test_test_utils.py Tests: Disallow use of assertTrue(str) 2017-06-15 12:09:52 -04:00
test_utils.py Merge "Windows: case insensitive path comparisons" 2017-06-27 02:19:35 +00:00
test_volume_cleanup.py Clean up image tmp file if c-vol gets restarted 2017-01-17 17:28:39 +08:00
test_volume_configuration.py Add support for shared "backend_defaults" config 2017-07-11 18:58:58 +00:00
test_volume_glance_metadata.py
test_volume_throttling.py
test_volume_transfer.py Remove race conditions from transfer API 2016-11-09 11:00:42 -06:00
test_volume_types.py Volume type with encryption comparison 2017-07-25 05:08:12 +00:00
test_volume_types_extra_specs.py
test_volume_utils.py Convert marker format for listing manageable resources 2017-05-22 12:21:03 +00:00
utils.py Fix host and cluster_name filter for snapshot list 2017-08-03 17:28:52 +08:00