From 9abb61ca2cea1907cab2cec312d6dca6e53a93cd Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Thu, 27 Sep 2018 10:38:50 -0700 Subject: Move CSIT to integration/csit repo To facilite branching of CSIT tests, all CSIT test code and scripts are relocated to the integration/csit repo. Change-Id: I1e4c0eff44691f73f8098b3c52764107f6b8b8df Issue-ID: INT-671 Signed-off-by: Gary Wu --- .../testcases/libraries/ConsulLibrary.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py (limited to 'tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py') diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py b/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py new file mode 100644 index 00000000..52d7e0ea --- /dev/null +++ b/tests/dcaegen2-collectors-hv-ves/testcases/libraries/ConsulLibrary.py @@ -0,0 +1,16 @@ +from robot.api import logger +import HttpRequests + +CONSUL_NAME = "Consul" + +class ConsulLibrary: + + def publish_hv_ves_configuration_in_consul(self, consul_url, consul_configuration_filepath): + logger.info("Reading consul configuration file from: " + consul_configuration_filepath) + file = open(consul_configuration_filepath, "rb") + data = file.read() + file.close() + + logger.info("PUT at: " + consul_url) + resp = HttpRequests.session_without_env().put(consul_url, data=data, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, CONSUL_NAME) \ No newline at end of file -- cgit 1.2.3-korg