aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2
diff options
context:
space:
mode:
authormicdzied <michal.1.dziedzic@nokia.com>2019-06-17 14:08:27 +0200
committerMichal Dziedzic <michal.1.dziedzic@nokia.com>2019-06-18 07:18:58 +0000
commit9c7d8f024060f441ba25c14a04fd841f2e9e16bf (patch)
tree5c98bf3e6cc0b2c0e1d3b6fb20dcd2278bc5617c /tests/dcaegen2
parent85449f00062a6b05f7d627898f80ac306faeded2 (diff)
add log level change test
Change-Id: Ie4fb5192a86e4433df865c8913ea212d25acc00b Issue-ID: INT-1107 Signed-off-by: micdzied <michal.1.dziedzic@nokia.com>
Diffstat (limited to 'tests/dcaegen2')
-rw-r--r--tests/dcaegen2/prh-testcases/prh_tests.robot10
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_library.robot24
2 files changed, 32 insertions, 2 deletions
diff --git a/tests/dcaegen2/prh-testcases/prh_tests.robot b/tests/dcaegen2/prh-testcases/prh_tests.robot
index 9914a7e2..88e17121 100644
--- a/tests/dcaegen2/prh-testcases/prh_tests.robot
+++ b/tests/dcaegen2/prh-testcases/prh_tests.robot
@@ -15,6 +15,9 @@ ${TEST_CASES_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets
${DMAAP_SIMULATOR_SETUP_URL} http://${DMAAP_SIMULATOR_SETUP}
${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP}
${CONSUL_SETUP_URL} http://${CONSUL_SETUP}
+${PRH_SETUP_URL} http://${PRH_SETUP}
+${TRACE_LOG_LEVEL_CONF} {"configuredLevel":"TRACE","effectiveLevel":"TRACE"}
+${WARN_LOG_LEVEL_CONF} {"configuredLevel":"WARN","effectiveLevel":"WARN"}
*** Test Cases ***
BBS case event - attachment point
@@ -56,4 +59,9 @@ BBS case event - Re-registration
[Documentation] After regitered PNF, PRH reads another one PRH event with registration event
[Tags] PRH Valid event Re registraiton
[Template] Verify PNF re registration
- ${TEST_CASES_DIR}/re-registration \ No newline at end of file
+ ${TEST_CASES_DIR}/re-registration
+
+PRH logging level change
+ [Documentation] PRH logging level change from WARN to TRACE
+ [Tags] PRH logging level
+ Verify change logging level \ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
index 007caf37..ce5b65bf 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
@@ -2,6 +2,7 @@
Library RequestsLibrary
Library Collections
Library PrhLibrary.py
+Library OperatingSystem
Resource ../../../common.robot
*** Keywords ***
@@ -143,6 +144,8 @@ Create sessions
Set Suite Variable ${aai_setup_session} aai_setup_session
Create Session consul_setup_session ${CONSUL_SETUP_URL}
Set Suite Variable ${consul_setup_session} consul_setup_session
+ Create Session prh_setup_session ${PRH_SETUP_URL}
+ Set Suite Variable ${prh_setup_session} prh_setup_session
Reset Simulators
Reset AAI simulator
@@ -158,4 +161,23 @@ Reset DMaaP simulator
Create headers
${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- Set Suite Variable ${suite_headers} ${headers} \ No newline at end of file
+ Set Suite Variable ${suite_headers} ${headers}
+
+Verify change logging level
+ Change logging level TRACE
+ Verify logs with heartbeat
+ Change logging level 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
+
+Verify logging level
+ [Arguments] ${expected_log_level}
+ ${resp}= Get Request prh_setup_session /actuator/loggers/org.onap.dcaegen2.services.prh
+ Should Be Equal As JSON ${resp.content} ${expected_log_level}
+
+Verify logs with heartbeat
+ Verify logging level ${TRACE_LOG_LEVEL_CONF}
+ Get Request prh_setup_session /heartbeat
+ Check PRH log Heartbeat request received \ No newline at end of file