From e50e917ae48352c8b6f7c537027250e000d0086c Mon Sep 17 00:00:00 2001 From: Jakub Dudycz Date: Mon, 6 Aug 2018 10:52:37 +0200 Subject: Write HV-VES message routing testcases Change-Id: Ibbee3deb1ebd5446f2251dc141a212cde892f374 Issue-ID: DCAEGEN2-687 Signed-off-by: jdudycz --- .../testcases/libraries/DcaeAppSimulatorLibrary.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries') diff --git a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py index 80a5c41cf..ab3b1e21d 100644 --- a/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py +++ b/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py @@ -3,6 +3,7 @@ from robot.api import logger DCAE_APP_NAME = "DCAE App" + class DcaeAppSimulatorLibrary: def configure_dcae_app_simulator_to_consume_messages_from_topics(self, app_url, topics): @@ -18,6 +19,17 @@ class DcaeAppSimulatorLibrary: assert resp.content == expected_messages_amount, \ "Messages consumed by simulator: " + resp.content + " expecting: " + expected_messages_amount + def assert_DCAE_app_consumed_less_equal_than(self, app_url, messages_threshold): + logger.info("GET at: " + app_url) + resp = HttpRequests.session_without_env().get(app_url, timeout=5) + HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) + + logger.debug("Messages consumed by simulator: " + resp.content + + " expecting more than 0 and less/equal than " + messages_threshold) + + assert 0 < int(resp.content) <= int(messages_threshold), \ + "Messages consumed by simulator: " + resp.content + \ + " expecting more than 0 and less/equal than " + messages_threshold def reset_DCAE_app_simulator(self, app_url): logger.info("DELETE at: " + app_url) @@ -32,5 +44,3 @@ class DcaeAppSimulatorLibrary: resp = HttpRequests.session_without_env().post(app_url, data=data, timeout=5) HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) - - -- cgit 1.2.3-korg