summaryrefslogtreecommitdiffstats
path: root/test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries
diff options
context:
space:
mode:
authorJakub Dudycz <jakub.dudycz@nokia.com>2018-08-06 10:52:37 +0200
committerFilip Krzywka <filip.krzywka@nokia.com>2018-08-31 07:47:38 +0200
commite50e917ae48352c8b6f7c537027250e000d0086c (patch)
treec6377d0fbaf9c8a126eccc9c7ccb4ae3474ff43e /test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries
parent81f5d528e1acd40b7a0987df907bd85d4ffa3414 (diff)
Write HV-VES message routing testcases
Change-Id: Ibbee3deb1ebd5446f2251dc141a212cde892f374 Issue-ID: DCAEGEN2-687 Signed-off-by: jdudycz <jakub.dudycz@nokia.com>
Diffstat (limited to 'test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries')
-rw-r--r--test/csit/tests/dcaegen2-collectors-hv-ves/testcases/libraries/DcaeAppSimulatorLibrary.py14
1 files changed, 12 insertions, 2 deletions
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)
-
-