diff options
author | efiacor <fiachra.corcoran@est.tech> | 2022-02-28 17:27:23 +0000 |
---|---|---|
committer | Fiachra Corcoran <fiachra.corcoran@est.tech> | 2022-03-02 17:03:42 +0000 |
commit | 5e83a4b0e5e34aa81cb4c96dfabc4375ac0bf16e (patch) | |
tree | b2385e73453e1c68f8363295c6e44ac07833a78e /tests | |
parent | 184a68e3c86d79f42b857fa7fbf81304a87fe326 (diff) |
[DCAE-PMSH] Removing dmaap mr from suite
Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I1bb83e675667ae38e7e2d6d47f7e63165722cbb4
Issue-ID: DCAEGEN2-2922
Diffstat (limited to 'tests')
7 files changed, 364 insertions, 192 deletions
diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json index 534b7ce1..07d994b3 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json @@ -1,63 +1,63 @@ -{ - "cambria.partition":"AAI", - "event-header":{ - "severity":"NORMAL", - "entity-type":"pnf", - "top-entity-type":"pnf", - "entity-link":"/aai/v16/network/pnfs/pnf/pnf_newly_discovered", - "event-type":"AAI-EVENT", - "domain":"dev", - "action":"UPDATE", - "sequence-number":"0", - "id":"db09e090-196e-4f84-9645-e449b1cd3640", - "source-name":"dcae-curl", - "version":"v16", - "timestamp":"20200203-15:14:08:807" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "headers":{ + "content-type":[ + "application/json" + ] + }, + "statusCode":200, + "body":{ + "type":"JSON", + "json":[ + "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v21/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v21\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"orchestration-status\":\"Active\",\"equip-model\":\"val6\",\"in-maint\":false,\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\"}}" + ] + } + } }, - "entity":{ - "ipaddress-v4-oam":"10.10.10.37", - "nf-role":"gNB", - "equip-type":"val8", - "relationship-list":{ - "relationship":[ - { - "related-to":"service-instance", - "relationship-data":[ - { - "relationship-value":"Demonstration", - "relationship-key":"customer.global-customer-id" - }, - { - "relationship-value":"vCPE", - "relationship-key":"service-subscription.service-type" - }, - { - "relationship-value":"2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-key":"service-instance.service-instance-id" - } - ], - "related-link":"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-label":"org.onap.relationships.inventory.ComposedOf", - "related-to-property":[ - { - "property-key":"service-instance.service-instance-name", - "property-value":"Svc6_1" - } - ] + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json": { } - ] + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" }, - "equip-vendor":"Ericsson", - "serial-number":"6061ZW3", - "ipaddress-v6-oam":"2001:0db8:0:0:0:0:1428:57ab", - "equip-model":"val6", - "in-maint":false, - "resource-version":"1578668956804", - "sw-version":"val7", - "pnf-id":"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8", - "pnf-name":"pnf_newly_discovered", - "model-invariant-id":"7129e420-d396-4efb-af02-6b83499b12f8", - "model-version-id":"e80a6ae3-cafd-4d24-850d-e14c084a5ca9", - "orchestration-status":"Active" + "httpResponse":{ + "statusCode":200 + } } -}
\ No newline at end of file +]
\ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json index f2ffd050..20286a41 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json @@ -1,63 +1,61 @@ -{ - "cambria.partition":"AAI", - "event-header":{ - "severity":"NORMAL", - "entity-type":"pnf", - "top-entity-type":"pnf", - "entity-link":"/aai/v16/network/pnfs/pnf/pnf_newly_discovered", - "event-type":"AAI-EVENT", - "domain":"dev", - "action":"DELETE", - "sequence-number":"0", - "id":"db09e090-196e-4f84-9645-e449b1cd3640", - "source-name":"dcae-curl", - "version":"v16", - "timestamp":"20200203-15:14:08:807" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "headers":{ + "content-type":[ + "application/json" + ] + }, + "statusCode":200, + "body":{ + "type":"JSON", + "json":[ + "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v21/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"DELETE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v21\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"orchestration-status\":\"Active\",\"equip-model\":\"val6\",\"in-maint\":false,\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\"}}" + ] + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + + } + } }, - "entity":{ - "ipaddress-v4-oam":"10.10.10.37", - "nf-role":"gNB", - "equip-type":"val8", - "relationship-list":{ - "relationship":[ - { - "related-to":"service-instance", - "relationship-data":[ - { - "relationship-value":"Demonstration", - "relationship-key":"customer.global-customer-id" - }, - { - "relationship-value":"vCPE", - "relationship-key":"service-subscription.service-type" - }, - { - "relationship-value":"2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-key":"service-instance.service-instance-id" - } - ], - "related-link":"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400", - "relationship-label":"org.onap.relationships.inventory.ComposedOf", - "related-to-property":[ - { - "property-key":"service-instance.service-instance-name", - "property-value":"Svc6_1" - } - ] - } - ] + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" }, - "equip-vendor":"Ericsson", - "serial-number":"6061ZW3", - "ipaddress-v6-oam":"2001:0db8:0:0:0:0:1428:57ab", - "equip-model":"val6", - "in-maint":false, - "resource-version":"1578668956804", - "sw-version":"val7", - "pnf-id":"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8", - "pnf-name":"pnf_newly_discovered", - "model-invariant-id":"7129e420-d396-4efb-af02-6b83499b12f8", - "model-version-id":"e80a6ae3-cafd-4d24-850d-e14c084a5ca9", - "orchestration-status":"Active" + "httpResponse":{ + "statusCode":200 + } } -}
\ No newline at end of file +]
\ No newline at end of file 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 f5de1952..e6d0ef97 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-mr:3904/events/unauthenticated.DCAE_CL_OUTPUT", + "topic_url": "http://mr-sim: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-mr:3904/events/AAI_EVENT", + "topic_url": "http://mr-sim:3904/events/AAI-EVENT", "location": "san-francisco" } }, "policy_pm_subscriber": { "dmaap_info": { "location": "san-francisco", - "topic_url": "http://dmaap-mr:3904/events/unauthenticated.PMSH_CL_INPUT", + "topic_url": "http://mr-sim:3904/events/unauthenticated.PMSH_CL_INPUT", "client_role": "org.onap.dcae.pmSubscriber", "client_id": "1575876809456" }, diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json new file mode 100644 index 00000000..ed3ecb07 --- /dev/null +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json @@ -0,0 +1,64 @@ +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" + }, + "httpResponse":{ + "statusCode":200 + } + } +]
\ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json index cc0dac4c..ffe3e3f3 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json @@ -1,14 +1,64 @@ -{ - "name":"ResponseEvent", - "nameSpace":"org.onap.policy.apex.onap.pmcontrol", - "source":"APEX", - "target":"DCAE", - "version":"0.0.1", - "status":{ - "subscriptionName":"subs_01", - "measurementGroupName": "msg_grp_01", - "nfName":"pnf-existing", - "changeType":"CREATE", - "message":"success" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":[ + "{\"name\":\"ResponseEvent\",\"nameSpace\":\"org.onap.policy.apex.onap.pmcontrol\",\"source\":\"APEX\",\"target\":\"DCAE\",\"version\":\"0.0.1\",\"status\":{\"subscriptionName\":\"subs_01\",\"measurementGroupName\": \"msg_grp_01\",\"nfName\":\"pnf-existing\",\"changeType\":\"CREATE\",\"message\":\"success\"}}" + ] + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" + }, + "httpResponse":{ + "statusCode":200 + } } -}
\ No newline at end of file +]
\ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json index 0bc9c2ff..a94299e5 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-deleted-pnf-existing.json @@ -1,14 +1,64 @@ -{ - "name":"ResponseEvent", - "nameSpace":"org.onap.policy.apex.onap.pmcontrol", - "source":"APEX", - "target":"DCAE", - "version":"0.0.1", - "status":{ - "subscriptionName":"subs_01", - "measurementGroupName": "msg_grp_01", - "nfName":"pnf-existing", - "changeType":"DELETE", - "message":"success" +[ + { + "id":"mr_aai_event", + "httpRequest":{ + "method":"GET", + "path":"/events/AAI-EVENT/.*", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":{ + + } + } + } + }, + { + "id":"pmsh_cl_input_event", + "httpRequest":{ + "path":"/events/unauthenticated.PMSH_CL_INPUT/.*", + "method":"GET", + "queryStringParameters":{ + "timeout":[ + "5000" + ] + } + }, + "httpResponse":{ + "statusCode":200, + "headers":{ + "content-type":[ + "application/json" + ] + }, + "body":{ + "type":"JSON", + "json":[ + "{\"name\":\"ResponseEvent\",\"nameSpace\":\"org.onap.policy.apex.onap.pmcontrol\",\"source\":\"APEX\",\"target\":\"DCAE\",\"version\":\"0.0.1\",\"status\":{\"subscriptionName\":\"subs_01\",\"measurementGroupName\": \"msg_grp_01\",\"nfName\":\"pnf-existing\",\"changeType\":\"DELETE\",\"message\":\"success\"}}" + ] + } + } + }, + { + "id":"dcae_cl_output_event", + "httpRequest":{ + "path":"/events/unauthenticated.DCAE_CL_OUTPUT/.*", + "method":"POST" + }, + "httpResponse":{ + "statusCode":200 + } } -} +]
\ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot index 926e6991..44052b69 100644 --- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot +++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot @@ -13,12 +13,11 @@ Test Teardown Delete All Sessions *** Variables *** ${PMSH_BASE_URL} https://${PMSH_IP}:8443 -${MR_BASE_URL} http://${MR_IP_ADDRESS}:3904 +${MR_SIM_BASE_URL} http://${MR_SIM_IP_ADDRESS}:3904 ${CBS_BASE_URL} https://${CBS_SIM_IP_ADDRESS}:10443 ${SUBSCRIPTION_ENDPOINT} /subscription -${POLICY_PUBLISH_MR_TOPIC} /events/unauthenticated.PMSH_CL_INPUT -${AAI_MR_TOPIC} /events/AAI_EVENT +${MR_SIM_RESET} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-sim-reset.json ${MR_AAI_PNF_CREATED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json ${MR_AAI_PNF_REMOVED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json ${MR_POLICY_RESPONSE_PNF_EXISTING} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json @@ -28,8 +27,6 @@ ${CREATE_SUBSCRIPTION_DATA} %{WORKSPACE}/tests/dcaegen2-services ${CREATE_SECOND_SUBSCRIPTION_DATA} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/create_second_subscription_request.json ${CREATE_SUBSCRIPTION_BAD_DATA} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/create_subscription_bad_request.json ${CREATE_SUBSCRIPTION_SCHEMA_ERROR_DATA} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/create_subscription_schema_error_request.json -${ADMIN_STATE_LOCKED_PATTERN} 'administrativeState': 'LOCKED' -${CLI_EXEC_GET_CBS_CONFIG_FIRST} docker exec pmsh /bin/sh -c "grep -m 1 'PMSH config from CBS' /var/log/ONAP/dcaegen2/services/pmsh/application.log" *** Test Cases *** Verify Get subscriptions with Network Functions None @@ -74,8 +71,9 @@ Verify Policy response on MR is handled [Tags] PMSH_04 [Documentation] Verify policy response on MR is handled [Timeout] 60 seconds - SimulatePolicyResponse ${MR_POLICY_RESPONSE_PNF_EXISTING} + AddCreatePolicyResponeToMrSim Sleep 31 seconds Ensure Policy response on MR is picked up + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Be Equal As Strings ${resp.json()['subscriptionName']} subs_01 Should Be Equal As Strings ${resp.json()['administrativeState']} UNLOCKED @@ -86,8 +84,9 @@ Verify AAI event on MR detailing new PNF being detected is handled [Tags] PMSH_05 [Documentation] Verify PNF created AAI event on MR is handled [Timeout] 60 seconds - SimulateNewPNF ${MR_AAI_PNF_CREATED} - Sleep 31 seconds Ensure AAI event on MR is picked up + AddNewPnfToMrSim + Sleep 25 seconds Give sim time to set expectation + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Be Equal As Strings ${resp.json()['subscriptionName']} subs_01 Should Be Equal As Strings ${resp.json()['administrativeState']} UNLOCKED @@ -98,8 +97,9 @@ Verify AAI event on MR detailing PNF being deleted is handled [Tags] PMSH_06 [Documentation] Verify PNF deleted AAI event on MR is handled [Timeout] 60 seconds - SimulateDeletedPNF ${MR_AAI_PNF_REMOVED} - Sleep 31 seconds Ensure AAI event on MR is picked up + RemoveNewPnfFromMrSim + Sleep 21 seconds Ensure AAI event on MR is picked up + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Not Contain ${resp.text} pnf_newly_discovered @@ -195,8 +195,9 @@ Verify Measurement Group admin status update from Locking to Locked [Tags] PMSH_16 [Documentation] Verify Measurement Group admin status update from Locking to Locked [Timeout] 60 seconds - SimulatePolicyResponse ${MR_POLICY_RESPONSE_PNF_DELETED} + AddDeletePolicyResponeToMrSim Sleep 31 seconds Ensure Policy response on MR is picked up + ResetMrSim ${resp}= GetMeasGrpCall /subscription/subs_01/measurementGroups/msg_grp_01 Should Be Equal As Strings ${resp.json()['measurementGroupName']} msg_grp_01 Should Be Equal As Strings ${resp.json()['subscriptionName']} subs_01 @@ -295,40 +296,49 @@ SetAdministrativeStateToUnlocked ${resp} = PUT On Session cbs_sim_session url=/expectation data=${data} Should Be True ${resp.status_code} == 201 +AddCreatePolicyResponeToMrSim + ${data}= Get Data From File ${MR_POLICY_RESPONSE_PNF_EXISTING} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "pmsh_cl_input_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_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}= 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') - log 'JSON Response Code:'${resp} - -SimulateNewPNF - [Arguments] ${expected_contents} - ${json_value}= json_from_file ${expected_contents} - ${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} - -SimulateDeletedPNF - [Arguments] ${expected_contents} - ${json_value}= json_from_file ${expected_contents} - ${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} - -PostMrCall - [Arguments] ${url} ${data} - 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} +AddDeletePolicyResponeToMrSim + ${data}= Get Data From File ${MR_POLICY_RESPONSE_PNF_DELETED} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "pmsh_cl_input_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 + +AddNewPnfToMrSim + ${data}= Get Data From File ${MR_AAI_PNF_CREATED} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "mr_aai_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 + +RemoveNewPnfFromMrSim + ${data}= Get Data From File ${MR_AAI_PNF_REMOVED} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/clear data={"id" : "mr_aai_event"} + Should Be True ${resp.status_code} == 200 + Sleep 2 Allow MR_SIM time to set expectation + ${resp} = PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 + +ResetMrSim + ${data}= Get Data From File ${MR_SIM_RESET} + Create Session mr_sim_session ${MR_SIM_BASE_URL} verify=false + ${resp}= PUT On Session mr_sim_session url=/reset + Should Be True ${resp.status_code} == 200 + ${resp}= PUT On Session mr_sim_session url=/expectation data=${data} + Should Be True ${resp.status_code} == 201 GetSubsCall [Arguments] ${url} ${url_path_param} |