diff options
author | 2018-08-06 10:07:03 +0200 | |
---|---|---|
committer | 2018-08-31 07:47:38 +0200 | |
commit | d95a67029072015b75161aa180a72f242eda90ea (patch) | |
tree | 94a4f279ba5396bd6d08e05552262e471284f8a8 /test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py | |
parent | f15077f640d033c1eb50d5496b27b6d6739d7e76 (diff) |
Configure HV-VES suite containers
- populate consul with HV-VES configuration
- make DCAE app simulator to consume messages from non-default
kafka topic
Change-Id: I13773476f271b533236c0888fa5d091a0ee46a23
Issue-ID: DCAEGEN2-687
Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
Diffstat (limited to 'test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py')
-rw-r--r-- | test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py new file mode 100644 index 000000000..4db04612e --- /dev/null +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/VesHvContainersUtilsLibrary.py @@ -0,0 +1,34 @@ +from time import time + +from robot.api import logger +import os.path + +LOCALHOST = "localhost" + + +class VesHvContainersUtilsLibrary: + + def get_consul_api_access_url(self, method, image_name, port): + return self.create_url( + method, + self.get_instance_address(image_name, port) + ) + + def get_dcae_app_api_access_url(self, method, image_name, port): + return self.create_url( + method, + self.get_instance_address(image_name, port) + ) + + def get_instance_address(self, image_name, port): + if is_running_inside_docker(): + return image_name + ":" + port + else: + logger.info("File `/.dockerenv` not found. Assuming local environment and using localhost.") + return LOCALHOST + ":" + port + + def create_url(self, method, host_address): + return method + host_address + +def is_running_inside_docker(): + return os.path.isfile("/.dockerenv") |