summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/lib/base.py
diff options
context:
space:
mode:
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):