本文整理汇总了Python中pyvcloud.system_test_framework.environment.Environment.get_test_vapp_with_network方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.get_test_vapp_with_network方法的具体用法?Python Environment.get_test_vapp_with_network怎么用?Python Environment.get_test_vapp_with_network使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.system_test_framework.environment.Environment
的用法示例。
在下文中一共展示了Environment.get_test_vapp_with_network方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_test_vapp_with_network [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)
示例2: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_test_vapp_with_network [as 别名]
def test_0000_setup(self):
"""Load configuration and create a click runner to invoke CLI."""
VmTest._config = Environment.get_config()
VmTest._logger = Environment.get_default_logger()
VmTest._client = Environment.get_client_in_default_org(
CommonRoles.ORGANIZATION_ADMINISTRATOR)
VmTest._media_resource = Environment.get_test_media_resource()
VmTest._runner = CliRunner()
default_org = VmTest._config['vcd']['default_org_name']
VmTest._login(self)
VmTest._runner.invoke(org, ['use', default_org])
VmTest._test_vdc = Environment.get_test_vdc(VmTest._client)
VmTest._test_vapp = Environment.get_test_vapp_with_network(
VmTest._client)
VmTest._test_vm = VM(
VmTest._client,
href=VmTest._test_vapp.get_vm(VAppConstants.vm1_name).get('href'))
示例3: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_test_vapp_with_network [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)
示例4: test_0000_setup
# 需要导入模块: from pyvcloud.system_test_framework.environment import Environment [as 别名]
# 或者: from pyvcloud.system_test_framework.environment.Environment import get_test_vapp_with_network [as 别名]
def test_0000_setup(self):
TestVappDhcp._client = Environment.get_sys_admin_client()
vapp = Environment.get_test_vapp_with_network(TestVappDhcp._client)
self.assertIsNotNone(vapp)