summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/ibgp_router_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/scenario_test/ibgp_router_test.py')
-rw-r--r--test/scenario_test/ibgp_router_test.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/scenario_test/ibgp_router_test.py b/test/scenario_test/ibgp_router_test.py
index ed476122..59815e6e 100644
--- a/test/scenario_test/ibgp_router_test.py
+++ b/test/scenario_test/ibgp_router_test.py
@@ -51,13 +51,7 @@ class GoBGPTestBase(unittest.TestCase):
qs = [q1, q2]
ctns = [g1, q1, q2]
- # advertise a route from q1, q2
- for idx, c in enumerate(qs):
- route = '10.0.{0}.0/24'.format(idx + 1)
- c.add_route(route)
-
initial_wait_time = max(ctn.run() for ctn in ctns)
-
time.sleep(initial_wait_time)
# ibgp peer. loop topology
@@ -65,6 +59,11 @@ class GoBGPTestBase(unittest.TestCase):
a.add_peer(b)
b.add_peer(a)
+ # advertise a route from q1, q2
+ for idx, c in enumerate(qs):
+ route = '10.0.{0}.0/24'.format(idx + 1)
+ c.add_route(route)
+
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2}
@@ -163,14 +162,14 @@ class GoBGPTestBase(unittest.TestCase):
def test_07_add_ebgp_peer(self):
q3 = QuaggaBGPContainer(name='q3', asn=65001, router_id='192.168.0.4')
self.quaggas['q3'] = q3
-
- q3.add_route('10.0.3.0/24')
-
initial_wait_time = q3.run()
time.sleep(initial_wait_time)
+
self.gobgp.add_peer(q3)
q3.add_peer(self.gobgp)
+ q3.add_route('10.0.3.0/24')
+
self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q3)
def test_08_check_global_rib(self):
@@ -246,15 +245,15 @@ class GoBGPTestBase(unittest.TestCase):
def test_15_add_ebgp_peer(self):
q4 = QuaggaBGPContainer(name='q4', asn=65001, router_id='192.168.0.5')
self.quaggas['q4'] = q4
-
- prefix = '10.0.4.0/24'
- q4.add_route(prefix)
-
initial_wait_time = q4.run()
time.sleep(initial_wait_time)
+
self.gobgp.add_peer(q4)
q4.add_peer(self.gobgp)
+ prefix = '10.0.4.0/24'
+ q4.add_route(prefix)
+
self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q4)
q1 = self.quaggas['q1']