diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-11-30 20:33:11 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-11-30 20:33:11 +0000 |
| commit | 7f9a81bb1bd1fe14345f66074272a5cfd86af736 (patch) | |
| tree | fbb8def0c9c2b398b75e256baad610e5c065cac6 /cinderclient/tests/unit/v2 | |
| parent | 37ea6acad71e4d143438facda39db078c6179cb5 (diff) | |
| parent | b8e118f5c271fb91cbc17a8553dba5f7fcedb2bc (diff) | |
| download | python-cinderclient-1.5.0.tar.gz | |
Merge "Adds v2 replication support"1.5.0
Diffstat (limited to 'cinderclient/tests/unit/v2')
| -rw-r--r-- | cinderclient/tests/unit/v2/fakes.py | 8 | ||||
| -rw-r--r-- | cinderclient/tests/unit/v2/test_shell.py | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/cinderclient/tests/unit/v2/fakes.py b/cinderclient/tests/unit/v2/fakes.py index f641ee7..b0c78b9 100644 --- a/cinderclient/tests/unit/v2/fakes.py +++ b/cinderclient/tests/unit/v2/fakes.py @@ -437,6 +437,14 @@ class FakeHTTPClient(base_client.HTTPClient): elif action == 'os-migrate_volume': assert 'host' in body[action] assert 'force_host_copy' in body[action] + elif action == 'os-enable_replication': + assert body[action] is None + elif action == 'os-disable_replication': + assert body[action] is None + elif action == 'os-list_replication_targets': + assert body[action] is None + elif action == 'os-failover_replication': + assert 'secondary' in body[action] elif action == 'os-update_readonly_flag': assert list(body[action]) == ['readonly'] elif action == 'os-retype': diff --git a/cinderclient/tests/unit/v2/test_shell.py b/cinderclient/tests/unit/v2/test_shell.py index 42c3dc7..1c140cb 100644 --- a/cinderclient/tests/unit/v2/test_shell.py +++ b/cinderclient/tests/unit/v2/test_shell.py @@ -794,6 +794,23 @@ class ShellTest(utils.TestCase): self.assert_called('POST', '/volumes/1234/action', body=expected) + def test_replication_enable(self): + self.run_command('replication-enable 1234') + self.assert_called('POST', '/volumes/1234/action') + + def test_replication_disable(self): + self.run_command('replication-disable 1234') + self.assert_called('POST', '/volumes/1234/action') + + def test_replication_list_targets(self): + self.run_command('replication-list-targets 1234') + self.assert_called('POST', '/volumes/1234/action') + + def test_replication_failover(self): + self.run_command('replication-failover 1234 target') + expected = {'os-failover_replication': {'secondary': 'target'}} + self.assert_called('POST', '/volumes/1234/action', body=expected) + def test_snapshot_metadata_set(self): self.run_command('snapshot-metadata 1234 set key1=val1 key2=val2') self.assert_called('POST', '/snapshots/1234/metadata', |
