summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/lib
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-07-03 15:56:14 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-07-03 16:02:05 +0900
commit0e9893229b97a1a3e5633610363e67554cff6b94 (patch)
treec12cd63fc2df40eed8eb878f9eb56620a9ba7b08 /test/scenario_test/lib
parentb37dff1ff97beadc6cd842b7e9f742da02fec7b5 (diff)
test: stop using gobgp monitor command
gobgp monitor command can failed to get notification. stop using it in case Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib')
-rw-r--r--test/scenario_test/lib/gobgp.py38
1 files changed, 0 insertions, 38 deletions
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():