From 2002517aeadd62d3ce73b7b20fc6e0f1397bf5b1 Mon Sep 17 00:00:00 2001 From: Filip Krzywka Date: Thu, 20 Sep 2018 12:33:27 +0200 Subject: Add check for memory leak detection Change-Id: Ifb70e1409dbd5df4207f83cbf2268dd5355e1bd5 Issue-ID: DCAEGEN2-815 Signed-off-by: Filip Krzywka --- .../plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh | 10 ++++++++-- .../testcases/libraries/DcaeAppSimulatorLibrary.py | 10 +++++----- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh index 84d36667e..246fb8363 100755 --- a/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh +++ b/test/csit/plans/dcaegen2-collectors-hv-ves/testsuites/teardown.sh @@ -4,8 +4,14 @@ cd ssl make clean cd .. -docker-compose logs > ${WORKSPACE}/archives/containers_logs/docker-compose.log +COMPOSE_LOGS_FILE=${WORKSPACE}/archives/containers_logs/docker-compose.log +docker-compose logs > ${COMPOSE_LOGS_FILE} docker-compose down docker-compose rm -f -docker network rm ${CONTAINERS_NETWORK} \ No newline at end of file +docker network rm ${CONTAINERS_NETWORK} + +if grep "LEAK:" ${COMPOSE_LOGS_FILE}; then + echo "Teardown failed. Memory leak detected in docker-compose logs." + exit 1 +fi 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 ab3b1e21d..9edad2cc2 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 @@ -8,12 +8,12 @@ class DcaeAppSimulatorLibrary: def configure_dcae_app_simulator_to_consume_messages_from_topics(self, app_url, topics): logger.info("PUT at: " + app_url) - resp = HttpRequests.session_without_env().put(app_url, data={'topics': topics}, timeout=5) + resp = HttpRequests.session_without_env().put(app_url, data={'topics': topics}, timeout=10) HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) def assert_DCAE_app_consumed(self, app_url, expected_messages_amount): logger.info("GET at: " + app_url) - resp = HttpRequests.session_without_env().get(app_url, timeout=5) + resp = HttpRequests.session_without_env().get(app_url, timeout=10) HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) assert resp.content == expected_messages_amount, \ @@ -21,7 +21,7 @@ class DcaeAppSimulatorLibrary: 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) + resp = HttpRequests.session_without_env().get(app_url, timeout=10) HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) logger.debug("Messages consumed by simulator: " + resp.content + @@ -33,7 +33,7 @@ class DcaeAppSimulatorLibrary: def reset_DCAE_app_simulator(self, app_url): logger.info("DELETE at: " + app_url) - resp = HttpRequests.session_without_env().delete(app_url, timeout=5) + resp = HttpRequests.session_without_env().delete(app_url, timeout=10) HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) def assert_DCAE_app_consumed_proper_messages(self, app_url, message_filepath): @@ -42,5 +42,5 @@ class DcaeAppSimulatorLibrary: data = file.read() file.close() - resp = HttpRequests.session_without_env().post(app_url, data=data, timeout=5) + resp = HttpRequests.session_without_env().post(app_url, data=data, timeout=10) HttpRequests.checkStatusCode(resp.status_code, DCAE_APP_NAME) -- cgit 1.2.3-korg