本文整理汇总了Python中tempest.test.attr方法的典型用法代码示例。如果您正苦于以下问题:Python test.attr方法的具体用法?Python test.attr怎么用?Python test.attr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tempest.test
的用法示例。
在下文中一共展示了test.attr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_backend_name_distinction
# 需要导入模块: from tempest import test [as 别名]
# 或者: from tempest.test import attr [as 别名]
def test_backend_name_distinction(self):
# this test checks that the two volumes created at setUp don't
# belong to the same backend (if they are, than the
# volume backend distinction is not working properly)
if self.backend1_name == self.backend2_name:
raise self.skipException("backends configured with same name")
resp, volume = self.volume_client.get_volume(self.volume1['id'])
volume1_host = volume['os-vol-host-attr:host']
resp, volume = self.volume_client.get_volume(self.volume2['id'])
volume2_host = volume['os-vol-host-attr:host']
msg = ("volumes %s and %s were created in the same backend" %
(self.volume1['id'], self.volume2['id']))
self.assertNotEqual(volume1_host, volume2_host, msg)
示例2: test_backend_name_reporting
# 需要导入模块: from tempest import test [as 别名]
# 或者: from tempest.test import attr [as 别名]
def test_backend_name_reporting(self):
# this test checks if os-vol-attr:host is populated correctly after
# the multi backend feature has been enabled
# if multi-backend is enabled: os-vol-attr:host should be like:
# [email protected]_name
resp, volume = self.volume_client.get_volume(self.volume1['id'])
self.assertEqual(200, resp.status)
volume1_host = volume['os-vol-host-attr:host']
msg = ("multi-backend reporting incorrect values for volume %s" %
self.volume1['id'])
self.assertTrue(len(volume1_host.split("@")) > 1, msg)