diff options
author | stark, steven <steven.stark@att.com> | 2021-01-04 11:40:12 -0800 |
---|---|---|
committer | stark, steven <steven.stark@att.com> | 2021-01-04 11:40:12 -0800 |
commit | 76144a9a772f50cb3ec80757d9f1c1ec119eee6a (patch) | |
tree | 72fdaa300f09c5aeaa7fc7eac0ab80b173e522ae /onap-client/onap_client/so/tests | |
parent | e618989d37d8b786b5b0a9f2fa42bafa32475eed (diff) |
[VVP] ONAP client performance improvement
First of multiple performance patches.
Adding ability to cache data for use by the onap-client.
Changing API call for SDC to get VF and Service models.
Previously to find a service model, onap-client queried
for all models and then searched by name. New api call
to query by name, then find latest version.
Issue-ID: VVP-503
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: I071cadbe52163f0b375bc81ac4a9fd640bd5ca4a
Diffstat (limited to 'onap-client/onap_client/so/tests')
3 files changed, 33 insertions, 3 deletions
diff --git a/onap-client/onap_client/so/tests/test_module_instance.py b/onap-client/onap_client/so/tests/test_module_instance.py index 0e8c655..8ec8a59 100644 --- a/onap-client/onap_client/so/tests/test_module_instance.py +++ b/onap-client/onap_client/so/tests/test_module_instance.py @@ -139,6 +139,18 @@ def test_module_instance(): } ) mockup_catalog_item( + oc.sdc.service.catalog_items["GET_SERVICE_BY_NAME_VERSION"], + override_uri_params={"catalog_service_name": SERVICE_MODEL_NAME, "catalog_service_version": "1.0"}, + override_return_data={ + "uniqueId": SERVICE_MODEL_ID, + "allVersions": { + "1.0": "badid", + "2.0": SERVICE_MODEL_ID + }, + "name": SERVICE_MODEL_NAME, + } + ) + mockup_catalog_item( oc.sdc.vnf.catalog_items["GET_CATALOG_RESOURCE"], override_return_data={ "invariantUUID": VNF_INVARIANT_ID diff --git a/onap-client/onap_client/so/tests/test_service_instance.py b/onap-client/onap_client/so/tests/test_service_instance.py index b215fbf..fed5ac9 100644 --- a/onap-client/onap_client/so/tests/test_service_instance.py +++ b/onap-client/onap_client/so/tests/test_service_instance.py @@ -69,9 +69,9 @@ def test_service_instance(): }, ) mockup_catalog_item( - oc.sdc.service.catalog_items["GET_SDC_SERVICE"], - override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, - override_return_data={"invariantUUID": SERVICE_MODEL_INVARIANT_ID, "uniqueId": SERVICE_MODEL_ID} + oc.sdc.service.catalog_items["GET_SERVICE_BY_NAME_VERSION"], + override_uri_params={"catalog_service_name": SERVICE_MODEL_NAME, "catalog_service_version": "1.0"}, + override_return_data={"invariantUUID": SERVICE_MODEL_INVARIANT_ID, "uniqueId": SERVICE_MODEL_ID, "allVersions": {"1.0": SERVICE_MODEL_ID}} ) mockup_catalog_item( oc.aai.cloud_infrastructure.catalog_items["GET_CLOUD_REGION_TENANTS"], diff --git a/onap-client/onap_client/so/tests/test_vnf_instance.py b/onap-client/onap_client/so/tests/test_vnf_instance.py index 88334b0..9f03cca 100644 --- a/onap-client/onap_client/so/tests/test_vnf_instance.py +++ b/onap-client/onap_client/so/tests/test_vnf_instance.py @@ -90,6 +90,20 @@ def test_vnf_instance(): ], } ) + + mockup_catalog_item( + oc.sdc.service.catalog_items["GET_SERVICE_BY_NAME_VERSION"], + override_uri_params={"catalog_service_name": SERVICE_MODEL_NAME, "catalog_service_version": "1.0"}, + override_return_data={ + "uniqueId": SERVICE_MODEL_ID, + "allVersions": { + "1.0": "badid", + "2.0": SERVICE_MODEL_ID + }, + "name": SERVICE_MODEL_NAME, + } + ) + mockup_catalog_item( oc.sdc.service.catalog_items["GET_SDC_SERVICE"], override_uri_params={"catalog_service_id": SERVICE_MODEL_ID}, @@ -106,6 +120,7 @@ def test_vnf_instance(): ] } ) + mockup_catalog_item( oc.sdc.vnf.catalog_items["GET_CATALOG_RESOURCE"], override_return_data={ @@ -113,6 +128,7 @@ def test_vnf_instance(): }, override_uri_params={"catalog_resource_id": VNF_ACTUAL_UUID}, ) + mockup_catalog_item( oc.sdnc.configuration.catalog_items["GET_SERVICE_INSTANCES"], override_return_data={ @@ -138,6 +154,7 @@ def test_vnf_instance(): } }, ) + mockup_catalog_item( oc.so.service_instantiation.catalog_items["CREATE_VNF_INSTANCE"], override_return_data={ @@ -146,6 +163,7 @@ def test_vnf_instance(): } } ) + mockup_catalog_item( oc.so.service_instantiation.catalog_items["GET_REQUEST_STATUS"], override_uri_params={"request_id": REQUEST_ID}, |