summaryrefslogtreecommitdiffhomepage
path: root/test/lib/base.py
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-03 10:10:07 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-05 22:15:19 +0900
commita5b81ba381af74d872fb9fea0a4581262241aaae (patch)
treed5b54c57728f51a697e11bf1fd320777209753d2 /test/lib/base.py
parentf94eb1fe9230f614a8fa8f5a40329cc43bdd173f (diff)
server: add missing broadcastBests when dropping peer's routes
fix regression introduced by e6682c52ba3e09c4111bc94c938909cdcacd7d72 also add a test to check the behavior. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/lib/base.py')
-rw-r--r--test/lib/base.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/lib/base.py b/test/lib/base.py
index c0830a34..29920451 100644
--- a/test/lib/base.py
+++ b/test/lib/base.py
@@ -17,6 +17,7 @@ from fabric.api import local, lcd
from fabric import colors
from fabric.utils import indent
from fabric.state import env, output
+from docker import Client
import netaddr
import os
@@ -208,10 +209,14 @@ class Container(object):
self.ip_addrs.append((intf_name, ip_addr, bridge.name))
try_several_times(lambda :local(str(c)))
- def local(self, cmd, capture=False, flag=''):
- return local("docker exec {0} {1} {2}".format(flag,
- self.docker_name(),
- cmd), capture)
+ def local(self, cmd, capture=False, stream=False, detach=False):
+ if stream:
+ dckr = Client(timeout=120, version='auto')
+ i = dckr.exec_create(container=self.docker_name(), cmd=cmd)
+ return dckr.exec_start(i['Id'], tty=True, stream=stream, detach=detach)
+ else:
+ flag = '-d' if detach else ''
+ return local('docker exec {0} {1} {2}'.format(flag, self.docker_name(), cmd), capture)
def get_pid(self):
if self.is_running: