cinder/cinder/tests/unit
xing-yang 18744ba199 Tiramisu: replication group support
This patch adds support for replication group.
It is built upon the generic volume groups.
It supports enable replication, disable replication,
failover replication, and list replication targets.

Client side patch is here:
    https://review.openstack.org/#/c/352229/

To test this server side patch using the client side patch:
export OS_VOLUME_API_VERSION=3.38

Make sure the group type has group_replication_enabled or
consistent_group_replication_enabled set in group specs,
and the volume types have replication_enabled set in extra specs
(to be compatible with Cheesecake).

cinder group-type-show my_group_type
+-------------+---------------------------------------+
| Property    | Value                                 |
+-------------+---------------------------------------+
| description | None                                  |
| group_specs | group_replication_enabled : <is> True |
| id          | 66462b5c-38e5-4a1a-88d6-7a7889ffec55  |
| is_public   | True                                  |
| name        | my_group_type                         |
+-------------+---------------------------------------+

cinder type-show my_volume_type
+---------------------------------+--------------------------------------+
| Property                        | Value                                |
+---------------------------------+--------------------------------------+
| description                     | None                                 |
| extra_specs                     | replication_enabled : <is> True      |
| id                              | 09c1ce01-87d5-489e-82c6-9f084107dc5c |
| is_public                       | True                                 |
| name                            | my_volume_type                       |
| os-volume-type-access:is_public | True                                 |
| qos_specs_id                    | None                                 |
+---------------------------------+--------------------------------------+

Create a group:
cinder group-create --name my_group my_group_type my_volume_type
cinder group-show my_group

Enable replication group on the primary storage:
    cinder group-enable-replication my_group
Expected results: replication_status becomes “enabled”.

Failover replication group to the secondary storage.
If secondary-backend-id is not specified, it will go to the
secondary-backend-id configured in cinder.conf:
    cinder group-failover-replication my_group
If secondary-backend-id is specified (not “default”), it will go to
the specified backend id:
    cinder group-failover-replication my_group
--secondary-backend-id <backend_id>
Expected results: replication_status becomes “failed-over”.

Run failover replication group again to fail the group back to
the primary storage:
    cinder group-failover-replication my_group
--secondary-backend-id default
Expected results: replication_status becomes “enabled”.

Disable replication group:
    cinder group-disable-replication my_group
Expected results: replication_status becomes “disabled”.

APIImpact
DocImpact
Implements: blueprint replication-cg

Change-Id: I4d488252bd670b3ebabbcc9f5e29e0e4e913765a
2017-04-30 22:49:13 -04:00
..
api Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
attachments Refactor update attachment's testcases 2017-06-07 11:23:49 +08:00
backup Ceph: Fix delete backup with non-existent pool 2017-06-01 20:40:04 +08:00
brick Add time.sleep mock for test_lv_deactivate_timeout 2017-05-22 18:50:54 +03:00
compute Send global_request_id to nova/glance when calls are made 2017-06-08 07:48:30 -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 Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
image Send global_request_id to nova/glance when calls are made 2017-06-08 07:48:30 -04:00
keymgr Modifies override logic for key_manager 2016-09-21 11:01:59 -04:00
message Add support for generalized filtering on list APIs 2017-05-08 13:04:59 +08:00
monkey_patch_example
objects Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
scheduler Merge "Add volume type filter to API Get-Pools" 2017-06-02 00:04:00 +00:00
targets LIO: Fix terminate_connection AttributeError 2017-04-27 09:38:12 -04:00
volume Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
windows SMBFS: remove redundant check 2017-05-25 11:46:18 +03:00
zonemanager Remove BRCD primary_switch_wwn config option 2017-05-22 12:01:32 -05:00
__init__.py Remove nosetests i18n fix 2016-11-29 18:16:59 +02:00
cast_as_call.py
conf_fixture.py Merge two fake drivers into the one FakeLoggingVolumeDriver 2016-09-09 14:37:21 +00: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
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 Tiramisu: replication group support 2017-04-30 22:49:13 -04: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 Tests: Remove the redundant methods 2017-04-10 15:22:34 +00:00
test_context.py Refactor internal context testcases with ddt 2017-05-12 16:48:59 +08:00
test_coordination.py Fix py27 gate - Remove Tooz usage for tests 2017-05-18 17:20:47 +02:00
test_db_api.py Tiramisu: replication group support 2017-04-30 22:49:13 -04: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 Revert "Using assertFalse(A) instead of assertEqual(False, A)" 2017-06-06 19:43:10 +00:00
test_image_utils.py Fix support for AMI image conversion 2017-06-02 16:32:23 +02:00
test_manager.py Add service dynamic log change/query 2017-05-16 13:37:35 +02:00
test_migrations.py Tiramisu: replication group support 2017-04-30 22:49:13 -04: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 backup_api_class doesn't work 2017-05-09 22:32:13 +08: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 Merge "Change assertTrue(isinstance()) with optimal assert" 2016-08-30 13:13:54 +00:00
test_test.py Updated unit tests to use official unittest methods 2016-06-29 21:49:50 +00:00
test_test_utils.py
test_utils.py Check the volume metadata value is a string or not 2017-05-22 21:37:16 -04: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
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 Merge "DB: Optimize update methods" 2017-02-14 19:30:40 +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 Return metadata in volume summary 2017-06-02 09:08:22 +08:00