From 44ffee127dc8f1dc4cd793f4dd1e375057c33086 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Sun, 9 Feb 2020 14:06:25 +0200 Subject: [PATCH] upgrade vfmodule when upgraded already service, vnf and brother vfmodule e2e - Use modelCustomizationId and modelVersionId from instance, instead of service-model hierarchy - Adds a Cypress test-case in viewEditUpgradeVfModule.e2e.ts - Assumes topology improved response in payload of: upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_instance.json (see Change Ib25c6cf7269614f2f4d332b3aa84b3307a59ebda) Issue-ID: Issue-ID: VID-771 Change-Id: I9d200dd619a3c3d0503f47777efd3780eaa2b7b2 Signed-off-by: Ittay Stern Signed-off-by: Alexey Sandler --- ...ted_to_current_model_e2e__fe_input_cypress.json | 193 +++++++++++++++++++++ .../integration/iFrames/drawingBoard.e2e.ts | 6 +- .../iFrames/viewEditUpgradeVfModule.e2e.ts | 45 ++++- .../iFrames/viewOnlyDrawingBoard.e2e.ts | 2 +- ...dule_alredy_upgraded_e2e__service_instance.json | 165 ++++++++++++++++++ ...fmodule_alredy_upgraded_e2e__service_model.json | 137 +++++++++++++++ .../objectToInstanceTree.service.spec.ts | 3 +- .../src/app/shared/models/treeNodeModel.ts | 9 +- .../default.data.generator.service.spec.ts | 38 +++- .../default.data.generator.service.ts | 6 +- 10 files changed, 592 insertions(+), 12 deletions(-) create mode 100644 vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_not_related_to_current_model_e2e__fe_input_cypress.json create mode 100644 vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_instance.json create mode 100644 vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_model.json diff --git a/vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_not_related_to_current_model_e2e__fe_input_cypress.json b/vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_not_related_to_current_model_e2e__fe_input_cypress.json new file mode 100644 index 000000000..77cd6df41 --- /dev/null +++ b/vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_not_related_to_current_model_e2e__fe_input_cypress.json @@ -0,0 +1,193 @@ +{ + "action": "None_Upgrade", + "aicZoneId": null, + "aicZoneName": null, + "bulkSize": 1, + "cloudOwner": null, + "collectionResources": { + }, + "existingNames": { + "pst-vf-phase-1": "" + }, + "existingNetworksCounterMap": { + }, + "existingVNFCounterMap": { + "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912": 1 + }, + "existingVnfGroupCounterMap": { + }, + "existingVRFCounterMap": { + }, + "globalSubscriberId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "instanceId": "b153e8ce-2d00-4466-adc0-14bad70f150c", + "instanceName": "PST-Vf-Phase-1", + "instanceParams": [ + ], + "isALaCarte": true, + "isDirty": false, + "lcpCloudRegionId": null, + "modelInfo": { + "modelInvariantId": "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6", + "modelName": "CHARLOTTE 01222020 Svc", + "modelType": "service", + "modelVersion": "3.0", + "modelVersionId": "a243da28-c11e-45a8-9f26-0284a9a789bc" + }, + "networks": { + }, + "orchStatus": "Active", + "owningEntityId": null, + "owningEntityName": null, + "productFamilyId": null, + "projectName": null, + "rollbackOnFailure": false, + "subscriptionServiceType": "Emanuel", + "tenantId": null, + "tenantName": null, + "testApi": "GR_API", + "validationCounter": 0, + "vidNotions": { + "instantiationType": "ALaCarte", + "instantiationUI": "anyAlacarteWhichNotExcluded", + "modelCategory": "other", + "viewEditUI": "legacy" + }, + "vnfGroups": { + }, + "vnfs": { + "fa546506-b754-445c-b0d6-d36b6978de77": { + "action": "None_Upgrade", + "cloudOwner": "irma-aic", + "inMaint": false, + "instanceId": "fa546506-b754-445c-b0d6-d36b6978de77", + "instanceName": "PST-Vf-Phase-1-Vnf", + "instanceType": "CHARLOTTE 01222020 Svc/CHARLOTTE 01222020 0", + "lcpCloudRegionId": "olson5a", + "legacyRegion": null, + "lineOfBusiness": null, + "modelInfo": { + "modelCustomizationId": "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912", + "modelCustomizationName": "CHARLOTTE 01222020 0", + "modelInvariantId": "2ef6541d-d5bb-41ea-bcce-8fb2396a74da", + "modelName": "CHARLOTTE 01222020", + "modelType": "vnf", + "modelVersion": "3.0", + "modelVersionId": "803fdb3e-b4c9-451c-a020-f15cd1fda041" + }, + "networks": { + }, + "orchStatus": "Active", + "originalName": "CHARLOTTE 01222020 0", + "platformName": null, + "productFamilyId": null, + "provStatus": "PREPROV", + "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08", + "trackById": "fa546506-b754-445c-b0d6-d36b6978de77", + "upgradedVFMSonsCounter": 1, + "uuid": "803fdb3e-b4c9-451c-a020-f15cd1fda041", + "vfModules": { + "mdns012220200..Mdns01222020..base_dns..module-0": { + "82637987-9c31-4ce6-8e0d-5b98a12bb3fb": { + "action": "None", + "cloudOwner": null, + "inMaint": false, + "instanceId": "82637987-9c31-4ce6-8e0d-5b98a12bb3fb", + "instanceName": "PST-Vf-Phase-1-Base", + "instanceType": null, + "isBase": true, + "lcpCloudRegionId": null, + "legacyRegion": null, + "lineOfBusiness": null, + "modelInfo": { + "modelCustomizationId": "82160e6e-d9c4-45ef-bd19-01573ab11b61", + "modelCustomizationName": "Mdns01222020..base_dns..module-0", + "modelInvariantId": "44fc8655-f639-44e0-ad1f-4cd434ac17da", + "modelName": "Mdns01222020..base_dns..module-0", + "modelType": "vfModule", + "modelVersion": "1", + "modelVersionId": "ed404f69-f351-4566-9fde-1199b3a6a647" + }, + "orchStatus": "Active", + "originalName": "mdns012220200..Mdns01222020..base_dns..module-0", + "platformName": null, + "productFamilyId": null, + "provStatus": null, + "tenantId": null, + "trackById": "82637987-9c31-4ce6-8e0d-5b98a12bb3fb", + "uuid": "ed404f69-f351-4566-9fde-1199b3a6a647", + "volumeGroupName": null + } + }, + "mdns012220200..Mdns01222020..dns_az_01..module-1": { + "48b9c7ae-490c-44af-b4dc-09b133d2fb89": { + "action": "None", + "cloudOwner": "irma-aic", + "inMaint": false, + "instanceId": "48b9c7ae-490c-44af-b4dc-09b133d2fb89", + "instanceName": "PST-Vf-Phase-1-Vf-Addon", + "instanceType": null, + "isBase": false, + "lcpCloudRegionId": "olson5a", + "legacyRegion": null, + "lineOfBusiness": null, + "modelInfo": { + "modelCustomizationId": "2f74b6b2-8627-403e-b696-4c43fe5b19a5", + "modelCustomizationName": "Mdns01222020..dns_az_01..module-1", + "modelInvariantId": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0", + "modelName": "Mdns01222020..dns_az_01..module-1", + "modelType": "vfModule", + "modelVersion": "3", + "modelVersionId": "c449aaf8-2467-41a9-9015-730ab48ca19b" + }, + "orchStatus": "Active", + "originalName": "mdns012220200..Mdns01222020..dns_az_01..module-1", + "platformName": null, + "productFamilyId": null, + "provStatus": null, + "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08", + "trackById": "48b9c7ae-490c-44af-b4dc-09b133d2fb89", + "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b", + "volumeGroupName": null + }, + "5576b76d-30c4-43b2-ac43-f3b0c0e6a61e": { + "action": "None_Upgrade", + "cloudOwner": "irma-aic", + "inMaint": false, + "instanceId": "5576b76d-30c4-43b2-ac43-f3b0c0e6a61e", + "instanceName": "PST-Vf-Phase-1-Vf-Addon2", + "instanceType": null, + "isBase": false, + "lcpCloudRegionId": "olson5a", + "legacyRegion": null, + "lineOfBusiness": null, + "modelInfo": { + "modelCustomizationId": "f34b65fe-fbc5-4eb6-92cd-776d06eaf0ae", + "modelCustomizationName": "Mdns01222020..dns_az_01..module-1", + "modelInvariantId": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0", + "modelName": "Mdns01222020..dns_az_01..module-1", + "modelType": "vfModule", + "modelVersion": "1", + "modelVersionId": "3412fe1f-e103-4777-90c0-f66d888f4bed" + }, + "orchStatus": "Active", + "originalName": "mdns012220200..Mdns01222020..dns_az_01..module-1", + "platformName": null, + "productFamilyId": null, + "provStatus": null, + "retainAssignments": false, + "sdncPreLoad": true, + "supplementaryFile": null, + "supplementaryFile_hidden": null, + "supplementaryFile_hidden_content": null, + "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08", + "trackById": "5576b76d-30c4-43b2-ac43-f3b0c0e6a61e", + "uuid": "3412fe1f-e103-4777-90c0-f66d888f4bed", + "volumeGroupName": null + } + } + } + } + }, + "vrfs": { + } +} \ No newline at end of file diff --git a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts index 4a8b89a2c..88ad8e8a2 100644 --- a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts @@ -3415,7 +3415,7 @@ describe('Drawing board', function () { "modelInfo": { "modelType": "VF", "modelInvariantId": "5be7e99e-8eb2-4d97-be63-8081ff3cd10e", - "modelVersionId": "f4d84bb4-a416-4b4e-997e-0059973630b9", + "modelVersionId": "ea81d6f7-0861-44a7-b7d5-d173b562c350", "modelName": "2017-488_PASQUALE-vPE", "modelVersion": "9.0", "modelCustomizationName": "2017-488_PASQUALE-vPE 0" @@ -3455,7 +3455,7 @@ describe('Drawing board', function () { "modelInfo": { "modelType": "VF", "modelInvariantId": "5be7e99e-8eb2-4d97-be63-8081ff3cd10e", - "modelVersionId": "f4d84bb4-a416-4b4e-997e-0059973630b9", + "modelVersionId": "ea81d6f7-0861-44a7-b7d5-d173b562c350", "modelName": "2017-488_PASQUALE-vPE", "modelVersion": "9.0", "modelCustomizationName": "2017-488_PASQUALE-vPE 0" @@ -5065,7 +5065,7 @@ describe('Drawing board', function () { "modelInfo": { "modelType": "VF", "modelInvariantId": "5be7e99e-8eb2-4d97-be63-8081ff3cd10e", - "modelVersionId": "f4d84bb4-a416-4b4e-997e-0059973630b9", + "modelVersionId": "ea81d6f7-0861-44a7-b7d5-d173b562c350", "modelName": "2017-488_PASQUALE-vPE", "modelVersion": "9.0", "modelCustomizationName": "2017-488_PASQUALE-vPE 0" diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts index ad15ce383..6338a10b5 100644 --- a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts @@ -143,7 +143,6 @@ describe('View Edit Page: Upgrade VFModule', function () { afterEach(() => { cy.screenshot(); }); - it(`Upgrade a VFModule: another case e2e`, function () { const serviceType = 'Emanuel'; @@ -189,6 +188,50 @@ describe('View Edit Page: Upgrade VFModule', function () { }); + it(`Upgrade a VFModule: upgrade vfmodule when upgraded already service, vnf and borther vfmodule e2e`, function () { + + const serviceType = 'Emanuel'; + const subscriberId = 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb'; + const serviceModelId = 'a243da28-c11e-45a8-9f26-0284a9a789bc'; + const serviceInstanceId = 'b153e8ce-2d00-4466-adc0-14bad70f150c'; + const serviceInvariantUuid = "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6"; + + cy.initDrawingBoardUserPermission(); + + cy.route(`**/rest/models/services/${serviceModelId}`, + 'fixture:../support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_model.json') + .as('serviceModel2'); + + cy.route(`**/aai_get_service_instance_topology/${subscriberId}/${serviceType}/${serviceInstanceId}`, + 'fixture:../support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_instance.json') + .as('serviceInstance2'); + + cy.route(`**/aai_get_newest_model_version_by_invariant/${serviceInvariantUuid}`, { + "modelVersionId": "a243da28-c11e-45a8-9f26-0284a9a789bc", + "modelName": "CHARLOTTE 01222020 Svc", + "modelVersion": "3.0", + "distributionStatus": "DISTRIBUTION_COMPLETE_OK", + "resourceVersion": "1580246673596", + "modelDescription": "test model for VF module replacement", + "orchestrationType": null + } + ).as("newestModelVersion2"); + + cy.openIframe(`app/ui/#/servicePlanning/EDIT?serviceModelId=${serviceModelId}&subscriberId=${subscriberId}&serviceType=${serviceType}&serviceInstanceId=${serviceInstanceId}`); + + upgradeTheVFM('node-3412fe1f-e103-4777-90c0-f66d888f4bed-mdns012220200..Mdns01222020..dns_az_01..module-1', false); + + mockAsyncBulkResponse(); + cy.getDrawingBoardDeployBtn().click(); + + cy.wait('@expectedPostAsyncInstantiation').then(xhr => { + cy.readFile('../vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_not_related_to_current_model_e2e__fe_input_cypress.json').then((expectedResult) => { + cy.deepCompare(xhr.request.body, expectedResult); + }); + }); + + }); + }); diff --git a/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts index de5facf89..1d94454fb 100644 --- a/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts @@ -232,7 +232,7 @@ describe('View only drawing board', function () { 'status-property-provStatus': '', 'status-property-inMaint': '', }, - 'node-undefined-dc229cd8-c132-4455-8517-5c1787c18b14:0': { + 'node-dc229cd8-c132-4455-8517-5c1787c18b14-dc229cd8-c132-4455-8517-5c1787c18b14:0': { 'node-type-indicator': 'M', 'node-name': 'ss820f_0918_base', 'status-property-orchStatus': 'Assigned', diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_instance.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_instance.json new file mode 100644 index 000000000..69e62d657 --- /dev/null +++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_instance.json @@ -0,0 +1,165 @@ +{ + "action": "None", + "instanceName": "PST-Vf-Phase-1", + "instanceId": "b153e8ce-2d00-4466-adc0-14bad70f150c", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": null, + "tenantId": null, + "cloudOwner": null, + "modelInfo": { + "modelInvariantId": "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6", + "modelVersionId": "a243da28-c11e-45a8-9f26-0284a9a789bc", + "modelName": "CHARLOTTE 01222020 Svc", + "modelType": "service", + "modelVersion": "3.0" + }, + "globalSubscriberId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "subscriptionServiceType": "Emanuel", + "owningEntityId": null, + "owningEntityName": null, + "tenantName": null, + "aicZoneId": null, + "aicZoneName": null, + "projectName": null, + "rollbackOnFailure": null, + "isALaCarte": true, + "vnfs": { + "fa546506-b754-445c-b0d6-d36b6978de77": { + "action": "None", + "instanceName": "PST-Vf-Phase-1-Vnf", + "instanceId": "fa546506-b754-445c-b0d6-d36b6978de77", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": "olson5a", + "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08", + "cloudOwner": "irma-aic", + "modelInfo": { + "modelCustomizationName": "CHARLOTTE 01222020 0", + "modelCustomizationId": "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912", + "modelInvariantId": "2ef6541d-d5bb-41ea-bcce-8fb2396a74da", + "modelVersionId": "803fdb3e-b4c9-451c-a020-f15cd1fda041", + "modelName": "CHARLOTTE 01222020", + "modelType": "vnf", + "modelVersion": "3.0" + }, + "instanceType": "CHARLOTTE 01222020 Svc/CHARLOTTE 01222020 0", + "provStatus": "PREPROV", + "inMaint": false, + "uuid": "803fdb3e-b4c9-451c-a020-f15cd1fda041", + "originalName": "CHARLOTTE 01222020 0", + "legacyRegion": null, + "lineOfBusiness": null, + "platformName": null, + "trackById": "fa546506-b754-445c-b0d6-d36b6978de77", + "vfModules": { + "mdns012220200..Mdns01222020..base_dns..module-0": { + "82637987-9c31-4ce6-8e0d-5b98a12bb3fb": { + "action": "None", + "instanceName": "PST-Vf-Phase-1-Base", + "instanceId": "82637987-9c31-4ce6-8e0d-5b98a12bb3fb", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": null, + "tenantId": null, + "cloudOwner": null, + "modelInfo": { + "modelCustomizationName": "Mdns01222020..base_dns..module-0", + "modelCustomizationId": "82160e6e-d9c4-45ef-bd19-01573ab11b61", + "modelInvariantId": "44fc8655-f639-44e0-ad1f-4cd434ac17da", + "modelVersionId": "ed404f69-f351-4566-9fde-1199b3a6a647", + "modelName": "Mdns01222020..base_dns..module-0", + "modelType": "vfModule", + "modelVersion": "1" + }, + "instanceType": null, + "provStatus": null, + "inMaint": false, + "uuid": "ed404f69-f351-4566-9fde-1199b3a6a647", + "originalName": "mdns012220200..Mdns01222020..base_dns..module-0", + "legacyRegion": null, + "lineOfBusiness": null, + "platformName": null, + "trackById": "82637987-9c31-4ce6-8e0d-5b98a12bb3fb", + "isBase": true, + "volumeGroupName": null + } + }, + "mdns012220200..Mdns01222020..dns_az_01..module-1": { + "48b9c7ae-490c-44af-b4dc-09b133d2fb89": { + "action": "None", + "instanceName": "PST-Vf-Phase-1-Vf-Addon", + "instanceId": "48b9c7ae-490c-44af-b4dc-09b133d2fb89", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": "olson5a", + "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08", + "cloudOwner": "irma-aic", + "modelInfo": { + "modelCustomizationName": "Mdns01222020..dns_az_01..module-1", + "modelCustomizationId": "2f74b6b2-8627-403e-b696-4c43fe5b19a5", + "modelInvariantId": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0", + "modelVersionId": "c449aaf8-2467-41a9-9015-730ab48ca19b", + "modelName": "Mdns01222020..dns_az_01..module-1", + "modelType": "vfModule", + "modelVersion": "3" + }, + "instanceType": null, + "provStatus": null, + "inMaint": false, + "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b", + "originalName": "mdns012220200..Mdns01222020..dns_az_01..module-1", + "legacyRegion": null, + "lineOfBusiness": null, + "platformName": null, + "trackById": "48b9c7ae-490c-44af-b4dc-09b133d2fb89", + "isBase": false, + "volumeGroupName": null + }, + "5576b76d-30c4-43b2-ac43-f3b0c0e6a61e": { + "action": "None", + "instanceName": "PST-Vf-Phase-1-Vf-Addon2", + "instanceId": "5576b76d-30c4-43b2-ac43-f3b0c0e6a61e", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": "olson5a", + "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08", + "cloudOwner": "irma-aic", + "modelInfo": { + "modelCustomizationName": "Mdns01222020..dns_az_01..module-1", + "modelCustomizationId": "f34b65fe-fbc5-4eb6-92cd-776d06eaf0ae", + "modelInvariantId": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0", + "modelVersionId": "3412fe1f-e103-4777-90c0-f66d888f4bed", + "modelName": "Mdns01222020..dns_az_01..module-1", + "modelType": "vfModule", + "modelVersion": "1" + }, + "instanceType": null, + "provStatus": null, + "inMaint": false, + "uuid": "3412fe1f-e103-4777-90c0-f66d888f4bed", + "originalName": "mdns012220200..Mdns01222020..dns_az_01..module-1", + "legacyRegion": null, + "lineOfBusiness": null, + "platformName": null, + "trackById": "5576b76d-30c4-43b2-ac43-f3b0c0e6a61e", + "isBase": false, + "volumeGroupName": null + } + } + }, + "networks": {} + } + }, + "networks": {}, + "vrfs": {}, + "vnfGroups": {}, + "collectionResources": {}, + "validationCounter": 0, + "existingVNFCounterMap": { + "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912": 1 + }, + "existingNetworksCounterMap": {}, + "existingVnfGroupCounterMap": {}, + "existingVRFCounterMap": {} +} diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_model.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_model.json new file mode 100644 index 000000000..c7ea58fb2 --- /dev/null +++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/upgradeVfModule/upgrade_vfmodule_when_service_vnf_and_brother_vfmodule_alredy_upgraded_e2e__service_model.json @@ -0,0 +1,137 @@ +{ + "service": { + "uuid": "a243da28-c11e-45a8-9f26-0284a9a789bc", + "invariantUuid": "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6", + "name": "CHARLOTTE 01222020 Svc", + "version": "3.0", + "toscaModelURL": null, + "category": "Emanuel", + "serviceType": "", + "serviceRole": "", + "description": "test model for VF module replacement", + "serviceEcompNaming": "true", + "instantiationType": "A-La-Carte", + "inputs": {}, + "vidNotions": { + "instantiationUI": "anyAlacarteWhichNotExcluded", + "modelCategory": "other", + "viewEditUI": "legacy", + "instantiationType": "ALaCarte" + } + }, + "vnfs": { + "CHARLOTTE 01222020 0": { + "uuid": "803fdb3e-b4c9-451c-a020-f15cd1fda041", + "invariantUuid": "2ef6541d-d5bb-41ea-bcce-8fb2396a74da", + "description": "VSP model for VF module replacement testing", + "name": "CHARLOTTE 01222020", + "version": "3.0", + "customizationUuid": "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912", + "inputs": {}, + "commands": {}, + "properties": { + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "false", + "nf_naming_code": "fapn", + "nf_function": "FIRSTNET-APN-DNS", + "availability_zone_max_count": "1", + "nf_role": "vAPNDNS", + "ecomp_generated_naming": "true", + "node_count": "4.0", + "dns_image_name": "16.04 for KVM VMs - NO TOOLS", + "nf_type": "DNS", + "route_eth0": "172.20.27.128/32 via 172.26.18.1 dev eth0 ", + "dns_flavor_name": "nv.c2r4d20" + }, + "type": "VF", + "modelCustomizationName": "CHARLOTTE 01222020 0", + "vfModules": { + "mdns012220200..Mdns01222020..base_dns..module-0": { + "uuid": "ed404f69-f351-4566-9fde-1199b3a6a647", + "invariantUuid": "44fc8655-f639-44e0-ad1f-4cd434ac17da", + "customizationUuid": "c9b32003-febc-44e0-a97f-7630fa7fa4a0", + "description": null, + "name": "Mdns01222020..base_dns..module-0", + "version": "3", + "modelCustomizationName": "Mdns01222020..base_dns..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_dns", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "mdns012220200..Mdns01222020..dns_az_01..module-1": { + "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b", + "invariantUuid": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0", + "customizationUuid": "2f74b6b2-8627-403e-b696-4c43fe5b19a5", + "description": null, + "name": "Mdns01222020..dns_az_01..module-1", + "version": "3", + "modelCustomizationName": "Mdns01222020..dns_az_01..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "dns_az_01", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": false + } + }, + "volumeGroups": {}, + "vfcInstanceGroups": {} + } + }, + "networks": {}, + "collectionResources": {}, + "configurations": {}, + "fabricConfigurations": {}, + "serviceProxies": {}, + "vfModules": { + "mdns012220200..Mdns01222020..base_dns..module-0": { + "uuid": "ed404f69-f351-4566-9fde-1199b3a6a647", + "invariantUuid": "44fc8655-f639-44e0-ad1f-4cd434ac17da", + "customizationUuid": "c9b32003-febc-44e0-a97f-7630fa7fa4a0", + "description": null, + "name": "Mdns01222020..base_dns..module-0", + "version": "3", + "modelCustomizationName": "Mdns01222020..base_dns..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base_dns", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + }, + "mdns012220200..Mdns01222020..dns_az_01..module-1": { + "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b", + "invariantUuid": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0", + "customizationUuid": "2f74b6b2-8627-403e-b696-4c43fe5b19a5", + "description": null, + "name": "Mdns01222020..dns_az_01..module-1", + "version": "3", + "modelCustomizationName": "Mdns01222020..dns_az_01..module-1", + "properties": { + "minCountInstances": 0, + "maxCountInstances": null, + "initialCount": 0, + "vfModuleLabel": "dns_az_01", + "baseModule": false + }, + "inputs": {}, + "volumeGroupAllowed": false + } + }, + "volumeGroups": {}, + "pnfs": {}, + "vnfGroups": {}, + "vrfs": {} +} diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts index 5cf6e96f7..43c3d2677 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts @@ -2261,9 +2261,10 @@ describe('Model Tree Generator service', () => { "modelInfo": { "modelType": "VF", "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", - "modelVersionId": "6b528779-44a3-4472-bdff-9cd15ec93450", + "modelVersionId": "afacccf6-397d-45d6-b5ae-94c39734b168", "modelName": "2017-388_PASQUALE-vPE", "modelVersion": "4.0", + "modelCustomizationId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c", "modelCustomizationName": "2017-388_PASQUALE-vPE 0" } }, diff --git a/vid-webpack-master/src/app/shared/models/treeNodeModel.ts b/vid-webpack-master/src/app/shared/models/treeNodeModel.ts index 39f56228e..8da204ce6 100644 --- a/vid-webpack-master/src/app/shared/models/treeNodeModel.ts +++ b/vid-webpack-master/src/app/shared/models/treeNodeModel.ts @@ -34,9 +34,14 @@ export class TreeNodeModel { instanceName?: string; constructor(instance: ChildNodeInstance, nodeModel: NodeModel){ + this.modelInvariantId = nodeModel.invariantUuid; - this.modelCustomizationId = nodeModel.customizationUuid; - this.modelId = nodeModel.uuid; + if (instance.modelInfo) { + this.modelCustomizationId = instance.modelInfo.modelCustomizationId; + this.modelId = instance.modelInfo.modelVersionId; + } else { + console.debug("no 'modelInfo' in node-instance", instance) + } this.modelUniqueId = this.modelCustomizationId || this.modelId; this.missingData = false; this.id = instance.trackById; diff --git a/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.spec.ts b/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.spec.ts index 03461eaa1..56f49e75c 100644 --- a/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.spec.ts +++ b/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.spec.ts @@ -69,7 +69,7 @@ describe('Default Data Generator Service', () => { expect(result.platformName).toBeNull(); expect(result.modelInfo.modelType).toEqual('VF'); expect(result.modelInfo.modelInvariantId).toEqual(serviceHierarchy.vnfs[vnfName].invariantUuid); - expect(result.modelInfo.modelVersionId).toEqual(formValues.modelInfo.modelVersionId); + expect(result.modelInfo.modelVersionId).toEqual(serviceHierarchy.vnfs[vnfName].uuid); expect(result.modelInfo.modelName).toEqual(serviceHierarchy.vnfs[vnfName].name); expect(result.modelInfo.modelVersion).toEqual(serviceHierarchy.vnfs[vnfName].version); expect(result.modelInfo.modelCustomizationId).toEqual(serviceHierarchy.vnfs[vnfName].customizationUuid); @@ -114,6 +114,15 @@ describe('Default Data Generator Service', () => { const newVfModule = service.createNewVfModuleTreeNode({ instanceName: "", instanceParams: {}, + modelInfo: { + "modelCustomizationName": "VF_vGeraldine 0", + "modelName": "VF_vGeraldine 0", + "modelCustomizationId": "91415b44-753d-494c-926a-456a9172bbb9", + "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e", + "modelVersionId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "modelType": "vnf", + "modelVersion": "1" + }, volumeGroupName: "", isMissingData : false, trackById: Math.random().toString() @@ -128,6 +137,15 @@ describe('Default Data Generator Service', () => { const newVfModule = service.createNewVfModuleTreeNode({ instanceName: "", instanceParams: {}, + modelInfo: { + "modelCustomizationName": "VF_vGeraldine 0", + "modelName": "VF_vGeraldine 0", + "modelCustomizationId": "91415b44-753d-494c-926a-456a9172bbb9", + "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e", + "modelVersionId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "modelType": "vnf", + "modelVersion": "1" + }, volumeGroupName: "", isMissingData : false, trackById: Math.random().toString() @@ -152,6 +170,15 @@ describe('Default Data Generator Service', () => { rollbackOnFailure: "rollbackOnFailure", originalName : null, vfModules: {}, + modelInfo: { + "modelCustomizationName": "VF_vGeraldine 0", + "modelName": "VF_vGeraldine 0", + "modelCustomizationId": "91415b44-753d-494c-926a-456a9172bbb9", + "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e", + "modelVersionId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "modelType": "vnf", + "modelVersion": "1" + }, isMissingData: false, trackById: Math.random().toString(), vnfStoreKey: "abc" @@ -174,6 +201,15 @@ describe('Default Data Generator Service', () => { rollbackOnFailure: "rollbackOnFailure", originalName : null, vfModules: {}, + modelInfo: { + "modelCustomizationName": "VF_vGeraldine 0", + "modelName": "VF_vGeraldine 0", + "modelCustomizationId": "91415b44-753d-494c-926a-456a9172bbb9", + "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e", + "modelVersionId": "d6557200-ecf2-4641-8094-5393ae3aae60", + "modelType": "vnf", + "modelVersion": "1" + }, isMissingData: false, trackById: Math.random().toString(), vnfStoreKey: "abc" diff --git a/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.ts b/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.ts index a3cb475a0..3b3092a4c 100644 --- a/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.ts +++ b/vid-webpack-master/src/app/shared/services/defaultDataServiceGenerator/default.data.generator.service.ts @@ -359,7 +359,7 @@ export class DefaultDataGeneratorService { 'modelInfo': { 'modelType': 'VF', 'modelInvariantId': serviceHierarchy.vnfs[vnfName].invariantUuid, - 'modelVersionId': formValues.modelInfo.modelVersionId, + 'modelVersionId': serviceHierarchy.vnfs[vnfName].uuid, 'modelName': serviceHierarchy.vnfs[vnfName].name, 'modelVersion': serviceHierarchy.vnfs[vnfName].version, 'modelCustomizationId': serviceHierarchy.vnfs[vnfName].customizationUuid, @@ -382,7 +382,7 @@ export class DefaultDataGeneratorService { 'modelInfo': { 'modelType': 'VF', 'modelInvariantId': serviceHierarchy.network[networkName].invariantUuid, - 'modelVersionId': formValues.modelInfo.modelVersionId, + 'modelVersionId': serviceHierarchy.network[networkName].uuid, 'modelName': serviceHierarchy.network[networkName].name, 'modelVersion': serviceHierarchy.network[networkName].version, 'modelCustomizationId': serviceHierarchy.network[networkName].modelCustomizationId, @@ -401,7 +401,7 @@ export class DefaultDataGeneratorService { 'modelInfo': { 'modelType': 'VnfGroup', 'modelInvariantId': serviceHierarchy.vnfGroups[vnfGroupName].invariantUuid, - 'modelVersionId': formValues.modelInfo.modelVersionId, + 'modelVersionId': serviceHierarchy.vnfGroups[vnfGroupName].uuid, 'modelName': serviceHierarchy.vnfGroups[vnfGroupName].name, 'modelVersion': serviceHierarchy.vnfGroups[vnfGroupName].version, 'modelCustomizationId': serviceHierarchy.vnfGroups[vnfGroupName].modelCustomizationId, -- 2.16.6