本文整理汇总了Python中lib.gobgp.GoBGPContainer.run方法的典型用法代码示例。如果您正苦于以下问题:Python GoBGPContainer.run方法的具体用法?Python GoBGPContainer.run怎么用?Python GoBGPContainer.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.gobgp.GoBGPContainer
的用法示例。
在下文中一共展示了GoBGPContainer.run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_15_check_active_connection
# 需要导入模块: from lib.gobgp import GoBGPContainer [as 别名]
# 或者: from lib.gobgp.GoBGPContainer import run [as 别名]
def test_15_check_active_connection(self):
g1 = self.gobgp
g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.7',
ctn_image_name=self.gobgp.image,
log_level=parser_option.gobgp_log_level)
time.sleep(g2.run())
self.quaggas['g2'] = g2
g2.add_peer(g1, passive=True)
g1.add_peer(g2)
g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=g2)
示例2: test_07_check_replace_peer_as
# 需要导入模块: from lib.gobgp import GoBGPContainer [as 别名]
# 或者: from lib.gobgp.GoBGPContainer import run [as 别名]
def test_07_check_replace_peer_as(self):
g5 = GoBGPContainer(name='g5', asn=100, router_id='192.168.0.6',
ctn_image_name=parser_option.gobgp_image,
log_level=parser_option.gobgp_log_level)
time.sleep(g5.run())
g4 = self.ctns['g4']
g4.add_peer(g5, replace_peer_as=True)
g5.add_peer(g4)
g4.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=g5)
time.sleep(1)
self.assertTrue(g5.get_global_rib()[0]['paths'][0]['aspath'] == [200, 200, 200, 200, 200])
示例3: test_04_add_non_graceful_restart_enabled_peer
# 需要导入模块: from lib.gobgp import GoBGPContainer [as 别名]
# 或者: from lib.gobgp.GoBGPContainer import run [as 别名]
def test_04_add_non_graceful_restart_enabled_peer(self):
g1 = self.bgpds['g1']
# g2 = self.bgpds['g2']
gobgp_ctn_image_name = parser_option.gobgp_image
g3 = GoBGPContainer(name='g3', asn=65002, router_id='192.168.0.3',
ctn_image_name=gobgp_ctn_image_name,
log_level=parser_option.gobgp_log_level)
self.bgpds['g3'] = g3
time.sleep(g3.run())
g3.add_route('10.10.30.0/24')
g1.add_peer(g3)
g3.add_peer(g1)
g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=g3)
time.sleep(1)
self.assertTrue(len(g3.get_global_rib('10.10.20.0/24')) == 1)