diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-05-30 11:57:22 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-05-30 12:58:07 +0900 |
commit | e84ed701c02e2d834d3db23098b3b4c319d9b61a (patch) | |
tree | e55c37ab8c23fc9bd78646b1d6260d62b5ded596 /test/scenario_test/graceful_restart_test.py | |
parent | 57e87d41a867d9a2961c9e0aa2191a0c815a8b09 (diff) |
graceful_restart_test: Confirm stale paths removed
This patch adds checks to confirm the stale paths are also removed from
the adj-RIB-in table.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/scenario_test/graceful_restart_test.py')
-rw-r--r-- | test/scenario_test/graceful_restart_test.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/test/scenario_test/graceful_restart_test.py b/test/scenario_test/graceful_restart_test.py index 2c5c2049..ab2eec1e 100644 --- a/test/scenario_test/graceful_restart_test.py +++ b/test/scenario_test/graceful_restart_test.py @@ -72,12 +72,19 @@ class GoBGPTestBase(unittest.TestCase): g2 = self.bgpds['g2'] g1.stop_gobgp() g2.wait_for(expected_state=BGP_FSM_ACTIVE, peer=g1) - self.assertTrue(len(g2.get_global_rib('10.10.20.0/24')) == 1) - self.assertTrue(len(g2.get_global_rib('10.10.10.0/24')) == 1) + self.assertEqual(len(g2.get_global_rib('10.10.20.0/24')), 1) + self.assertEqual(len(g2.get_global_rib('10.10.10.0/24')), 1) for d in g2.get_global_rib(): for p in d['paths']: self.assertTrue(p['stale']) + # Confirm the paths on the adj-RIB-in table are synced with the Global + # table. + self.assertEqual(len(g2.get_adj_rib_in(g1, '10.10.20.0/24')), 1) + self.assertEqual(len(g2.get_adj_rib_in(g1, '10.10.10.0/24')), 1) + for p in g2.get_adj_rib_in(g1): + self.assertTrue(p['stale']) + g1.routes = {} g1.start_gobgp(graceful_restart=True) g1.add_route('10.10.20.0/24') @@ -95,12 +102,19 @@ class GoBGPTestBase(unittest.TestCase): '0') time.sleep(1) - self.assertTrue(len(g2.get_global_rib('10.10.20.0/24')) == 1) - self.assertTrue(len(g2.get_global_rib('10.10.10.0/24')) == 0) + self.assertEqual(len(g2.get_global_rib('10.10.20.0/24')), 1) + self.assertEqual(len(g2.get_global_rib('10.10.10.0/24')), 0) for d in g2.get_global_rib(): for p in d['paths']: self.assertFalse(p.get('stale', False)) + # Confirm the stale paths are also removed from the adj-RIB-in table. + # https://github.com/osrg/gobgp/pull/1707 + self.assertEqual(len(g2.get_adj_rib_in(g1, '10.10.20.0/24')), 1) + self.assertEqual(len(g2.get_adj_rib_in(g1, '10.10.10.0/24')), 0) + for p in g2.get_adj_rib_in(g1): + self.assertFalse(p.get('stale', False)) + def test_04_add_non_graceful_restart_enabled_peer(self): g1 = self.bgpds['g1'] # g2 = self.bgpds['g2'] |