diff options
Diffstat (limited to 'test/scenario_test/bgp_router_test.py')
-rw-r--r-- | test/scenario_test/bgp_router_test.py | 28 |
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: |