diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-07-10 14:06:08 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-08-08 21:24:48 +0900 |
commit | 71e56c542e6a167dc3cd983aae2881a3c24c162a (patch) | |
tree | a449e3ed0889940fe47bb5f4ffca91228a4cc7e8 /test/lib/gobgp.py | |
parent | 3dc23d3075f13f2976afd255ef2fd9b1410acc77 (diff) |
rpc cleanup
- clean up RPC function names
- rewrite gobgp command to use the api instead of config package
- delete unused client package
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'test/lib/gobgp.py')
-rw-r--r-- | test/lib/gobgp.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py index bc1f96e9..72a9bc2d 100644 --- a/test/lib/gobgp.py +++ b/test/lib/gobgp.py @@ -42,6 +42,9 @@ from lib.base import ( BGP_ATTR_TYPE_MP_REACH_NLRI, GRACEFUL_RESTART_TIME, LONG_LIVED_GRACEFUL_RESTART_TIME, + BGP_FSM_IDLE, + BGP_FSM_ACTIVE, + BGP_FSM_ESTABLISHED, ) @@ -299,7 +302,14 @@ class GoBGPContainer(BGPContainer): return json.loads(self.local(cmd, capture=True)) def get_neighbor_state(self, peer): - return self.get_neighbor(peer)['state']['session-state'] + s = self.get_neighbor(peer)['state']['session_state'] + if s == 1: + return BGP_FSM_IDLE + elif s == 3: + return BGP_FSM_ACTIVE + elif s == 6: + return BGP_FSM_ESTABLISHED + return "unknown" def clear_policy(self): self.policies = {} |