summaryrefslogtreecommitdiff
path: root/troveclient/tests
diff options
context:
space:
mode:
authorMarcin Piwowarczyk <m.piwowarczy@samsung.com>2018-07-02 08:58:06 +0200
committerMarcin Piwowarczyk <m.piwowarczy@samsung.com>2018-08-07 08:25:39 +0200
commit9e737a2cf8cee4be79f0c8a0efd14ef4d3dbdad0 (patch)
tree098a09f958498f0f89f341e2b02730f219ab29c5 /troveclient/tests
parent451d422e9eb8f59c8e069571f102e36fb8047f76 (diff)
downloadpython-troveclient-9e737a2cf8cee4be79f0c8a0efd14ef4d3dbdad0.tar.gz
Support configuration groups for clusters
Handles API part implemented in change: I7c0a22c6a0287128d0c37e100589c78173fd9c1a So far passing configuration group was possible only for single instance deployment. As the trove api now already supports configuration attach and detach for clusters, we are able to handle it in client. Configuration will be applied to each cluster instance. Partially implements: blueprint cluster-configuration-groups Change-Id: Ic0840c995cbc34203c76494d7ba522f3e17141a7 Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>
Diffstat (limited to 'troveclient/tests')
-rw-r--r--troveclient/tests/test_clusters.py5
-rw-r--r--troveclient/tests/test_v1_shell.py22
2 files changed, 26 insertions, 1 deletions
diff --git a/troveclient/tests/test_clusters.py b/troveclient/tests/test_clusters.py
index 64e243e..2545083 100644
--- a/troveclient/tests/test_clusters.py
+++ b/troveclient/tests/test_clusters.py
@@ -79,10 +79,12 @@ class ClustersTest(testtools.TestCase):
'configsvr_volume_type': 'foo_type',
'mongos_volume_size': 12,
'mongos_volume_type': 'bar_type'}
+ configuration = 'test-config'
path, body, resp_key = clusters_test.create("test-name", "datastore",
"datastore-version",
instances, locality,
- extended_properties)
+ extended_properties,
+ configuration)
self.assertEqual("/clusters", path)
self.assertEqual("cluster", resp_key)
self.assertEqual("test-name", body["cluster"]["name"])
@@ -93,6 +95,7 @@ class ClustersTest(testtools.TestCase):
self.assertEqual(locality, body["cluster"]["locality"])
self.assertEqual(extended_properties,
body["cluster"]["extended_properties"])
+ self.assertEqual(configuration, body["cluster"]["configuration"])
def test_list(self):
page_mock = mock.Mock()
diff --git a/troveclient/tests/test_v1_shell.py b/troveclient/tests/test_v1_shell.py
index 03cb725..eb18e48 100644
--- a/troveclient/tests/test_v1_shell.py
+++ b/troveclient/tests/test_v1_shell.py
@@ -516,6 +516,28 @@ class ShellTest(utils.TestCase):
'name': 'test-clstr2',
'locality': 'affinity'}})
+ def test_cluster_create_with_configuration(self):
+ cmd = ('cluster-create test-clstr2 redis 3.0 '
+ '--configuration=config01 '
+ '--instance flavor=2,volume=1 '
+ '--instance flavor=02,volume=1 '
+ '--instance flavor=2,volume=1 ')
+ self.run_command(cmd)
+ self.assert_called_anytime(
+ 'POST', '/clusters',
+ {'cluster': {
+ 'instances': [
+ {'flavorRef': '2',
+ 'volume': {'size': '1'}},
+ {'flavorRef': '02',
+ 'volume': {'size': '1'}},
+ {'flavorRef': '2',
+ 'volume': {'size': '1'}},
+ ],
+ 'datastore': {'version': '3.0', 'type': 'redis'},
+ 'name': 'test-clstr2',
+ 'configuration': 'config01'}})
+
def test_cluster_create_with_extended_properties(self):
cmd = ('cluster-create test-clstr3 mongodb 4.0 '
'--instance flavor=2,volume=1 '