本文整理汇总了Python中sahara.tests.unit.service.validation.utils.stop_patch函数的典型用法代码示例。如果您正苦于以下问题:Python stop_patch函数的具体用法?Python stop_patch怎么用?Python stop_patch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stop_patch函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_cluster_create_node_group_tmpl_mixin
def test_cluster_create_node_group_tmpl_mixin(self):
ng_id = self._create_node_group_template(flavor='23')
data = {
"name": "testtmplnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"node_groups": [
{
"node_group_template_id": '%s' % ng_id,
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": [
"namenode",
"jobtracker",
"datanode",
"tasktracker"
]
},
],
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
with testtools.ExpectedException(exceptions.InvalidException):
try:
patchers = u.start_patch(False)
c.check_cluster_create(data)
u.stop_patch(patchers)
except exceptions.InvalidException as e:
self.assertEqual("Requested flavor '23' not found",
six.text_type(e))
raise e
开发者ID:COSHPC,项目名称:sahara,代码行数:31,代码来源:test_cluster_create_validation.py
示例2: test_cluster_create_node_group_tmpl_mixin
def test_cluster_create_node_group_tmpl_mixin(self):
ng_id = self._create_node_group_template(flavor="23")
data = {
"name": "testtmplnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"node_groups": [
{
"node_group_template_id": "%s" % ng_id,
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": ["namenode", "jobtracker", "datanode", "tasktracker"],
}
],
"default_image_id": "550e8400-e29b-41d4-a716-446655440000",
}
with self.assertRaises(exceptions.InvalidException):
try:
patchers = u.start_patch(False)
c.check_cluster_create(data)
u.stop_patch(patchers)
except exceptions.InvalidException as e:
self.assertEqual("Requested flavor '23' not found", e.message)
raise e
开发者ID:qinweiwei,项目名称:sahara,代码行数:25,代码来源:test_cluster_create_validation.py
示例3: test_cluster_create_cluster_tmpl_node_group_mixin
def test_cluster_create_cluster_tmpl_node_group_mixin(self):
ng_id = self._create_node_group_template(flavor='10')
ctmpl_id = self._create_cluster_template(ng_id)
data = {
"name": "testtmplnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"cluster_template_id": '%s' % ctmpl_id,
'default_image_id': '550e8400-e29b-41d4-a716-446655440000',
"node_groups": [
{
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": [
"namenode",
"jobtracker",
"datanode",
"tasktracker"
]
}
]
}
patchers = u.start_patch(False)
c.check_cluster_create(data)
u.stop_patch(patchers)
开发者ID:COSHPC,项目名称:sahara,代码行数:27,代码来源:test_cluster_create_validation.py
示例4: test_cluster_create_v_correct_flavor
def test_cluster_create_v_correct_flavor(self):
ng_id = self._create_node_group_template(flavor="42")
ctmpl_id = self._create_cluster_template(ng_id)
data = {
"name": "testname",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"cluster_template_id": "%s" % ctmpl_id,
"default_image_id": "550e8400-e29b-41d4-a716-446655440000",
}
patchers = u.start_patch(False)
c.check_cluster_create(data)
u.stop_patch(patchers)
data1 = {
"name": "testwithnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"node_groups": [
{
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": ["namenode", "jobtracker", "datanode", "tasktracker"],
}
],
"default_image_id": "550e8400-e29b-41d4-a716-446655440000",
}
patchers = u.start_patch(False)
c.check_cluster_create(data1)
u.stop_patch(patchers)
开发者ID:qinweiwei,项目名称:sahara,代码行数:32,代码来源:test_cluster_create_validation.py
示例5: test_cluster_create_v_invalid_flavor
def test_cluster_create_v_invalid_flavor(self):
ng_id = self._create_node_group_template(flavor="10")
ctmpl_id = self._create_cluster_template(ng_id)
data = {
"name": "testname",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"cluster_template_id": "%s" % ctmpl_id,
"default_image_id": "550e8400-e29b-41d4-a716-446655440000",
}
data1 = {
"name": "testwithnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"node_groups": [
{
"name": "allinone",
"count": 1,
"flavor_id": "10",
"node_processes": ["namenode", "jobtracker", "datanode", "tasktracker"],
}
],
"default_image_id": "550e8400-e29b-41d4-a716-446655440000",
}
for values in [data, data1]:
with self.assertRaises(exceptions.InvalidException):
try:
patchers = u.start_patch(False)
c.check_cluster_create(values)
u.stop_patch(patchers)
except exceptions.InvalidException as e:
self.assertEqual("Requested flavor '10' not found", e.message)
raise e
开发者ID:qinweiwei,项目名称:sahara,代码行数:34,代码来源:test_cluster_create_validation.py
示例6: test_cluster_create_node_group_tmpl_mixin
def test_cluster_create_node_group_tmpl_mixin(self):
ng_id = self._create_node_group_template(flavor='23')
data = {
"name": "testtmplnodegroups",
"plugin_name": "fake",
"hadoop_version": "0.1",
"node_groups": [
{
"node_group_template_id": '%s' % ng_id,
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": [
"namenode",
"resourcemanager",
"datanode",
"nodemanager"
]
},
],
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
with testtools.ExpectedException(exceptions.NotFoundException):
patchers = u.start_patch(False)
try:
c.check_cluster_create(data)
except exceptions.NotFoundException as e:
message = six.text_type(e).split('\n')[0]
self.assertEqual("Requested flavor '23' not found",
message)
raise e
finally:
u.stop_patch(patchers)
开发者ID:frgaudet,项目名称:sahara,代码行数:33,代码来源:test_cluster_create_validation.py
示例7: test_cluster_create_cluster_tmpl_node_group_mixin
def test_cluster_create_cluster_tmpl_node_group_mixin(self):
ng_id = self._create_node_group_template(flavor='10')
ctmpl_id = self._create_cluster_template(ng_id)
data = {
"name": "testtmplnodegroups",
"plugin_name": "fake",
"hadoop_version": "0.1",
"cluster_template_id": '%s' % ctmpl_id,
"neutron_management_network": "d9a3bebc-f788-4b81-"
"9a93-aa048022c1ca",
'default_image_id': '550e8400-e29b-41d4-a716-446655440000',
"node_groups": [
{
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": [
"namenode",
"resourcemanager",
"datanode",
"nodemanager"
]
}
]
}
patchers = u.start_patch(False)
c.check_cluster_create(data)
u.stop_patch(patchers)
开发者ID:openstack,项目名称:sahara,代码行数:29,代码来源:test_cluster_create_validation.py
示例8: test_cluster_create_node_group_tmpl_mixin
def test_cluster_create_node_group_tmpl_mixin(self):
ng_id = self._create_node_group_template(flavor="23")
data = {
"name": "testtmplnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"node_groups": [
{
"node_group_template_id": "%s" % ng_id,
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": ["namenode", "jobtracker", "datanode", "tasktracker"],
}
],
"default_image_id": "550e8400-e29b-41d4-a716-446655440000",
}
with testtools.ExpectedException(exceptions.NotFoundException):
patchers = u.start_patch(False)
try:
c.check_cluster_create(data)
except exceptions.NotFoundException as e:
message = six.text_type(e).split("\n")[0]
self.assertEqual("Requested flavor '23' not found", message)
raise e
finally:
u.stop_patch(patchers)
开发者ID:snowind,项目名称:sahara,代码行数:27,代码来源:test_cluster_create_validation.py
示例9: test_check_cluster_scaling_add_ng
def test_check_cluster_scaling_add_ng(self, ops):
ops.get_engine_type_and_version.return_value = "direct.1.1"
ng1 = tu.make_ng_dict('ng', '42', ['namenode'], 1)
cluster = tu.create_cluster("test-cluster", "tenant1", "fake",
"0.1",
[ng1], status=c_u.CLUSTER_STATUS_ACTIVE,
id='12321')
data = {
'add_node_groups': [
{
'name': 'a',
'flavor_id': '42',
'node_processes': ['namenode']
},
{
'name': 'a',
'flavor_id': '42',
'node_processes': ['namenode']
}
]
}
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message=self.duplicates_detected,
expected_exception=ex.InvalidDataException)
data = {
'add_node_groups': [
{
'name': 'ng',
'flavor_id': '42',
'node_processes': ['namenode']
},
]
}
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message="Can't add new nodegroup. "
"Cluster already has nodegroup "
"with name 'ng'")
data = {
'add_node_groups': [
{
'name': 'very-very-very-very-very-very-long-ng-name',
'flavor_id': '42',
'node_processes': ['namenode'],
'count': 10
},
]
}
patchers = u.start_patch()
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message="Composite hostname test-cluster-very-"
"very-very-very-very-very-long-ng-name-"
"010.novalocal in provisioned cluster exceeds "
"maximum limit 64 characters",
expected_exception=ex.InvalidDataException)
u.stop_patch(patchers)
开发者ID:Imperat,项目名称:sahara,代码行数:59,代码来源:test_cluster_scaling_validation.py
示例10: test_check_cluster_scaling_add_ng
def test_check_cluster_scaling_add_ng(self, ops):
ops.get_engine_type_and_version.return_value = "direct.1.1"
ng1 = tu.make_ng_dict('ng', '42', ['namenode'], 1)
cluster = tu.create_cluster("test-cluster", "tenant", "vanilla",
"1.2.1", [ng1], status='Active',
id='12321')
data = {
'add_node_groups': [
{
'name': 'a',
'flavor_id': '42',
'node_processes': ['namenode']
},
{
'name': 'a',
'flavor_id': '42',
'node_processes': ['namenode']
}
]
}
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message='Duplicates in node '
'group names are detected')
data = {
'add_node_groups': [
{
'name': 'ng',
'flavor_id': '42',
'node_processes': ['namenode']
},
]
}
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message="Can't add new nodegroup. "
"Cluster already has nodegroup "
"with name 'ng'")
data = {
'add_node_groups': [
{
'name': 'very-very-very-very-very-very-long-ng-name',
'flavor_id': '42',
'node_processes': ['namenode'],
'count': 10
},
]
}
patchers = u.start_patch()
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message="Composite hostname test-cluster-very-"
"very-very-very-very-very-long-ng-name-"
"010.novalocal in provisioned cluster exceeds "
"maximum limit 64 characters")
u.stop_patch(patchers)
开发者ID:citrix-openstack-build,项目名称:sahara,代码行数:57,代码来源:test_cluster_scaling_validation.py
示例11: test_cluster_create_v_invalid_flavor
def test_cluster_create_v_invalid_flavor(self):
ng_id = self._create_node_group_template(flavor='10')
ctmpl_id = self._create_cluster_template(ng_id)
data = {
"name": "testname",
"plugin_name": "fake",
"hadoop_version": "0.1",
"cluster_template_id": '%s' % ctmpl_id,
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
data1 = {
"name": "testwithnodegroups",
"plugin_name": "fake",
"hadoop_version": "0.1",
"neutron_management_network": "d9a3bebc-f788-4b81-"
"9a93-aa048022c1ca",
"node_groups": [
{
"name": "allinone",
"count": 1,
"flavor_id": "10",
"node_processes": [
"namenode",
"resourcemanager",
"datanode",
"nodemanager"
]
}
],
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
for values in [data, data1]:
with testtools.ExpectedException(
exceptions.NotFoundException):
patchers = u.start_patch(False)
try:
c.check_cluster_create(values)
except exceptions.NotFoundException as e:
message = six.text_type(e).split('\n')[0]
self.assertEqual("Requested flavor '10' not found",
message)
raise e
finally:
u.stop_patch(patchers)
开发者ID:openstack,项目名称:sahara,代码行数:45,代码来源:test_cluster_create_validation.py
示例12: test_cluster_create_v_invalid_flavor
def test_cluster_create_v_invalid_flavor(self):
ng_id = self._create_node_group_template(flavor='10')
ctmpl_id = self._create_cluster_template(ng_id)
data = {
"name": "testname",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"cluster_template_id": '%s' % ctmpl_id,
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
data1 = {
"name": "testwithnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "1.2.1",
"node_groups": [
{
"name": "allinone",
"count": 1,
"flavor_id": "10",
"node_processes": [
"namenode",
"jobtracker",
"datanode",
"tasktracker"
]
}
],
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
for values in [data, data1]:
with testtools.ExpectedException(exceptions.InvalidException):
patchers = u.start_patch(False)
try:
c.check_cluster_create(values)
except exceptions.InvalidException as e:
message = six.text_type(e).split('\n')[0]
self.assertEqual("Requested flavor '10' not found",
message)
raise e
finally:
u.stop_patch(patchers)
开发者ID:degorenko,项目名称:sahara,代码行数:42,代码来源:test_cluster_create_validation.py
示例13: test_cluster_scaling_v_right_data
def test_cluster_scaling_v_right_data(self):
self._create_object_fun = c_s.check_cluster_scaling
data = {
'resize_node_groups': [
{
'name': 'ng',
'count': 4
}
],
'add_node_groups': [
{
'name': 'a',
'flavor_id': '42',
'node_processes': ['namenode'],
'count': 3
},
]
}
patchers = u.start_patch()
self._assert_cluster_scaling_validation(data=data)
u.stop_patch(patchers)
开发者ID:AspirinSJL,项目名称:sahara,代码行数:22,代码来源:test_cluster_scaling_validation.py
示例14: test_cluster_scaling_v_right_data
def test_cluster_scaling_v_right_data(self, ops):
ops.get_engine_type_and_version.return_value = "direct.1.1"
self._create_object_fun = c_s.check_cluster_scaling
data = {
'resize_node_groups': [
{
'name': 'ng',
'count': 4
}
],
'add_node_groups': [
{
'name': 'a',
'flavor_id': '42',
'node_processes': ['namenode'],
'count': 3
},
]
}
patchers = u.start_patch()
self._assert_cluster_scaling_validation(data=data)
u.stop_patch(patchers)
开发者ID:AlexanderYAPPO,项目名称:sahara,代码行数:23,代码来源:test_cluster_scaling_validation.py
示例15: test_cluster_create_v_correct_flavor
def test_cluster_create_v_correct_flavor(self):
ng_id = self._create_node_group_template(flavor='42')
ctmpl_id = self._create_cluster_template(ng_id)
data = {
"name": "testname",
"plugin_name": "vanilla",
"hadoop_version": "2.6.0",
"cluster_template_id": '%s' % ctmpl_id,
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
patchers = u.start_patch(False)
c.check_cluster_create(data)
u.stop_patch(patchers)
data1 = {
"name": "testwithnodegroups",
"plugin_name": "vanilla",
"hadoop_version": "2.6.0",
"node_groups": [
{
"name": "allinone",
"count": 1,
"flavor_id": "42",
"node_processes": [
"namenode",
"resourcemanager",
"datanode",
"nodemanager"
]
}
],
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
}
patchers = u.start_patch(False)
c.check_cluster_create(data1)
u.stop_patch(patchers)
开发者ID:zhangjunli177,项目名称:sahara,代码行数:37,代码来源:test_cluster_create_validation.py
示例16: tearDown
def tearDown(self):
u.stop_patch(self.patchers)
super(TestClusterCreateFlavorValidation, self).tearDown()
开发者ID:COSHPC,项目名称:sahara,代码行数:3,代码来源:test_cluster_create_validation.py
注:本文中的sahara.tests.unit.service.validation.utils.stop_patch函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论