summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/bgp_router_test.py
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-12 10:16:34 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-19 09:56:41 +0900
commit332766189685028c4f9852e4285fb1a9025223cc (patch)
treef04106d60bf45f578e7168d42d3dcf3d04be5fd5 /test/scenario_test/bgp_router_test.py
parent291d56f8df8213b77ff30b37abf2bee03ad45304 (diff)
server: send local withdrawal paths regardless of path calculation result
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/bgp_router_test.py')
-rw-r--r--test/scenario_test/bgp_router_test.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/scenario_test/bgp_router_test.py b/test/scenario_test/bgp_router_test.py
index 9486ac44..d5059e00 100644
--- a/test/scenario_test/bgp_router_test.py
+++ b/test/scenario_test/bgp_router_test.py
@@ -303,6 +303,7 @@ class GoBGPTestBase(unittest.TestCase):
self.assertTrue(paths[0]['nexthop'] in n_addrs)
q3.stop()
+ del self.quaggas['q3']
time.sleep(3)
@@ -310,6 +311,33 @@ class GoBGPTestBase(unittest.TestCase):
self.assertTrue(len(paths) == 1)
self.assertTrue(paths[0]['nexthop'] in n_addrs)
+ def test_18_check_withdrawal(self):
+ g1 = self.gobgp
+ q1 = self.quaggas['q1']
+ q2 = self.quaggas['q2']
+
+ g1.add_route('30.0.0.0/24')
+ q1.add_route('30.0.0.0/24')
+
+ self.test_01_neighbor_established()
+
+ self.test_02_check_gobgp_global_rib()
+
+ paths = g1.get_adj_rib_out(q1, '30.0.0.0/24')
+ self.assertTrue(len(paths) == 1)
+ self.assertTrue(paths[0]['source-id'] == '<nil>')
+ paths = g1.get_adj_rib_out(q2, '30.0.0.0/24')
+ self.assertTrue(len(paths) == 1)
+ self.assertTrue(paths[0]['source-id'] == '<nil>')
+
+ g1.local('gobgp global rib del 30.0.0.0/24')
+
+ paths = g1.get_adj_rib_out(q1, '30.0.0.0/24')
+ self.assertTrue(len(paths) == 0)
+ paths = g1.get_adj_rib_out(q2, '30.0.0.0/24')
+ self.assertTrue(len(paths) == 1)
+ self.assertTrue(paths[0]['source-id'] == '192.168.0.2')
+
if __name__ == '__main__':
if os.geteuid() is not 0: