diff options
author | 2019-06-21 15:08:21 +0200 | |
---|---|---|
committer | 2019-06-21 15:17:11 +0200 | |
commit | ad1421e482283b8ec6b197a9cb04dccfa0daee1f (patch) | |
tree | fb17650320a62b16f5cb218cc3a97ed4e921573b /tests/dcaegen2/prh-testcases/resources/prh_library.robot | |
parent | a287903f5870abe40efbbe764a55d8e11d4df475 (diff) |
Add test for logging level change in PRH based on configuration from CBS
Extracting config related tests to separate suit since they do not share common setup and teardown.
Small improvements in existing test for ad-hoc logging level change using rest endpoint.
Change-Id: I0b81680cc68cd210aad01b87f84856200cb4b88b
Issue-ID: DCAEGEN2-1544
Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources/prh_library.robot')
-rw-r--r-- | tests/dcaegen2/prh-testcases/resources/prh_library.robot | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot index b52b27c3..c00f012f 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot @@ -2,7 +2,6 @@ Library RequestsLibrary Library Collections Library PrhLibrary.py -Library OperatingSystem Resource ../../../common.robot *** Keywords *** @@ -151,20 +150,25 @@ Reset DMaaP simulator Verify change logging level - Change logging level TRACE + ${logger}= Set Variable org.onap.dcaegen2.services.prh.controllers.AppInfoController + Change logging level ${logger} TRACE + Verify logging level ${logger} TRACE Verify logs with heartbeat - Change logging level INFO + [Teardown] Change logging level ${logger} INFO Change logging level - [Arguments] ${expected_log_level} - Run curl -i -X POST -H 'Content-Type: application/json' -d '{"configuredLevel": "${expected_log_level}"}' http://localhost:8100/actuator/loggers/org.onap.dcaegen2.services.prh + [Arguments] ${logger} ${log_level} + ${request_body}= Create Dictionary configuredLevel=${log_level} + ${resp}= Post Request prh_session /actuator/loggers/${logger} json=${request_body} + Should Be Equal As Integers ${resp.status_code} 204 Verify logging level - [Arguments] ${expected_log_level} - ${resp}= Get Request prh_session /actuator/loggers/org.onap.dcaegen2.services.prh - Should Be Equal As JSON ${resp.content} ${expected_log_level} + [Arguments] ${logger} ${expected_log_level} + ${resp}= Get Request prh_session /actuator/loggers/${logger} + Should Be Equal As Integers ${resp.status_code} 200 + Log ${resp.content} + Should Be Equal As Strings ${resp.json()["configuredLevel"]} ${expected_log_level} ignore_case=true Verify logs with heartbeat - Verify logging level ${TRACE_LOG_LEVEL_CONF} Get Request prh_session /heartbeat Check PRH log Heartbeat request received
\ No newline at end of file |