本文整理汇总了Python中robottelo.cli.discoveryrule.DiscoveryRule.info方法的典型用法代码示例。如果您正苦于以下问题:Python DiscoveryRule.info方法的具体用法?Python DiscoveryRule.info怎么用?Python DiscoveryRule.info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类robottelo.cli.discoveryrule.DiscoveryRule
的用法示例。
在下文中一共展示了DiscoveryRule.info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_positive_delete_rule_with_non_admin_user
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_delete_rule_with_non_admin_user(self):
"""Delete rule with non-admin user by associating discovery_manager role
:id: 87ab969b-7d92-478d-a5c0-1c0d50e9bdd6
:expectedresults: Rule should be deleted successfully.
:CaseLevel: Integration
"""
rule_name = gen_string('alpha')
rule = DiscoveryRule.with_user(
self.user['login'],
self.user['password']
).create({
u'name': rule_name,
u'search': 'cpu_count = 5',
u'organization-ids': self.org['id'],
u'location-ids': self.loc['id'],
u'hostgroup-id': self.hostgroup['id'],
})
rule = DiscoveryRule.with_user(
self.user['login'],
self.user['password']
).info({u'id': rule['id']})
DiscoveryRule.with_user(
self.user['login'],
self.user['password'],
).delete({u'id': rule['id']})
with self.assertRaises(CLIReturnCodeError):
DiscoveryRule.info({u'id': rule['id']})
示例2: test_positive_delete
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_delete(self):
"""Delete existing Discovery Rule
@id: c9b88a94-13c4-496f-a5c1-c088187250dc
@Assert: Rule should be successfully deleted
"""
rule = self._make_discoveryrule()
DiscoveryRule.delete({u'id': rule['id']})
with self.assertRaises(CLIReturnCodeError):
DiscoveryRule.info({u'id': rule['id']})
示例3: test_positive_delete
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_delete(self):
"""Delete existing Discovery Rule
:id: c9b88a94-13c4-496f-a5c1-c088187250dc
:expectedresults: Rule should be successfully deleted
:CaseImportance: Critical
"""
rule = self._make_discoveryrule()
DiscoveryRule.delete({u'id': rule['id']})
with self.assertRaises(CLIReturnCodeError):
DiscoveryRule.info({u'id': rule['id']})
示例4: test_positive_update_org_loc
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_org_loc(self):
"""Update org and location of selected discovery rule
:id: 26da79aa-30e5-4052-98ae-141de071a68a
:expectedresults: Rule was updated and with given org & location.
:BZ: 1377990
:CaseLevel: Integration
"""
new_org = make_org()
new_loc = make_location()
new_hostgroup = make_hostgroup({
'organization-ids': new_org['id'],
'location-ids': new_loc['id'],
})
rule = self._make_discoveryrule()
DiscoveryRule.update({
'id': rule['id'],
'organization-ids': new_org['id'],
'location-ids': new_loc['id'],
'hostgroup-id': new_hostgroup['id'],
})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertIn(new_org['name'], rule['organizations'])
self.assertIn(new_loc['name'], rule['locations'])
示例5: test_positive_update_name
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_name(self):
"""Update discovery rule name
@id: 1045e2c4-e1f7-42c9-95f7-488fc79bf70b
@Assert: Rule name is updated
"""
rule = self._make_discoveryrule()
new_name = gen_string('numeric')
DiscoveryRule.update({'id': rule['id'], 'name': new_name})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['name'], new_name)
示例6: test_positive_update_priority
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_priority(self):
"""Update discovery rule priority value
@id: 0543cc73-c692-4bbf-818b-37353ec98986
@Assert: Rule priority is updated
"""
rule = self._make_discoveryrule({u'priority': 100})
new_priority = '1'
DiscoveryRule.update({'id': rule['id'], 'priority': new_priority})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['priority'], new_priority)
示例7: test_positive_update_disable_enable
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_disable_enable(self):
"""Update discovery rule enabled state. (Disabled->Enabled)
@id: 64e8b21b-2ab0-49c3-a12d-02dbdb36647a
@Assert: Rule is successfully enabled
"""
rule = self._make_discoveryrule({u'enabled': 'false'})
self.assertEqual(rule['enabled'], 'false')
DiscoveryRule.update({'id': rule['id'], 'enabled': 'true'})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['enabled'], 'true')
示例8: test_positive_update_limit
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_limit(self):
"""Update discovery rule limit value
@id: efa6f5bc-4d56-4449-90f5-330affbcfb09
@Assert: Rule host limit field is updated
"""
rule = self._make_discoveryrule({u'hosts-limit': '5'})
new_limit = '10'
DiscoveryRule.update({'id': rule['id'], 'hosts-limit': new_limit})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['hosts-limit'], new_limit)
示例9: test_positive_update_hostname
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_hostname(self):
"""Update discovery rule hostname value
@id: 4c123488-92df-42f6-afe3-8a88cd90ffc2
@Assert: Rule host name is updated
"""
new_hostname = gen_string('alpha')
rule = self._make_discoveryrule()
DiscoveryRule.update({'id': rule['id'], 'hostname': new_hostname})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['hostname-template'], new_hostname)
示例10: test_positive_update_query
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_query(self):
"""Update discovery rule search query
@id: 86943095-acc5-40ff-8e3c-88c76b36333d
@Assert: Rule search field is updated
"""
rule = self._make_discoveryrule()
new_query = 'model = KVM'
DiscoveryRule.update({'id': rule['id'], 'search': new_query})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['search'], new_query)
示例11: test_positive_update_disable_enable
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_disable_enable(self):
"""Update discovery rule enabled state. (Disabled->Enabled)
:id: 64e8b21b-2ab0-49c3-a12d-02dbdb36647a
:expectedresults: Rule is successfully enabled
:CaseImportance: Critical
"""
rule = self._make_discoveryrule({u'enabled': 'false'})
self.assertEqual(rule['enabled'], 'false')
DiscoveryRule.update({'id': rule['id'], 'enabled': 'true'})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['enabled'], 'true')
示例12: test_positive_update_priority
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_priority(self):
"""Update discovery rule priority value
:id: 0543cc73-c692-4bbf-818b-37353ec98986
:expectedresults: Rule priority is updated
:CaseImportance: Critical
"""
rule = self._make_discoveryrule({u'priority': 100})
new_priority = '1'
DiscoveryRule.update({'id': rule['id'], 'priority': new_priority})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['priority'], new_priority)
示例13: test_positive_update_limit
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_limit(self):
"""Update discovery rule limit value
:id: efa6f5bc-4d56-4449-90f5-330affbcfb09
:expectedresults: Rule host limit field is updated
:CaseImportance: Critical
"""
rule = self._make_discoveryrule({u'hosts-limit': '5'})
new_limit = '10'
DiscoveryRule.update({'id': rule['id'], 'hosts-limit': new_limit})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['hosts-limit'], new_limit)
示例14: test_positive_update_hostname
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_hostname(self):
"""Update discovery rule hostname value
:id: 4c123488-92df-42f6-afe3-8a88cd90ffc2
:expectedresults: Rule host name is updated
:CaseImportance: Critical
"""
new_hostname = gen_string('alpha')
rule = self._make_discoveryrule()
DiscoveryRule.update({'id': rule['id'], 'hostname': new_hostname})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['hostname-template'], new_hostname)
示例15: test_positive_update_query
# 需要导入模块: from robottelo.cli.discoveryrule import DiscoveryRule [as 别名]
# 或者: from robottelo.cli.discoveryrule.DiscoveryRule import info [as 别名]
def test_positive_update_query(self):
"""Update discovery rule search query
:id: 86943095-acc5-40ff-8e3c-88c76b36333d
:expectedresults: Rule search field is updated
:CaseImportance: Critical
"""
rule = self._make_discoveryrule()
new_query = 'model = KVM'
DiscoveryRule.update({'id': rule['id'], 'search': new_query})
rule = DiscoveryRule.info({'id': rule['id']})
self.assertEqual(rule['search'], new_query)