summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-03-31 15:29:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-03-31 16:36:27 +0900
commite6682c52ba3e09c4111bc94c938909cdcacd7d72 (patch)
tree8c77697343742e300c5302a7b7adbeb52e9d6eb1 /test/scenario_test
parent0bd939e92677a03436d7b7f2ec97e953d736464b (diff)
server: update path-attributes when peer is disconnected
close #807 also add a test to check this issue is fixed Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test')
-rw-r--r--test/scenario_test/bgp_router_test.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/scenario_test/bgp_router_test.py b/test/scenario_test/bgp_router_test.py
index dd7c1edb..9486ac44 100644
--- a/test/scenario_test/bgp_router_test.py
+++ b/test/scenario_test/bgp_router_test.py
@@ -251,7 +251,7 @@ class GoBGPTestBase(unittest.TestCase):
def test_15_check_active_connection(self):
g1 = self.gobgp
- g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.5',
+ g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.7',
ctn_image_name=self.gobgp.image,
log_level=parser_option.gobgp_log_level)
time.sleep(g2.run())
@@ -285,6 +285,32 @@ class GoBGPTestBase(unittest.TestCase):
med = extract_path_attribute(path, BGP_ATTR_TYPE_MULTI_EXIT_DISC)
self.assertTrue(med['metric'] == 2000)
+ def test_17_check_shutdown(self):
+ q1 = self.quaggas['q1']
+ q2 = self.quaggas['q2']
+ q3 = self.quaggas['q3']
+
+ q2.add_route('20.0.0.0/24')
+ q3.add_route('20.0.0.0/24')
+
+ self.test_01_neighbor_established()
+
+ self.test_02_check_gobgp_global_rib()
+
+ paths = q1.get_global_rib('20.0.0.0/24')
+ self.assertTrue(len(paths) == 1)
+ n_addrs = [i[1].split('/')[0] for i in self.gobgp.ip_addrs]
+ self.assertTrue(paths[0]['nexthop'] in n_addrs)
+
+ q3.stop()
+
+ time.sleep(3)
+
+ paths = q1.get_global_rib('20.0.0.0/24')
+ self.assertTrue(len(paths) == 1)
+ self.assertTrue(paths[0]['nexthop'] in n_addrs)
+
+
if __name__ == '__main__':
if os.geteuid() is not 0:
print "you are not root."