summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/lib/base.py
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-07-26 17:44:05 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-27 11:26:10 +0900
commit37800322eb5a0d0c3d95cf36926d49fd096d4172 (patch)
tree0c718f7d93be2e29afa01b507d990a0edbbcbd3c /test/scenario_test/lib/base.py
parentd9cbb32c3e917d5a208e58f49785da8fe3863e1c (diff)
test: telnet to quagga from local network namespace
this is preparation for parallel execution of scenario tests Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib/base.py')
-rw-r--r--test/scenario_test/lib/base.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/scenario_test/lib/base.py b/test/scenario_test/lib/base.py
index 66e610d9..721e1c1d 100644
--- a/test/scenario_test/lib/base.py
+++ b/test/scenario_test/lib/base.py
@@ -171,6 +171,12 @@ class Container(object):
def local(self, cmd):
return local("docker exec -it {0} {1}".format(self.name, cmd))
+ def get_pid(self):
+ if self.is_running:
+ cmd = "docker inspect -f '{{.State.Pid}}' " + self.name
+ return int(local(cmd, capture=True))
+ return -1
+
class BGPContainer(Container):