summaryrefslogtreecommitdiff
path: root/saharaclient/tests
diff options
context:
space:
mode:
authorMichael Ionkin <mionkin@mirantis.com>2016-07-14 13:14:03 +0300
committerMichael Ionkin <mionkin@mirantis.com>2016-08-02 19:19:20 +0300
commitd41d9ad7b52573d0394c94dbe80ff3d4ddd4e12a (patch)
treeded6904655da153c869d63a8f412e91d0fd02c53 /saharaclient/tests
parentbeff775d5d8ff0392abe9939acb65500b675229f (diff)
downloadpython-saharaclient-d41d9ad7b52573d0394c94dbe80ff3d4ddd4e12a.tar.gz
Designate integration
added 'domain_name' parameter to Cluster Template in API and CLI client. NOTE: in spec we proposed to use two domains: one for internal resolution and another for external. But we decided to use only one domain for both sides so an instance will have one hostname in the domain and two appropriate A records because it's more convenient. partial-bp: designate-integration Change-Id: Ic636d1d9d27f9f96fbfd37b7d29d8f0add44a24f
Diffstat (limited to 'saharaclient/tests')
-rw-r--r--saharaclient/tests/unit/osc/v1/test_cluster_templates.py35
-rw-r--r--saharaclient/tests/unit/test_cluster_templates.py5
2 files changed, 25 insertions, 15 deletions
diff --git a/saharaclient/tests/unit/osc/v1/test_cluster_templates.py b/saharaclient/tests/unit/osc/v1/test_cluster_templates.py
index b9e9533..78e67a3 100644
--- a/saharaclient/tests/unit/osc/v1/test_cluster_templates.py
+++ b/saharaclient/tests/unit/osc/v1/test_cluster_templates.py
@@ -39,7 +39,8 @@ CT_INFO = {
"id": "0647061f-ab98-4c89-84e0-30738ea55750",
"anti_affinity": [],
"name": "template",
- "is_protected": False
+ "is_protected": False,
+ "domain_name": 'domain.org.'
}
@@ -83,18 +84,20 @@ class TestCreateClusterTemplate(TestClusterTemplates):
'node_group_template_id':
'd29631fc-0fad-434b-80aa-7a3e9526f57c'}],
plugin_name='fake', use_autoconfig=False, shares=None,
- cluster_configs=None)
+ cluster_configs=None, domain_name=None)
def test_ct_create_all_options(self):
arglist = ['--name', 'template', '--node-groups', 'fakeng:2',
'--anti-affinity', 'datanode',
'--description', 'descr',
- '--autoconfig', '--public', '--protected']
+ '--autoconfig', '--public', '--protected',
+ '--domain-name', 'domain.org.']
verifylist = [('name', 'template'),
('node_groups', ['fakeng:2']),
('description', 'descr'), ('autoconfig', True),
- ('public', True), ('protected', True)]
+ ('public', True), ('protected', True),
+ ('domain_name', 'domain.org.')]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -108,16 +111,17 @@ class TestCreateClusterTemplate(TestClusterTemplates):
'node_group_template_id':
'd29631fc-0fad-434b-80aa-7a3e9526f57c'}],
plugin_name='fake', use_autoconfig=True, shares=None,
- cluster_configs=None)
+ cluster_configs=None, domain_name='domain.org.')
# Check that columns are correct
- expected_columns = ('Anti affinity', 'Description', 'Id', 'Is default',
+ expected_columns = ('Anti affinity', 'Description',
+ 'Domain name', 'Id', 'Is default',
'Is protected', 'Is public', 'Name', 'Node groups',
'Plugin name', 'Plugin version', 'Use autoconfig')
self.assertEqual(expected_columns, columns)
# Check that data is correct
- expected_data = ('', 'Cluster template for tests',
+ expected_data = ('', 'Cluster template for tests', 'domain.org.',
'0647061f-ab98-4c89-84e0-30738ea55750', False, False,
False, 'template', 'fakeng:2', 'fake', '0.1', True)
self.assertEqual(expected_data, data)
@@ -209,14 +213,15 @@ class TestShowClusterTemplate(TestClusterTemplates):
self.ct_mock.find_unique.assert_called_once_with(name='template')
# Check that columns are correct
- expected_columns = ('Anti affinity', 'Description', 'Id', 'Is default',
+ expected_columns = ('Anti affinity', 'Description',
+ 'Domain name', 'Id', 'Is default',
'Is protected', 'Is public', 'Name', 'Node groups',
'Plugin name', 'Plugin version', 'Use autoconfig')
self.assertEqual(expected_columns, columns)
# Check that data is correct
expected_data = (
- '', 'Cluster template for tests',
+ '', 'Cluster template for tests', 'domain.org.',
'0647061f-ab98-4c89-84e0-30738ea55750', False, False, False,
'template', 'fakeng:2', 'fake', '0.1', True)
self.assertEqual(expected_data, data)
@@ -280,12 +285,13 @@ class TestUpdateClusterTemplate(TestClusterTemplates):
arglist = ['template', '--name', 'template', '--node-groups',
'fakeng:2', '--anti-affinity', 'datanode',
'--description', 'descr', '--autoconfig-enable',
- '--public', '--protected']
+ '--public', '--protected', '--domain-name', 'domain.org.']
verifylist = [('cluster_template', 'template'), ('name', 'template'),
('node_groups', ['fakeng:2']),
('description', 'descr'), ('use_autoconfig', True),
- ('is_public', True), ('is_protected', True)]
+ ('is_public', True), ('is_protected', True),
+ ('domain_name', 'domain.org.')]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -300,16 +306,17 @@ class TestUpdateClusterTemplate(TestClusterTemplates):
{'count': 2, 'name': 'fakeng',
'node_group_template_id':
'd29631fc-0fad-434b-80aa-7a3e9526f57c'}],
- plugin_name='fake', use_autoconfig=True)
+ plugin_name='fake', use_autoconfig=True, domain_name='domain.org.')
# Check that columns are correct
- expected_columns = ('Anti affinity', 'Description', 'Id', 'Is default',
+ expected_columns = ('Anti affinity', 'Description',
+ 'Domain name', 'Id', 'Is default',
'Is protected', 'Is public', 'Name', 'Node groups',
'Plugin name', 'Plugin version', 'Use autoconfig')
self.assertEqual(expected_columns, columns)
# Check that data is correct
- expected_data = ('', 'Cluster template for tests',
+ expected_data = ('', 'Cluster template for tests', 'domain.org.',
'0647061f-ab98-4c89-84e0-30738ea55750', False, False,
False, 'template', 'fakeng:2', 'fake', '0.1', True)
self.assertEqual(expected_data, data)
diff --git a/saharaclient/tests/unit/test_cluster_templates.py b/saharaclient/tests/unit/test_cluster_templates.py
index 7f8e438..d674b6d 100644
--- a/saharaclient/tests/unit/test_cluster_templates.py
+++ b/saharaclient/tests/unit/test_cluster_templates.py
@@ -31,6 +31,7 @@ class ClusterTemplateTest(base.BaseTestCase):
'count': 1
},
"use_autoconfig": False,
+ "domain_name": 'domain.org.'
}
update_json = {
@@ -46,6 +47,7 @@ class ClusterTemplateTest(base.BaseTestCase):
'count': 1
},
"use_autoconfig": True,
+ "domain_name": 'domain.org.'
}
}
@@ -112,6 +114,7 @@ class ClusterTemplateTest(base.BaseTestCase):
net_id=getattr(resp, "neutron_management_network", None),
default_image_id=getattr(resp, "default_image_id", None),
use_autoconfig=True,
+ domain_name=getattr(resp, "domain_name", None)
)
self.assertIsInstance(updated, ct.ClusterTemplate)
@@ -130,7 +133,7 @@ class ClusterTemplateTest(base.BaseTestCase):
'hadoop_version': None, 'is_protected': None, 'is_public': None,
'name': None, 'net_id': None,
'node_groups': None, 'plugin_name': None, 'shares': None,
- 'use_autoconfig': None}
+ 'use_autoconfig': None, 'domain_name': None}
req_json = unset_json.copy()
req_json['neutron_management_network'] = req_json.pop('net_id')