summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/ibgp_router_test.py
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-01-25 14:42:33 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-01-27 20:48:42 +0900
commit5ea3cbdd9dc41e6dcf3c0258455a357e154efdb1 (patch)
tree6f331a98b035cb5d027ee556de6958064e19c25c /test/scenario_test/ibgp_router_test.py
parent38223f2f512cce3d05c9ae8f29ade983aa723cef (diff)
test/lib/Quagga: Use vtysh to add/del routes
Currently, to advertise or withdraw routes on QuaggaBGPContainer, we need to configure static routes in configure file and restart Quagga daemons. In other words, we can NOT send withdrawing advertisement from Quagga side. Also, restating Quagga daemons frequently can make scenario test unstable, and it should be avoided. This patch fixes to use "vtysh" and reduces the number of restating Quagga daemons. Note: According to this change, adding routes on Quagga should be called after starting daemons. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
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']