summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-28 22:25:52 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-05-28 22:25:52 +0900
commitaef984c85c81af35aa83e334dbd834d214f9a628 (patch)
treebcb72d3328e1aaf2ccb7d27715e56341b392cc6f /test
parent503d043c625cd19eebd9d29337d2999fe9d2313a (diff)
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 <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'test')
-rw-r--r--test/scenario_test/aspath_test.py7
1 files changed, 6 insertions, 1 deletions
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)