aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/mass-pnf-sim/MassPnfSim.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/mocks/mass-pnf-sim/MassPnfSim.py')
-rwxr-xr-xtest/mocks/mass-pnf-sim/MassPnfSim.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mocks/mass-pnf-sim/MassPnfSim.py b/test/mocks/mass-pnf-sim/MassPnfSim.py
index b69e0fcac..f932c8286 100755
--- a/test/mocks/mass-pnf-sim/MassPnfSim.py
+++ b/test/mocks/mass-pnf-sim/MassPnfSim.py
@@ -9,6 +9,7 @@ from shutil import copytree, rmtree
from json import dumps
from yaml import load, SafeLoader
from glob import glob
+from docker import from_env
from requests import get
from requests.exceptions import MissingSchema, InvalidSchema, InvalidURL, ConnectionError, ConnectTimeout
@@ -161,6 +162,14 @@ class MassPnfSim:
chdir(oldpwd)
return yml['ippnfsim']
+ def _get_docker_containers(self):
+ '''Returns a list containing 'name' attribute of running docker containers'''
+ dc = from_env()
+ containers = []
+ for container in dc.containers.list():
+ containers.append(container.attrs['Name'][1:])
+ return containers
+
def bootstrap(self):
self.logger.info("Bootstrapping PNF instances")