diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-02-02 16:33:32 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-02-02 16:33:32 +0900 |
commit | 336b32f96b2eba474108a94ada498c42f55ae62b (patch) | |
tree | 724f3964fa0c1495a6b76f5ddcfb57d993436e53 /test/scenario_test | |
parent | e849b95b11762383c922a3abaf547dfd0f15ba54 (diff) |
test: check 'gobgp neighbor add softresetin' working
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test')
-rw-r--r-- | test/scenario_test/route_server_ipv4_v6_test.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/scenario_test/route_server_ipv4_v6_test.py b/test/scenario_test/route_server_ipv4_v6_test.py index b0c75c27..45b85204 100644 --- a/test/scenario_test/route_server_ipv4_v6_test.py +++ b/test/scenario_test/route_server_ipv4_v6_test.py @@ -138,6 +138,36 @@ class GoBGPIPv6Test(unittest.TestCase): self.check_gobgp_local_rib(self.ipv6s, 'ipv6') self.check_rs_client_rib(self.ipv6s, 'ipv6') + def test_04_add_in_policy_to_reject_all(self): + for q in self.gobgp.peers.itervalues(): + self.gobgp.local('gobgp neighbor {0} policy in set default reject'.format(q['neigh_addr'].split('/')[0])) + + def test_05_check_ipv4_peer_rib(self): + self.check_gobgp_local_rib(self.ipv4s, 'ipv4') + self.check_rs_client_rib(self.ipv4s, 'ipv4') + + def test_06_check_ipv6_peer_rib(self): + self.check_gobgp_local_rib(self.ipv6s, 'ipv6') + self.check_rs_client_rib(self.ipv6s, 'ipv6') + + def test_07_add_in_policy_to_reject_all(self): + self.gobgp.local('gobgp neighbor all softresetin') + time.sleep(1) + + def test_08_check_rib(self): + for q in self.ipv4s.itervalues(): + self.assertTrue(all( p['filtered'] for p in self.gobgp.get_adj_rib_in(q))) + self.assertTrue(len(self.gobgp.get_adj_rib_out(q)) == 0) + self.assertTrue(len(q.get_global_rib()) == len(q.routes)) + + for q in self.ipv6s.itervalues(): + self.assertTrue(all( p['filtered'] for p in self.gobgp.get_adj_rib_in(q, rf='ipv6'))) + self.assertTrue(len(self.gobgp.get_adj_rib_out(q, rf='ipv6')) == 0) + self.assertTrue(len(q.get_global_rib(rf='ipv6')) == len(q.routes)) + + + + if __name__ == '__main__': if os.geteuid() is not 0: |