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);
public enum XnfTypeEnum {
VNF ("VNF"),
- PNF ("PNF");
+ PNF ("PNF"),
+ CNF ("CNF");
private String value;
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);
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;
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() {
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 {
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);
public static String getVnfRepositoryPath() {
return getFilePath("VNFs");
}
+ public static String getCnfRepositoryPath() {
+ return getFilePath("CNFs");
+ }
public static String getUpdateVSPVnfRepositoryPath() {
return getFilePath("UpdateVSP");
<class name="org.onap.sdc.backend.ci.tests.sanity.Onboard"/>
</classes>
</test>
-</suite>
\ No newline at end of file
+</suite>
<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>