summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/bgp_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/bgp_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/bgp_router_test.py')
-rw-r--r--test/scenario_test/bgp_router_test.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/test/scenario_test/bgp_router_test.py b/test/scenario_test/bgp_router_test.py
index 1a92a1b3..7d93ba53 100644
--- a/test/scenario_test/bgp_router_test.py
+++ b/test/scenario_test/bgp_router_test.py
@@ -59,21 +59,17 @@ class GoBGPTestBase(unittest.TestCase):
qs = [q1, q2, q3]
ctns = [g1, q1, q2, q3]
- # advertise a route from q1, q2, q3
- for idx, q in enumerate(qs):
- route = '10.0.{0}.0/24'.format(idx + 1)
- q.add_route(route)
-
initial_wait_time = max(ctn.run() for ctn in ctns)
-
time.sleep(initial_wait_time)
for q in qs:
- g1.add_peer(q, reload_config=False, passwd='passwd')
+ g1.add_peer(q, passwd='passwd')
q.add_peer(g1, passwd='passwd', passive=True)
- g1.create_config()
- g1.reload_config()
+ # advertise a route from q1, q2, q3
+ for idx, q in enumerate(qs):
+ route = '10.0.{0}.0/24'.format(idx + 1)
+ q.add_route(route)
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2, 'q3': q3}
@@ -145,14 +141,14 @@ class GoBGPTestBase(unittest.TestCase):
def test_05_add_quagga(self):
q4 = QuaggaBGPContainer(name='q4', asn=65004, router_id='192.168.0.5')
self.quaggas['q4'] = q4
-
- q4.add_route('10.0.4.0/24')
-
initial_wait_time = q4.run()
time.sleep(initial_wait_time)
+
self.gobgp.add_peer(q4)
q4.add_peer(self.gobgp)
+ q4.add_route('10.0.4.0/24')
+
self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q4)
def test_06_check_global_rib(self):