diff options
author | krishnaa96 <krishna.moorthy6@wipro.com> | 2021-09-09 16:23:17 +0530 |
---|---|---|
committer | krishnaa96 <krishna.moorthy6@wipro.com> | 2021-10-04 21:13:51 +0530 |
commit | e35d4a1b94bbcd844300282d1c3c8722ef58062d (patch) | |
tree | 1e3db2313ba02a09feb48842852c8118547072f9 /test/apps/nxi_termination | |
parent | 92373ddd2e28cc2000a2634d273836fea5d87a6e (diff) |
Support second level NSSI in terminate app
Issue-ID: OPTFRA-990
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: If47b19d18e5eb1cbef24418c7697e0770818959f
Diffstat (limited to 'test/apps/nxi_termination')
5 files changed, 102 insertions, 62 deletions
diff --git a/test/apps/nxi_termination/failure_relationship_list.json b/test/apps/nxi_termination/failure_relationship_list.json index 537f283..392f4db 100644 --- a/test/apps/nxi_termination/failure_relationship_list.json +++ b/test/apps/nxi_termination/failure_relationship_list.json @@ -1,27 +1,66 @@ [ + { + "related-to": "allotted-resource", + "relationship-label": "org.onap.relationships.inventory.Uses", + "related-link": "/aai/v23/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/d88b6ce6-19be-439d-8553-4f9d6cce0494/allotted-resources/allotted-resource/07138106-f535-413b-b002-40ba24f95937", + "relationship-data": [ { - "related-to": "service-instance", - "relationship-label": "org.onap.relationships.inventory.ComposedOf", - "related-link": "/aai/v16/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4115d3c8-dd59-45d6-b09d-e756dee9b518", - "relationship-data": [ - { - "relationship-key": "customer.global-customer-id", - "relationship-value": "5GCustomer" - }, - { - "relationship-key": "service-subscription.service-type", - "relationship-value": "5G" - }, - { - "relationship-key": "service-instance.service-instance-id", - "relationship-value": "4115d3c8-dd59-45d6-b09d-e756dee9b567" - } - ], - "related-to-property": [ - { - "property-key": "service-instance.service-instance-name", - "property-value": "nsi_test_0211" - } - ] + "relationship-key": "customer.global-customer-id", + "relationship-value": "5GCustomer" + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": "5G" + }, + { + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "07138106-f535-413b-b002-40ba24f95937" + }, + { + "relationship-key": "allotted-resource.id", + "relationship-value": "07138106-f535-413b-b002-40ba24f95937" + } + ], + "related-to-property": [ + { + "property-key": "allotted-resource.description" + }, + { + "property-key": "allotted-resource.allotted-resource-name", + "property-value": "Allotted_coe" + } + ] + }, + { + "related-to": "allotted-resource", + "relationship-label": "org.onap.relationships.inventory.Uses", + "related-link": "/aai/v23/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/d88b6ce6-19be-439d-8553-4f9d6cce0494/allotted-resources/allotted-resource/07138106-f535-413b-b002-40ba24f95937", + "relationship-data": [ + { + "relationship-key": "customer.global-customer-id", + "relationship-value": "5GCustomer" + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": "5G" + }, + { + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "d290f1ee-6c54-4b01-90e6-d701748f0851" + }, + { + "relationship-key": "allotted-resource.id", + "relationship-value": "d290f1ee-6c54-4b01-90e6-d701748f0851" + } + ], + "related-to-property": [ + { + "property-key": "allotted-resource.description" + }, + { + "property-key": "allotted-resource.allotted-resource-name", + "property-value": "Allotted_terminate" } - ]
\ No newline at end of file + ] + } +]
\ No newline at end of file diff --git a/test/apps/nxi_termination/invalid_request.json b/test/apps/nxi_termination/invalid_request.json index 793776d..72eafd7 100644 --- a/test/apps/nxi_termination/invalid_request.json +++ b/test/apps/nxi_termination/invalid_request.json @@ -6,7 +6,7 @@ "sourceId": "SO", "timeout": 5, "addtnlArgs": { - "serviceProfileId":"cdad9f49-4201-4e3a-aac1-b0f27902c299" + "serviceInstanceId":"cdad9f49-4201-4e3a-aac1-b0f27902c299" } }, "type":"NST", @@ -14,4 +14,4 @@ "UUID":"d290f1ee-6c54-4b01-90e6-d701748f0851", "invariantUUID":"d290f1ee-6c54-4b01-90e6-d701748f0851" -}
\ No newline at end of file +} diff --git a/test/apps/nxi_termination/nxi_termination.json b/test/apps/nxi_termination/nxi_termination.json index ac53c4d..1e25f2e 100644 --- a/test/apps/nxi_termination/nxi_termination.json +++ b/test/apps/nxi_termination/nxi_termination.json @@ -6,7 +6,7 @@ "sourceId": "SO", "timeout": 5, "addtnlArgs": { - "serviceProfileId":"cdad9f49-4201-4e3a-aac1-b0f27902c299" + "serviceInstanceId":"cdad9f49-4201-4e3a-aac1-b0f27902c299" } }, "type":"NSI", @@ -14,4 +14,4 @@ "UUID":"d290f1ee-6c54-4b01-90e6-d701748f0851", "invariantUUID":"d290f1ee-6c54-4b01-90e6-d701748f0851" -}
\ No newline at end of file +} diff --git a/test/apps/nxi_termination/success_relationship_list.json b/test/apps/nxi_termination/success_relationship_list.json index 4f2a8bb..608418d 100644 --- a/test/apps/nxi_termination/success_relationship_list.json +++ b/test/apps/nxi_termination/success_relationship_list.json @@ -1,27 +1,34 @@ [ + { + "related-to": "allotted-resource", + "relationship-label": "org.onap.relationships.inventory.Uses", + "related-link": "/aai/v23/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/d88b6ce6-19be-439d-8553-4f9d6cce0494/allotted-resources/allotted-resource/07138106-f535-413b-b002-40ba24f95937", + "relationship-data": [ { - "related-to": "service-instance", - "relationship-label": "org.onap.relationships.inventory.ComposedOf", - "related-link": "/aai/v16/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/4115d3c8-dd59-45d6-b09d-e756dee9b518", - "relationship-data": [ - { - "relationship-key": "customer.global-customer-id", - "relationship-value": "5GCustomer" - }, - { - "relationship-key": "service-subscription.service-type", - "relationship-value": "5G" - }, - { - "relationship-key": "service-instance.service-instance-id", - "relationship-value": "4115d3c8-dd59-45d6-b09d-e756dee9b518" - } - ], - "related-to-property": [ - { - "property-key": "service-instance.service-instance-name", - "property-value": "nsi_test_0211" - } - ] + "relationship-key": "customer.global-customer-id", + "relationship-value": "5GCustomer" + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": "5G" + }, + { + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "cdad9f49-4201-4e3a-aac1-b0f27902c299" + }, + { + "relationship-key": "allotted-resource.id", + "relationship-value": "07138106-f535-413b-b002-40ba24f95937" + } + ], + "related-to-property": [ + { + "property-key": "allotted-resource.description" + }, + { + "property-key": "allotted-resource.allotted-resource-name", + "property-value": "Allotted_coe" } - ]
\ No newline at end of file + ] + } +]
\ No newline at end of file diff --git a/test/apps/nxi_termination/test_remote_opt_processor_termination.py b/test/apps/nxi_termination/test_remote_opt_processor_termination.py index 9fbc27b..555f2e8 100644 --- a/test/apps/nxi_termination/test_remote_opt_processor_termination.py +++ b/test/apps/nxi_termination/test_remote_opt_processor_termination.py @@ -69,13 +69,13 @@ class TestRemoteOptProcessor(unittest.TestCase): exception_response_json1 = json_from_file(exception_response_file1) #nsi success scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', return_value=1) + self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_allotted_resources', return_value=success_rel_json) self.Mock_req = self.patcher_req.start() self.assertEquals(success_output_json, process_nxi_termination_opt(request_json, osdf_config)) self.patcher_req.stop() #nsi failure scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', return_value=3) + self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_allotted_resources', return_value=failure_rel_json) self.Mock_req = self.patcher_req.start() self.assertEquals(nxi_failure_output_json1, process_nxi_termination_opt(request_json, osdf_config)) self.patcher_req.stop() @@ -83,18 +83,12 @@ class TestRemoteOptProcessor(unittest.TestCase): request_json["requestInfo"]["addtnlArgs"] = {} #nsi success scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', - return_value=0) + self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_allotted_resources', + return_value=[]) self.Mock_req = self.patcher_req.start() self.assertEquals(success_output_json, process_nxi_termination_opt(request_json, osdf_config)) self.patcher_req.stop() - # nsi failure scenario - self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', - return_value=1) - self.Mock_req = self.patcher_req.start() - self.assertEquals(nxi_failure_output_json2, process_nxi_termination_opt(request_json, osdf_config)) - self.patcher_req.stop() # # # nssi success scenario self.patcher_req = patch('apps.nxi_termination.optimizers.remote_opt_processor.get_resource_count', return_value=1) |