本文整理汇总了Python中marvin.lib.base.Router.start方法的典型用法代码示例。如果您正苦于以下问题:Python Router.start方法的具体用法?Python Router.start怎么用?Python Router.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marvin.lib.base.Router
的用法示例。
在下文中一共展示了Router.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_08_create_policy_router_stopped
# 需要导入模块: from marvin.lib.base import Router [as 别名]
# 或者: from marvin.lib.base.Router import start [as 别名]
def test_08_create_policy_router_stopped(self):
"""Test verify create stickiness policy when router is stopped state"""
# Validate the following
# 1. stop the router
# 2. create stikiness policy from UI
# 3. start the router. listLBStickinessPolicies Api should show created
# stikiness policy
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)
self.debug("Stopping the router: %s" % router.name)
Router.stop(self.apiclient, id=router.id)
policies = self.configure_Stickiness_Policy(lb_rule, method="LbCookie")
policy = policies.stickinesspolicy[0]
self.debug("Starting the router: %s" % router.name)
Router.start(self.apiclient, id=router.id)
self.debug("Policy: %s" % str(policy))
self.debug("Validating the stickiness policy")
self.validate_Stickiness_Policy(lb_rule, "LbCookie", self.public_ip.ipaddress.ipaddress)
return
示例2: test_07_stop_start_VR_verify_ip_alias
# 需要导入模块: from marvin.lib.base import Router [as 别名]
# 或者: from marvin.lib.base.Router import start [as 别名]
def test_07_stop_start_VR_verify_ip_alias(self):
"""Reboot VR and verify ip alias
1.Deploy guest vm in new cidr
2.Verify ip alias creation
3.Stop and Start VR
4.Verify ip alias on VR
"""
list_router_response = list_routers(
self.apiclient,
zoneid=self.zone.id,
listall=True
)
self.assertEqual(
isinstance(list_router_response, list),
True,
"Check list response returns a valid list"
)
router = list_router_response[0]
hosts = list_hosts(
self.apiclient,
zoneid=router.zoneid,
type='Routing',
state='Up',
id=router.hostid
)
self.assertEqual(
isinstance(hosts, list),
True,
"Check list host returns a valid list"
)
host = hosts[0]
self.debug("Router ID: %s, state: %s" % (router.id, router.state))
self.assertEqual(
router.state,
'Running',
"Check list router response for router state"
)
port = self.testdata['configurableData']['host']["publicport"]
username = self.testdata['configurableData']['host']["username"]
password = self.testdata['configurableData']['host']["password"]
# SSH to host so that host key is saved in first
# attempt
SshClient(host.ipaddress, port, username, password)
proc = "ip addr show eth0"
result = get_process_status(
host.ipaddress,
port,
username,
password,
router.linklocalip,
proc
)
res = str(result)
self.debug("ip alias configuration on VR: %s" % res)
self.assertNotEqual(
res.find(self.alias_ip)
- 1,
"ip alias is not created on VR eth0"
)
self.debug("Stopping VR")
Router.stop(
self.apiclient,
router.id,
)
self.debug("Starting VR")
Router.start(
self.apiclient,
router.id
)
list_router_response = list_routers(
self.apiclient,
zoneid=self.zone.id,
listall=True
)
self.assertEqual(
isinstance(list_router_response, list),
True,
"Check list response returns a valid list"
)
router = list_router_response[0]
self.assertEqual(
router.state,
'Running',
"Router is not in running state after reboot"
)
self.debug("VR is up and Running")
result = get_process_status(
host.ipaddress,
port,
username,
password,
router.linklocalip,
proc
)
res = str(result)
self.assertNotEqual(
res.find(self.alias_ip),
#.........这里部分代码省略.........