本文整理匯總了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)