From f580bd8fdb22f5f1876f6fe8803b9beab3c5faca Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 13 May 2016 05:36:43 +0000 Subject: test: enhance route server test Signed-off-by: ISHIDA Wataru --- test/lib/gobgp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/lib') diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py index 6cd5c57b..459e2c5f 100644 --- a/test/lib/gobgp.py +++ b/test/lib/gobgp.py @@ -173,13 +173,15 @@ class GoBGPContainer(BGPContainer): def get_adj_rib_out(self, peer, prefix='', rf='ipv4'): return self._get_adj_rib('out', peer, prefix, rf) - def get_neighbor_state(self, peer): + def get_neighbor(self, peer): if peer not in self.peers: raise Exception('not found peer {0}'.format(peer.router_id)) peer_addr = self.peers[peer]['neigh_addr'].split('/')[0] cmd = 'gobgp -j neighbor {0}'.format(peer_addr) - output = self.local(cmd, capture=True) - return json.loads(output)['info']['bgp_state'] + return json.loads(self.local(cmd, capture=True)) + + def get_neighbor_state(self, peer): + return self.get_neighbor(peer)['info']['bgp_state'] def clear_policy(self): self.policies = {} -- cgit v1.2.3