From 59bad158d7dd96c157fb9387db2de8ecb9214914 Mon Sep 17 00:00:00 2001 From: Joanna Jeremicz Date: Tue, 16 Feb 2021 09:34:13 +0100 Subject: Add CSITs for Pm-mapper files processing performance Issue-ID: DCAEGEN2-2600 Signed-off-by: Joanna Jeremicz Signed-off-by: Tomasz Wrobel Change-Id: Id7e4d345380fd5fd08f28a3ddff04a4fde8f7730 --- .../libraries/DockerContainerManager.py | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py (limited to 'tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py') diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py new file mode 100644 index 00000000..3e3ae58e --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py @@ -0,0 +1,29 @@ +import docker +from EnvsReader import EnvsReader +from docker.types import Mount + +class DockerContainerManager: + + def run_pmmapper_container(self, client_image, container_name, path_to_env, dr_node_ip, mr_ip): + client = docker.from_env() + environment = EnvsReader().read_env_list_from_file(path_to_env) + environment.append("CONFIG_BINDING_SERVICE_SERVICE_HOST=172.18.0.5") + environment.append("CONFIG_BINDING_SERVICE_SERVICE_PORT=10000") + environment.append("HOSTNAME=pmmapper") + client.containers.run( + image=client_image, + name=container_name, + environment=environment, + ports={'8081': 8081}, + network='filesprocessingconfigpmmapper_pmmapper-network', + extra_hosts={'dmaap-dr-node': dr_node_ip, 'message-router': mr_ip}, + user='root', + mounts=[Mount(target='/opt/app/pm-mapper/etc/certs/', source='/var/tmp/', type='bind')], + detach=True + ) + + def remove_container(self, container_name): + client = docker.from_env() + container = client.containers.get(container_name) + container.stop() + container.remove() -- cgit 1.2.3-korg