本文整理汇总了Python中pyvcloud.system_test_framework.environment.Environment.get_default_orgvdc_network_name方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.get_default_orgvdc_network_name方法的具体用法?Python Environment.get_default_orgvdc_network_name怎么用?Python Environment.get_default_orgvdc_network_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.system_test_framework.environment.Environment
的用法示例。
在下文中一共展示了Environment.get_default_orgvdc_network_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_0060_vapp_network_connection
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_default_orgvdc_network_name [as 别名]
def test_0060_vapp_network_connection(self):
"""Test vapp.connect/disconnect_org_vdc_network().
This test passes if the connect and disconnect to orgvdc network
operations are successful.
"""
logger = Environment.get_default_logger()
network_name = Environment.get_default_orgvdc_network_name()
vapp_name = TestVApp._customized_vapp_name
vapp = Environment.get_vapp_in_test_vdc(
client=TestVApp._client, vapp_name=vapp_name)
logger.debug('Connecting vApp ' + vapp_name + ' to orgvdc network ' +
network_name)
task = vapp.connect_org_vdc_network(network_name)
result = TestVApp._client.get_task_monitor().wait_for_success(task)
self.assertEqual(result.get('status'), TaskStatus.SUCCESS.value)
logger.debug('Disconnecting vApp ' + vapp_name +
' to orgvdc network ' + network_name)
vapp.reload()
task = vapp.disconnect_org_vdc_network(network_name)
result = TestVApp._client.get_task_monitor().wait_for_success(task)
self.assertEqual(result.get('status'), TaskStatus.SUCCESS.value)
示例2: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_default_orgvdc_network_name [as 别名]
def test_0000_setup(self):
TestVappFirewall._client = Environment.get_sys_admin_client()
vapp = Environment.get_test_vapp_with_network(TestVappFirewall._client)
vapp.reload()
TestVappFirewall._network_name = \
Environment.get_default_orgvdc_network_name()
task = vapp.connect_org_vdc_network(
TestVappFirewall._network_name,
fence_mode=FenceMode.NAT_ROUTED.value)
result = TestVappFirewall._client.get_task_monitor().wait_for_success(
task)
self.assertEqual(result.get('status'), TaskStatus.SUCCESS.value)
示例3: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_default_orgvdc_network_name [as 别名]
def test_0000_setup(self):
self._config = Environment.get_config()
TestVappFirewall._logger = Environment.get_default_logger()
TestVappFirewall._client = Environment.get_sys_admin_client()
TestVappFirewall._runner = CliRunner()
default_org = self._config['vcd']['default_org_name']
self._login()
TestVappFirewall._runner.invoke(org, ['use', default_org])
vapp = Environment.get_test_vapp_with_network(TestVappFirewall._client)
vapp.reload()
TestVappFirewall._vapp_network_name = \
Environment.get_default_orgvdc_network_name()
task = vapp.connect_org_vdc_network(
TestVappFirewall._vapp_network_name,
fence_mode=FenceMode.NAT_ROUTED.value)
result = TestVappFirewall._client.get_task_monitor().wait_for_success(
task)
self.assertEqual(result.get('status'), TaskStatus.SUCCESS.value)