aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2021-07-20 15:53:48 +0100
committerefiacor <fiachra.corcoran@est.tech>2021-07-21 10:52:19 +0100
commit693776120dfc1cc9fb14a1f6a06a9554dce2ee4d (patch)
tree297534bf95153c6d78a9ab7b4584550fdba14b4a /tests
parent2a8ea348f7e0b17aa2c92e298ccac382bf772362 (diff)
[DCAE-PMSH] Refactoring csit suite
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: I60ca22a87c4f2e1b0c244b6a388e17c3f6d79b90 Issue-ID: INT-1946
Diffstat (limited to 'tests')
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json6
-rw-r--r--tests/dcaegen2-services-pmsh/testcases/pmsh.robot47
2 files changed, 27 insertions, 26 deletions
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
index 60ac2aab..f5de1952 100644
--- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
+++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json
@@ -87,7 +87,7 @@
"dmaap_info": {
"client_id": "1475976809466",
"client_role": "org.onap.dcae.pmPublisher",
- "topic_url": "http://dmaap:3904/events/unauthenticated.DCAE_CL_OUTPUT",
+ "topic_url": "http://dmaap-mr:3904/events/unauthenticated.DCAE_CL_OUTPUT",
"location": "san-francisco"
},
"type": "message_router"
@@ -99,14 +99,14 @@
"dmaap_info": {
"client_id": "1575976809466",
"client_role": "org.onap.dcae.aaiSub",
- "topic_url": "http://dmaap:3904/events/AAI_EVENT",
+ "topic_url": "http://dmaap-mr:3904/events/AAI_EVENT",
"location": "san-francisco"
}
},
"policy_pm_subscriber": {
"dmaap_info": {
"location": "san-francisco",
- "topic_url": "http://dmaap:3904/events/unauthenticated.PMSH_CL_INPUT",
+ "topic_url": "http://dmaap-mr:3904/events/unauthenticated.PMSH_CL_INPUT",
"client_role": "org.onap.dcae.pmSubscriber",
"client_id": "1575876809456"
},
diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
index 4b0dc6e4..71452350 100644
--- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
+++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot
@@ -7,8 +7,6 @@ Library String
Library Process
Resource ../../common.robot
-
-Test Setup CreateSessions
Test Teardown Delete All Sessions
@@ -44,7 +42,7 @@ Verify database tables exist and are empty
[Tags] PMSH_02
[Documentation] Verify database has been created and is empty
[Timeout] 10 seconds
- ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT}
+ ${resp}= GetSubsCall ${SUBSCRIPTIONS_ENDPOINT}
Should Be True ${resp.status_code} == 200
Should Contain ${resp.text} []
@@ -53,8 +51,8 @@ Verify PNF detected in AAI when administrative state unlocked
[Documentation] Verify PNF detected when administrative state unlocked
[Timeout] 60 seconds
SetAdministrativeStateToUnlocked
- Sleep 31 Allow PMSH time to pick up changes in CBS config
- ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT}
+ Sleep 31 Allow PMSH time to pick up changes in CBS config
+ ${resp}= GetSubsCall ${SUBSCRIPTIONS_ENDPOINT}
Should Be Equal As Strings ${resp.json()[0]['subscription_status']} UNLOCKED
Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_name']} pnf-existing
Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} PENDING_CREATE
@@ -65,7 +63,7 @@ Verify Policy response on MR is handled
[Timeout] 60 seconds
SimulatePolicyResponse ${MR_POLICY_RESPONSE_PNF_EXISTING}
Sleep 31 seconds Ensure Policy response on MR is picked up
- ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT}
+ ${resp}= GetSubsCall ${SUBSCRIPTIONS_ENDPOINT}
Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} CREATED
Verify AAI event on MR detailing new PNF being detected is handled
@@ -74,7 +72,7 @@ Verify AAI event on MR detailing new PNF being detected is handled
[Timeout] 60 seconds
SimulateNewPNF ${MR_AAI_PNF_CREATED}
Sleep 31 seconds Ensure AAI event on MR is picked up
- ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT}
+ ${resp}= GetSubsCall ${SUBSCRIPTIONS_ENDPOINT}
Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_name']} pnf_newly_discovered
Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_sub_status']} PENDING_CREATE
@@ -84,29 +82,25 @@ Verify AAI event on MR detailing PNF being deleted is handled
[Timeout] 60 seconds
SimulateDeletedPNF ${MR_AAI_PNF_REMOVED}
Sleep 31 seconds Ensure AAI event on MR is picked up
- ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT}
+ ${resp}= GetSubsCall ${SUBSCRIPTIONS_ENDPOINT}
Should Not Contain ${resp.text} pnf_newly_discovered
*** Keywords ***
-CreateSessions
- Create Session pmsh_session ${PMSH_BASE_URL}
- Create Session mr_sim_session ${MR_BASE_URL}
- Create Session cbs_sim_session ${CBS_BASE_URL}
-
SetAdministrativeStateToUnlocked
${data}= Get Data From File ${CBS_EXPECTATION_ADMIN_STATE_UNLOCKED}
- ${resp} = Put Request cbs_sim_session /clear data={"path": "/service_component_all/.*"}
+ Create Session cbs_sim_session ${CBS_BASE_URL} verify=false
+ ${resp}= PUT On Session cbs_sim_session url=/clear data={"path": "/service_component_all/.*"}
Should Be True ${resp.status_code} == 200
- Sleep 2 Allow CBS time to set expectation
- ${resp} = Put Request cbs_sim_session /expectation data=${data}
+ Sleep 2 Allow CBS time to set expectation
+ ${resp} = PUT On Session cbs_sim_session url=/expectation data=${data}
Should Be True ${resp.status_code} == 201
SimulatePolicyResponse
[Arguments] ${expected_contents}
${json_value}= json_from_file ${expected_contents}
- ${resp}= PostCall ${POLICY_PUBLISH_MR_TOPIC} ${json_value}
+ ${resp}= PostMrCall ${POLICY_PUBLISH_MR_TOPIC} ${json_value}
log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Evaluate $resp.json().get('count')
@@ -115,7 +109,7 @@ SimulatePolicyResponse
SimulateNewPNF
[Arguments] ${expected_contents}
${json_value}= json_from_file ${expected_contents}
- ${resp}= PostCall ${AAI_MR_TOPIC} ${json_value}
+ ${resp}= PostMrCall ${AAI_MR_TOPIC} ${json_value}
log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Evaluate $resp.json().get('count')
@@ -124,14 +118,21 @@ SimulateNewPNF
SimulateDeletedPNF
[Arguments] ${expected_contents}
${json_value}= json_from_file ${expected_contents}
- ${resp}= PostCall ${AAI_MR_TOPIC} ${json_value}
+ ${resp}= PostMrCall ${AAI_MR_TOPIC} ${json_value}
log ${resp.text}
Should Be Equal As Strings ${resp.status_code} 200
${count}= Evaluate $resp.json().get('count')
log 'JSON Response Code:'${resp}
-PostCall
+PostMrCall
[Arguments] ${url} ${data}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Post Request mr_sim_session ${url} json=${data} headers=${headers}
- [Return] ${resp}
+ Create Session mr_sim_session ${MR_BASE_URL} verify=false
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= POST On Session mr_sim_session url=${url} json=${data} headers=${headers}
+ [Return] ${resp}
+
+GetSubsCall
+ [Arguments] ${url}
+ Create Session pmsh_session ${PMSH_BASE_URL} verify=false
+ ${resp}= GET On Session pmsh_session url=${url}
+ [Return] ${resp}