diff options
Diffstat (limited to 'test/scenario_test')
-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'] |