本文整理汇总了Python中lib.gobgp.GoBGPContainer.wait_for方法的典型用法代码示例。如果您正苦于以下问题:Python GoBGPContainer.wait_for方法的具体用法?Python GoBGPContainer.wait_for怎么用?Python GoBGPContainer.wait_for使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.gobgp.GoBGPContainer
的用法示例。
在下文中一共展示了GoBGPContainer.wait_for方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_05_check_remove_private_as_peer_all
# 需要导入模块: from lib.gobgp import GoBGPContainer [as 别名]
# 或者: from lib.gobgp.GoBGPContainer import wait_for [as 别名]
def test_05_check_remove_private_as_peer_all(self):
g3 = GoBGPContainer(name='g3', asn=100, router_id='192.168.0.4',
ctn_image_name=parser_option.gobgp_image,
log_level=parser_option.gobgp_log_level)
g4 = GoBGPContainer(name='g4', asn=200, router_id='192.168.0.5',
ctn_image_name=parser_option.gobgp_image,
log_level=parser_option.gobgp_log_level)
time.sleep(max(ctn.run() for ctn in [g3, g4]))
self.ctns['g3'] = g3
self.ctns['g4'] = g4
self.g2.add_peer(g3)
g3.add_peer(self.g2)
g3.add_peer(g4, remove_private_as='all')
g4.add_peer(g3)
self.g2.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=g3)
g3.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=g4)
def f():
rib = g4.get_global_rib()
self.assertEqual(len(rib), 1)
self.assertEqual(len(rib[0]['paths']), 1)
self.assertEqual(rib[0]['paths'][0]['aspath'], [100])
assert_several_times(f)