aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest/mocks/mass-pnf-sim/MassPnfSim.py9
-rwxr-xr-xtest/mocks/mass-pnf-sim/setup.py3
2 files changed, 11 insertions, 1 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")
diff --git a/test/mocks/mass-pnf-sim/setup.py b/test/mocks/mass-pnf-sim/setup.py
index 1d3dd7293..99d722ca5 100755
--- a/test/mocks/mass-pnf-sim/setup.py
+++ b/test/mocks/mass-pnf-sim/setup.py
@@ -32,6 +32,7 @@ setuptools.setup(
'argparse',
'ipaddress',
'requests',
- 'pyyaml'
+ 'pyyaml',
+ 'docker'
]
)