diff options
author | Remigiusz Janeczek <remigiusz.janeczek@nokia.com> | 2021-02-24 09:15:48 +0100 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-02-25 13:30:20 +0000 |
commit | e01f4a5f5e4258e5b02593bda5cb0c5ec87b1899 (patch) | |
tree | 6cd6ffc6df7f126178ceb0f5e64ec90e21b267cf | |
parent | 5c50d66c0ddcc3de44ed897151ea8431550af07b (diff) |
Add UI/Rest sanity checks for helm package onboarding
Issue-ID: SDC-3185
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: I17f19987c76647b448a409fda6b4a85e058d9612
10 files changed, 54 insertions, 3 deletions
diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/data/providers/OnboardingDataProviders.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/data/providers/OnboardingDataProviders.java index 5b6ecbfbee..a743521bea 100644 --- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/data/providers/OnboardingDataProviders.java +++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/data/providers/OnboardingDataProviders.java @@ -69,6 +69,13 @@ public final class OnboardingDataProviders { FileHandling.getXnfRepositoryPath(XnfTypeEnum.PNF)); } + @DataProvider(name = "CNF_List", parallel = true) + private static Object[][] cnfList() { + final List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.CNF); + LOGGER.debug(String.format("There are %s package file(s) to test", fileNamesFromFolder.size())); + return provideData(fileNamesFromFolder, FileHandling.getXnfRepositoryPath(XnfTypeEnum.CNF)); + } + @DataProvider(name = "Single_VNF", parallel = true) private static Object[][] singleVNF() { final List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF); diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/XnfTypeEnum.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/XnfTypeEnum.java index 88f6b6ca64..0ee3e65944 100644 --- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/XnfTypeEnum.java +++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/datatypes/enums/XnfTypeEnum.java @@ -23,7 +23,8 @@ package org.onap.sdc.backend.ci.tests.datatypes.enums; public enum XnfTypeEnum { VNF ("VNF"), - PNF ("PNF"); + PNF ("PNF"), + CNF ("CNF"); private String value; diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/sanity/Onboard.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/sanity/Onboard.java index da2d9f70ce..a16fa3e487 100644 --- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/sanity/Onboard.java +++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/sanity/Onboard.java @@ -78,6 +78,12 @@ public class Onboard extends ComponentBaseTest { runOnboardToDistributionFlow(filePath, pnfFile, ResourceTypeEnum.PNF); } + @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "CNF_List") + public void onboardCNFFlow(String filePath, String cnfFile) throws Exception { + setLog(cnfFile); + runOnboardToDistributionFlow(filePath, cnfFile, ResourceTypeEnum.VF); + } + private void runOnboardToDistributionFlow(String packageFilePath, String packageFileName, ResourceTypeEnum resourceTypeEnum) throws Exception { ExtentTestActions.log(Status.INFO, String.format("Going to onboard the %s %s", resourceTypeEnum.getValue(), packageFileName)); User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/FileHandling.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/FileHandling.java index 19533e90f1..d4191d7738 100644 --- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/FileHandling.java +++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/FileHandling.java @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.EnumMap; import java.util.Enumeration; import java.util.HashMap; import java.util.List; @@ -130,12 +131,27 @@ public class FileHandling { return getCiFilesPath() + File.separator + "conf" + File.separator; } + + private static EnumMap<XnfTypeEnum, String> XNF_REPOSITORY_PATHS_MAP = new EnumMap<>(Map.of( + XnfTypeEnum.PNF, getPnfRepositoryPath(), + XnfTypeEnum.CNF, getCnfRepositoryPath(), + XnfTypeEnum.VNF, getVnfRepositoryPath() + )); + public static String getVnfRepositoryPath() { return getFilePath("VNFs"); } + private static String getPnfRepositoryPath() { + return getFilePath("PNFs"); + } + + private static String getCnfRepositoryPath() { + return getFilePath("CNFs"); + } + public static String getXnfRepositoryPath(XnfTypeEnum xnfTypeEnum) { - return xnfTypeEnum.getValue().equals(XnfTypeEnum.PNF.name()) ? getFilePath("PNFs") : getFilePath("VNFs"); + return XNF_REPOSITORY_PATHS_MAP.get(xnfTypeEnum); } public static String getPortMirroringRepositoryPath() { diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/dataProvider/OnbordingDataProviders.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/dataProvider/OnbordingDataProviders.java index 0dee90f5cf..d8dc5f94c3 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/dataProvider/OnbordingDataProviders.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/dataProvider/OnbordingDataProviders.java @@ -56,6 +56,15 @@ public class OnbordingDataProviders { return provideData(fileNamesFromFolder, filepath); } + @DataProvider(name = "CNF_List", parallel = true) + private static Object[][] cnfList() { + + List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.CNF); + + System.out.println(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size())); + return provideData(fileNamesFromFolder, FileHandling.getCnfRepositoryPath()); + } + @DataProvider(name = "updateList") private static Object[][] updateList() throws Exception { diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java index 24451d6d8d..9327d6ce0c 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/sanity/OnboardingFlowsUi.java @@ -465,6 +465,14 @@ public class OnboardingFlowsUi extends SetupCDTest { runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, vnfFile); } + @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "CNF_List") + public void onboardCNFTest(String filePath, String cnfFile) throws Exception { + setLog(cnfFile); + ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); + ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService(); + runOnboardToDistributionFlow(resourceReqDetails, serviceReqDetails, filePath, cnfFile); + } + @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List") public void onboardVNFShotFlow(String filePath, String vnfFile) throws Exception { setLog(vnfFile); diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java index b7f199d1b8..7ae346cfe9 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/utilities/FileHandling.java @@ -145,6 +145,9 @@ public class FileHandling { public static String getVnfRepositoryPath() { return getFilePath("VNFs"); } + public static String getCnfRepositoryPath() { + return getFilePath("CNFs"); + } public static String getUpdateVSPVnfRepositoryPath() { return getFilePath("UpdateVSP"); diff --git a/integration-tests/src/test/resources/Files/CNFs/helm-package-valid.zip b/integration-tests/src/test/resources/Files/CNFs/helm-package-valid.zip Binary files differnew file mode 100644 index 0000000000..349a9ee0b2 --- /dev/null +++ b/integration-tests/src/test/resources/Files/CNFs/helm-package-valid.zip diff --git a/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml b/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml index fbd796edb1..97537986cb 100644 --- a/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml +++ b/integration-tests/src/test/resources/ci/testSuites/backend/onapApiSanity.xml @@ -8,4 +8,4 @@ <class name="org.onap.sdc.backend.ci.tests.sanity.Onboard"/> </classes> </test> -</suite>
\ No newline at end of file +</suite> diff --git a/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml b/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml index 48e28fc316..c53dd4a73b 100644 --- a/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml +++ b/integration-tests/src/test/resources/ci/testSuites/frontend/onapUiSanity.xml @@ -19,6 +19,7 @@ <class name="org.onap.sdc.frontend.ci.tests.execute.sanity.OnboardingFlowsUi"> <methods> <include name="onapOnboardVNFflow"/> + <include name="onboardCNFTest"/> <include name="onapOnboardVSPValidationsSanityFlow"/> <include name="onboardPNFSoftwareInformationFlow"/> </methods> |