From aef984c85c81af35aa83e334dbd834d214f9a628 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 28 May 2018 22:25:52 +0900 Subject: test/aspath: check accepted and received numbers make sure that an adj-rib return the accepted and received numbers when it has an as-looped path. Signed-off-by: FUJITA Tomonori --- test/scenario_test/aspath_test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/scenario_test/aspath_test.py b/test/scenario_test/aspath_test.py index 5f6b42a8..bd9f107a 100644 --- a/test/scenario_test/aspath_test.py +++ b/test/scenario_test/aspath_test.py @@ -73,7 +73,12 @@ class GoBGPTestBase(unittest.TestCase): def test_02_check_reject_as_loop(self): def f(): - self.assertEqual(len(self.g2.get_global_rib()), 0) + adj = self.g2.get_neighbor(self.q1)['state']['adj-table'] + self.assertTrue('received' in adj) + self.assertEqual(adj['received'], 1) + # hacky. 'accepted' is zero so the key was deleted due to + # omitempty tag in bgp_configs.go. + self.assertFalse('accepted' in adj) assert_several_times(f) -- cgit v1.2.3