aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plans/dcaegen2/prh-testsuites/setup.sh2
-rw-r--r--tests/dcaegen2/prh-testcases/prh_tests.robot10
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_library.robot24
3 files changed, 33 insertions, 3 deletions
diff --git a/plans/dcaegen2/prh-testsuites/setup.sh b/plans/dcaegen2/prh-testsuites/setup.sh
index 28882c84..9dc8de9a 100644
--- a/plans/dcaegen2/prh-testsuites/setup.sh
+++ b/plans/dcaegen2/prh-testsuites/setup.sh
@@ -46,4 +46,4 @@ echo CBS_IP=${CBS_IP}
wait_for_service_init localhost:8100/heartbeat
# #Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v DMAAP_SIMULATOR_SETUP:${DMAAP_SIMULATOR_IP}:2224 -v AAI_SIMULATOR_SETUP:${AAI_SIMULATOR_IP}:3335 -v CONSUL_SETUP:${CONSUL_IP}:8500" \ No newline at end of file
+ROBOT_VARIABLES="-v DMAAP_SIMULATOR_SETUP:${DMAAP_SIMULATOR_IP}:2224 -v AAI_SIMULATOR_SETUP:${AAI_SIMULATOR_IP}:3335 -v CONSUL_SETUP:${CONSUL_IP}:8500 -v PRH_SETUP:${PRH_IP}:8100" \ No newline at end of file
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