summaryrefslogtreecommitdiffhomepage
path: root/test/lib
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-13 05:36:43 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-14 01:48:33 +0900
commitf580bd8fdb22f5f1876f6fe8803b9beab3c5faca (patch)
tree187157083e12164fc0637138e864c20200e4c93f /test/lib
parentce3177c565ac735bfa838ed4757e23830288553c (diff)
test: enhance route server test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/gobgp.py8
1 files changed, 5 insertions, 3 deletions
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 = {}