From 44ffee127dc8f1dc4cd793f4dd1e375057c33086 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Sun, 9 Feb 2020 14:06:25 +0200 Subject: 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 --- .../src/app/shared/models/treeNodeModel.ts | 9 +++-- .../default.data.generator.service.spec.ts | 38 +++++++++++++++++++++- .../default.data.generator.service.ts | 6 ++-- 3 files changed, 47 insertions(+), 6 deletions(-) (limited to 'vid-webpack-master/src/app/shared') 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, -- cgit 1.2.3-korg