本文整理汇总了Python中marvin.lib.base.Router.destroy方法的典型用法代码示例。如果您正苦于以下问题:Python Router.destroy方法的具体用法?Python Router.destroy怎么用?Python Router.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marvin.lib.base.Router
的用法示例。
在下文中一共展示了Router.destroy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_09_create_policy_router_destroy
# 需要导入模块: from marvin.lib.base import Router [as 别名]
# 或者: from marvin.lib.base.Router import destroy [as 别名]
def test_09_create_policy_router_destroy(self):
"""Test check the stickiness policy rules after destroying router"""
# Validate the following
# 1. create an account
# 2. using that account,create an instances
# 3. select the Source NAT IP and configure the stikiness policy
# 4. destroy the router.
self.debug("Creating LB rule for account: %s" % self.account.name)
lb_rule = self.create_LB_Rule(
self.public_ip,
network=self.get_Network(self.account),
vmarray=[self.virtual_machine, self.virtual_machine_2],
)
self.debug("Fetching routers for the account: %s" % self.account.name)
router = self.get_router(self.account)
policies = self.configure_Stickiness_Policy(lb_rule, method="LbCookie")
policy = policies.stickinesspolicy[0]
self.debug("Policy: %s" % str(policy))
self.debug("Validating the stickiness policy")
self.validate_Stickiness_Policy(lb_rule, "LbCookie", self.public_ip.ipaddress.ipaddress)
self.debug("Destroying the router: %s" % router.name)
Router.destroy(self.apiclient, id=router.id)
return
示例2: _disable_zone_and_delete_system_vms
# 需要导入模块: from marvin.lib.base import Router [as 别名]
# 或者: from marvin.lib.base.Router import destroy [as 别名]
def _disable_zone_and_delete_system_vms(self, virtual_router, verify_managed_system_vm_deleted=True):
self.zone.update(self.apiClient, id=self.zone.id, allocationstate="Disabled")
if virtual_router is not None:
Router.destroy(self.apiClient, virtual_router.id)
if verify_managed_system_vm_deleted:
cs_root_volume = self._get_root_volume_for_system_vm(virtual_router.id, 'Expunged')
self._verify_managed_system_vm_deleted(cs_root_volume.name)
# list_ssvms lists the secondary storage VM and the console proxy VM
system_vms = list_ssvms(self.apiClient)
for system_vm in system_vms:
destroy_ssvm_cmd = destroySystemVm.destroySystemVmCmd()
destroy_ssvm_cmd.id = system_vm.id
self.apiClient.destroySystemVm(destroy_ssvm_cmd)
if verify_managed_system_vm_deleted:
cs_root_volume = self._get_root_volume_for_system_vm(system_vm.id, 'Expunged')
self._verify_managed_system_vm_deleted(cs_root_volume.name)
示例3: test_05_destroy_router_after_addition_of_one_guest_network
# 需要导入模块: from marvin.lib.base import Router [as 别名]
# 或者: from marvin.lib.base.Router import destroy [as 别名]
def test_05_destroy_router_after_addition_of_one_guest_network(self):
""" Test destroy of router after addition of one guest network
"""
# Validations
# 1. Create a VPC with cidr - 10.1.1.1/16
# 2. Add network1(10.1.1.1/24) to this VPC.
# 3. Deploy vm1,vm2 and vm3 such that they are part of network1.
# 4. Create a PF /Static Nat/LB rule for vms in network1.
# 5. Create ingress network ACL for allowing all the above rules from a public ip range on network1.
# 6. Create egress network ACL for network1 to access google.com.
# 7. Create a private gateway for this VPC and add a static route to this gateway.
# 8. Create a VPN gateway for this VPC and add a static route to this gateway.
# 9. Make sure that all the PF,LB and Static NAT rules work as expected.
# 10. Make sure that we are able to access google.com from all the user Vms.
# 11. Make sure that the newly added private gateway's and VPN
# gateway's static routes work as expected
self.validate_vpc_offering(self.vpc_off)
self.validate_vpc_network(self.vpc)
self.assertEqual(
isinstance(self.gateways, list),
True,
"List private gateways should return a valid response"
)
self.assertEqual(
isinstance(self.static_routes, list),
True,
"List static route should return a valid response"
)
routers = Router.list(
self.api_client,
account=self.account.name,
domainid=self.account.domainid,
listall=True
)
self.assertEqual(
isinstance(routers, list),
True,
"List Routers should return a valid list"
)
Router.destroy(self.api_client,
id=routers[0].id
)
routers = Router.list(
self.api_client,
account=self.account.name,
domainid=self.account.domainid,
listall=True
)
self.assertEqual(
isinstance(routers, list),
False,
"List Routers should be empty"
)
return
示例4: test_05_destroy_router_after_creating_vpc
# 需要导入模块: from marvin.lib.base import Router [as 别名]
# 或者: from marvin.lib.base.Router import destroy [as 别名]
def test_05_destroy_router_after_creating_vpc(self):
""" Test to destroy the router after creating a VPC
"""
# Validate the following
# 1. Create a VPC with cidr - 10.1.1.1/16
# 2. Destroy the VPC Virtual Router which is created as a result of VPC
# creation.
self.validate_vpc_offering(self.vpc_off)
self.validate_vpc_network(self.vpc)
routers = Router.list(
self.api_client,
account=self.account.name,
domainid=self.account.domainid,
listall=True
)
self.assertEqual(
isinstance(routers, list),
True,
"List Routers should return a valid list"
)
Router.destroy(self.api_client,
id=routers[0].id
)
routers = Router.list(
self.api_client,
account=self.account.name,
domainid=self.account.domainid,
listall=True
)
self.assertEqual(
isinstance(routers, list),
False,
"List Routers should be empty"
)
return
示例5: test_restart_network_with_destroyed_masterVR
# 需要导入模块: from marvin.lib.base import Router [as 别名]
# 或者: from marvin.lib.base.Router import destroy [as 别名]
def test_restart_network_with_destroyed_masterVR(self):
"""Test restarting RvR network without cleanup after destroying master VR
"""
# Steps to validate
# 1. createNetwork using network offering for redundant virtual router
# 2. listRouters in above network
# 3. deployVM in above user account in the created network
# 4. Destroy master VR
# 5. restartNetwork cleanup=false
# 6. Verify RVR status after network restart
# Creating network using the network offering created
self.debug("Creating network with network offering: %s" %
self.network_offering.id)
network = Network.create(
self.apiclient,
self.services["network"],
accountid=self.account.name,
domainid=self.account.domainid,
networkofferingid=self.network_offering.id,
zoneid=self.zone.id
)
self.debug("Created network with ID: %s" % network.id)
networks = Network.list(
self.apiclient,
id=network.id,
listall=True
)
self.assertEqual(
validateList(networks)[0],
PASS,
"List networks should return a valid response for created network"
)
self.debug("Deploying VM in account: %s" % self.account.name)
# Spawn an instance in that network
virtual_machine = VirtualMachine.create(
self.apiclient,
self.services["virtual_machine"],
accountid=self.account.name,
domainid=self.account.domainid,
serviceofferingid=self.service_offering.id,
networkids=[str(network.id)]
)
self.debug("Deployed VM in network: %s" % network.id)
vms = VirtualMachine.list(
self.apiclient,
id=virtual_machine.id,
listall=True
)
self.assertEqual(
validateList(vms)[0],
PASS,
"List Vms should return a valid list"
)
vm = vms[0]
self.assertEqual(
vm.state,
"Running",
"Vm should be in running state after deployment"
)
self.debug("Listing routers for network: %s" % network.name)
routers = Router.list(
self.apiclient,
networkid=network.id,
listall=True
)
self.assertEqual(
validateList(routers)[0],
PASS,
"list router should return Master and backup routers"
)
self.assertEqual(
len(routers),
2,
"Length of the list router should be 2 (Backup & master)"
)
if routers[0].redundantstate == 'MASTER' and\
routers[1].redundantstate == 'BACKUP':
master_router = routers[0]
backup_router = routers[1]
elif routers[1].redundantstate == 'MASTER' and \
routers[0].redundantstate == 'BACKUP':
master_router = routers[1]
backup_router = routers[0]
else:
self.fail("Both the routers in RVR are in BackupState")
Router.stop(
self.apiclient,
id=master_router.id
)
Router.destroy(
self.apiclient,
id=master_router.id
)
masterVR = Router.list(
self.apiclient,
#.........这里部分代码省略.........