cinder/cinder/tests/unit/api/v3
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
..
__init__.py Microversion of Bootable filter in cinder list 2016-04-21 15:17:15 +00:00
fakes.py Add prefix to user message event ids 2017-01-13 11:27:20 +01:00
stubs.py Add prefix to user message event ids 2017-01-13 11:27:20 +01:00
test_attachments.py Support 'LIKE' operator to filter resource 2017-05-22 14:23:31 +08:00
test_backups.py Support sort backup with name 2017-06-05 14:29:03 +08:00
test_cluster.py Make Replication support Active-Active 2017-01-19 10:42:18 +01:00
test_consistencygroups.py Revert "Using assertFalse(A) instead of assertEqual(False, A)" 2017-06-06 19:43:10 +00:00
test_group_snapshots.py Support 'LIKE' operator to filter resource 2017-05-22 14:23:31 +08:00
test_group_specs.py Adding tests for api/v3/group_specs.py 2017-03-21 18:32:55 +00:00
test_group_types.py Check groups before deleting group type 2017-04-23 09:19:13 -04:00
test_groups.py Tiramisu: replication group support 2017-04-30 22:49:13 -04:00
test_messages.py Support 'LIKE' operator to filter resource 2017-05-22 14:23:31 +08:00
test_resource_filters.py API/DB: Fix hash randomization test issues 2017-06-05 11:21:17 -04:00
test_snapshot_manage.py Extracted HTTP response codes to constants 2017-03-22 12:02:03 +05:30
test_snapshots.py Support 'LIKE' operator to filter resource 2017-05-22 14:23:31 +08:00
test_volume_manage.py Extracted HTTP response codes to constants 2017-03-22 12:02:03 +05:30
test_volume_metadata.py Fix metadata api's raises TypeError 2017-03-31 18:18:58 +05:30
test_volumes.py Return metadata in volume summary 2017-06-02 09:08:22 +08:00
test_workers.py Extracted HTTP response codes to constants 2017-03-22 12:02:03 +05:30