From 0e9893229b97a1a3e5633610363e67554cff6b94 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 3 Jul 2015 15:56:14 +0900 Subject: test: stop using gobgp monitor command gobgp monitor command can failed to get notification. stop using it in case Signed-off-by: ISHIDA Wataru --- test/scenario_test/lib/gobgp.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'test/scenario_test/lib') diff --git a/test/scenario_test/lib/gobgp.py b/test/scenario_test/lib/gobgp.py index 1bfcf5fe..11eeeb96 100644 --- a/test/scenario_test/lib/gobgp.py +++ b/test/scenario_test/lib/gobgp.py @@ -16,8 +16,6 @@ from base import * import json import toml -import subprocess -import select from itertools import chain @@ -124,42 +122,6 @@ class GoBGPContainer(BGPContainer): output = local(cmd, capture=True) return json.loads(output)['info']['bgp_state'] - def wait_for(self, expected_state, peer, timeout=120): - state = self.get_neighbor_state(peer) - y = colors.yellow - print y("{0}'s peer {1} state: {2}".format(self.router_id, - peer.router_id, - state)) - if state == expected_state: - return - - peer_addr = self.peers[peer]['neigh_addr'].split('/')[0] - gobgp = '/go/bin/gobgp' - cmd = 'docker exec {0} {1} monitor neighbor {2} -j'.format(self.name, - gobgp, - peer_addr) - process = subprocess.Popen(cmd, shell=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - - print '[localhost] local:', cmd - - poll = select.epoll() - poll.register(process.stdout, select.POLLIN) - - while True: - result = poll.poll(float(timeout)) - if result: - line = process.stdout.readline() - info = json.loads(line)['info'] - print y("{0}'s peer {1} state: {2}".format(self.router_id, - peer.router_id, - info['bgp_state'])) - if info['bgp_state'] == expected_state: - return - continue - raise Exception('timeout') - def create_config(self): config = {'Global': {'As': self.asn, 'RouterId': self.router_id}} for peer, info in self.peers.iteritems(): -- cgit v1.2.3