diff options
2 files changed, 82 insertions, 0 deletions
diff --git a/catalog-be/src/main/resources/import/tosca/models/init/etsi-SOL001-v2.5.1/tosca/interface-lifecycle-types/interfaceLifecycleTypes.yml b/catalog-be/src/main/resources/import/tosca/models/init/etsi-SOL001-v2.5.1/tosca/interface-lifecycle-types/interfaceLifecycleTypes.yml index f746f8834d..ae298bfdcc 100644 --- a/catalog-be/src/main/resources/import/tosca/models/init/etsi-SOL001-v2.5.1/tosca/interface-lifecycle-types/interfaceLifecycleTypes.yml +++ b/catalog-be/src/main/resources/import/tosca/models/init/etsi-SOL001-v2.5.1/tosca/interface-lifecycle-types/interfaceLifecycleTypes.yml @@ -1,6 +1,19 @@ tosca.interfaces.Root: description: The TOSCA root Interface Type all other TOSCA Interface Types derive from +tosca.interfaces.node.lifecycle.Standard: + derived_from: tosca.interfaces.Root + create: + description: Standard lifecycle create operation. + configure: + description: Standard lifecycle configure operation. + start: + description: Standard lifecycle start operation. + stop: + description: Standard lifecycle stop operation. + delete: + description: Standard lifecycle delete operation. + tosca.interfaces.nfv.Vnflcm: derived_from: tosca.interfaces.Root description: This interface encompasses a set of TOSCA operations corresponding to the VNF LCM operations defined in ETSI GS NFV-IFA 007 as well as to preamble and postamble procedures to the execution of the VNF LCM operations. diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java index 72810c5806..4f8a1b80ee 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/ImportVfcUiTest.java @@ -143,6 +143,62 @@ public class ImportVfcUiTest extends SetupCDTest { } + @Test + public void importVFC_createVF_etsi_addVFC2VF_test() throws UnzipException { + ComponentPage componentPage; + // TC - Import VFC with root namespace + String fileName = "org.openecomp.resource.VFC-root.yml"; + String subCategory = ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory(); + CreateVfcFlow createVfcFlow = createVFC(fileName, ModelName.ETSI_SOL001_v2_5_1.getName(), subCategory); + + componentPage = createVfcFlow.getLandedPage().orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage")); + componentPage.isLoaded(); + componentPage.certifyComponent(); + componentPage.isLoaded(); + + Map<String, Object> yamlObject = downloadToscaArtifact(componentPage); + checkEtsiMetadata(yamlObject, vfcCreateData); + checkNodeTypes(yamlObject); + homePage.getTopNavComponent().clickOnHome(); + + // TC - Import hierarchy of VFCs + fileName = "org.openecomp.resource.VFC-child.yml"; + createVfcFlow = createVFC(fileName, ModelName.ETSI_SOL001_v2_5_1.getName(), subCategory); + componentPage = createVfcFlow.getLandedPage().orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage")); + componentPage.isLoaded(); + + componentPage = manageAttributes(componentPage); + componentPage.isLoaded(); + componentPage.certifyComponent(); + componentPage.isLoaded(); + + yamlObject = downloadToscaArtifact(componentPage); + checkEtsiMetadata(yamlObject, vfcCreateData); + checkNodeTypes(yamlObject); + + componentPage = viewInterfaceDefinitionFromVFC(componentPage); + componentPage.isLoaded(); + + homePage.getTopNavComponent().clickOnHome(); + + // TC - Import VFC with interface inputs + // TC - Import VFC with attributes + final CreateVfFlow createVfFlow = createVF(); + componentPage = createVfFlow.getLandedPage().orElseThrow(() -> new UiTestFlowRuntimeException("Missing expected return ResourceCreatePage")); + componentPage.isLoaded(); + + final CompositionPage compositionPage = addInterfaceOperations(componentPage); + componentPage = compositionPage.goToGeneral(); + componentPage.isLoaded(); + componentPage.certifyComponent(); + componentPage.isLoaded(); + + yamlObject = downloadToscaArtifact(componentPage); + checkMetadata(yamlObject, vfCreateData); + checkTopologyTemplate(yamlObject); + + } + private ComponentPage viewInterfaceDefinitionFromVFC(final ComponentPage componentPage) { final GoToInterfaceDefinitionPageFlow goToInterfaceDefinitionPageFlow = new GoToInterfaceDefinitionPageFlow(webDriver); goToInterfaceDefinitionPageFlow.run(componentPage); @@ -368,6 +424,19 @@ public class ImportVfcUiTest extends SetupCDTest { assertEquals(createdData.getVendorModelNumber(), metadata.get("reourceVendorModelNumber")); } + private void checkEtsiMetadata(final Map<String, Object> map, final ResourceCreateData createdData) { + final Map<String, Object> metadata = getMapEntry(map, "metadata"); + + assertEquals(createdData.getName(), metadata.get("name")); + assertEquals(createdData.getDescription(), metadata.get("description")); + assertEquals("Application L4+", metadata.get("category")); + assertThat((String) metadata.get("type"), not(emptyString())); + assertEquals(createdData.getCategory(), metadata.get("subcategory")); + assertEquals(createdData.getVendorName(), metadata.get("resourceVendor")); + assertEquals(createdData.getVendorRelease(), metadata.get("resourceVendorRelease")); + assertEquals(createdData.getVendorModelNumber(), metadata.get("reourceVendorModelNumber")); + } + private void checkNodeTypes(final Map<String, Object> map) { final Map<String, Object> mapEntry = getMapEntry(map, "node_types"); final Map<String, Object> nodeTypes = getMapEntry(mapEntry, mapEntry.keySet().iterator().next()); |