docker pull ${PREFIX}/sdc-api-tests:${RELEASE}
fi
- docker run --detach --name sdc-api-tests --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${API_TESTS_JAVA_OPTIONS}" --env SUITE_NAME=${API_SUITE} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 ${LOCAL_TIME_MOUNT_CMD} --volume ${WORKSPACE}/data/logs/sdc-api-tests/target:/var/lib/tests/target --volume ${WORKSPACE}/data/logs/sdc-api-tests/ExtentReport:/var/lib/tests/ExtentReport --volume ${WORKSPACE}/data/logs/sdc-api-tests/outputCsar:/var/lib/tests/outputCsar --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 9560:9560 ${PREFIX}/sdc-api-tests:${RELEASE} echo "please wait while SDC-API-TESTS is starting....."
+ docker run --detach --name sdc-api-tests --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${API_TESTS_JAVA_OPTIONS}" --env SUITE_NAME=${API_SUITE} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 ${LOCAL_TIME_MOUNT_CMD} --volume ${WORKSPACE}/data/logs/sdc-api-tests/target:/var/lib/tests/target --volume ${WORKSPACE}/data/logs/sdc-api-tests/ExtentReport:/var/lib/tests/ExtentReport --volume ${WORKSPACE}/data/logs/sdc-api-tests/outputCsar:/var/lib/tests/outputCsar --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --volume ${WORKSPACE}/data/${SDC_CERT_DIR}:/var/lib/tests/cert --publish 9560:9560 ${PREFIX}/sdc-api-tests:${RELEASE} echo "please wait while SDC-API-TESTS is starting....."
monitor_docker sdc-api-tests
fi
fi
--- /dev/null
+-----BEGIN CERTIFICATE-----
+MIIDYDCCAkigAwIBAgIJAKqOa8IS4G5sMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
+BAYTAkFVMRM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Bb7F40LsgqqTjMLQMnGjEEuyTxO356Bv8DwI497N+I2Hxm98UY5YzUM
+bR057A==
+-----END CERTIFICATE-----
:DC_NAME => node['cassandra']['datacenter_name']+node.chef_environment
})
end
+
+bash "Make root cert file available" do
+cwd "#{tests_base}"
+code <<-EOH
+ cp /root/chef-solo/cookbooks/sdc-api-tests/files/default/cert/root.cert /var/lib/tests/cert/root.cert
+ echo "root.cert file made available for tests."
+EOH
+end
+
public void setupBeforeTest(java.lang.reflect.Method method, ITestContext context) throws Exception {
System.out.println(" method.getName() " + method.getName());
- if (!method.getName().equals("onboardVNFShotFlow")) {
+ if (!"onboardVNFShotFlow".equals(method.getName()) &&
+ !"onboardPNFFlow".equals(method.getName()) ) {
logger.info("ExtentReport instance started from BeforeMethod...");
ExtentTestManager.startTest(method.getName());
ExtentTestManager.assignCategory(this.getClass());
package org.openecomp.sdc.ci.tests.dataProviders;
+import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
import org.testng.annotations.DataProvider;
@DataProvider(name = "VNF_List" , parallel = true)
private static final Object[][] VnfList() throws Exception {
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
System.out.println(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size()));
return provideData(fileNamesFromFolder, filepath);
package org.openecomp.sdc.ci.tests.dataProviders;
+import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
import org.testng.annotations.DataProvider;
public class OnbordingDataProviders {
- protected static String filepath = FileHandling.getVnfRepositoryPath();
+ protected static String vnfFilepath = FileHandling.getXnfRepositoryPath(XnfTypeEnum.VNF);
// -----------------------dataProviders-----------------------------------------
@DataProvider(name = "randomVNF_List", parallel = false)
List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure();
List<String> newRandomFileNamesFromFolder = getRandomElements(randomElementNumber, fileNamesFromFolder);
if(newRandomFileNamesFromFolder == null){
- assertFalse(true,"Requered number of VNF files not exists under " + filepath);
+ assertFalse(true,"Requered number of VNF files not exists under " + vnfFilepath);
}
System.out.println(String.format("There are %s zip file(s) to test", newRandomFileNamesFromFolder.size()));
- return provideData(newRandomFileNamesFromFolder, filepath);
+ return provideData(newRandomFileNamesFromFolder, vnfFilepath);
}
@DataProvider(name = "VNF_List" , parallel = true)
private static final Object[][] VnfList() throws Exception {
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
- System.out.println(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size()));
- return provideData(fileNamesFromFolder, filepath);
+ List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
+ System.out.println(String.format("There are %s package file(s) to test", fileNamesFromFolder.size()));
+ return provideData(fileNamesFromFolder, vnfFilepath);
+ }
+
+ @DataProvider(name = "PNF_List" , parallel = true)
+ private static final Object[][] nfList() throws Exception {
+ List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.PNF);
+ System.out.println(String.format("There are %s package file(s) to test", fileNamesFromFolder.size()));
+ return provideData(fileNamesFromFolder, FileHandling.getXnfRepositoryPath(XnfTypeEnum.PNF));
}
@DataProvider(name = "Single_VNF" , parallel = true)
private static final Object[][] SingleVNF() throws Exception {
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
List<String> newList = new ArrayList<>();
newList.add(fileNamesFromFolder.get(0));
System.out.println(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size()));
- return provideData(newList, filepath);
+ return provideData(newList, vnfFilepath);
}
// -----------------------factories-----------------------------------------
--- /dev/null
+package org.openecomp.sdc.ci.tests.datatypes.enums;
+
+public enum XnfTypeEnum {
+
+ VNF ("VNF"),
+ PNF ("PNF");
+
+ private String value;
+
+ private XnfTypeEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
@Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List")
public void onboardVNFShotFlow(String filePath, String vnfFile) throws Exception, Throwable {
setLog(vnfFile);
- System.out.println("print - >" + makeDistributionValue);
runOnboardToDistributionFlow(filePath, vnfFile);
}
+
+ @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "PNF_List")
+ public void onboardPNFFlow(String filePath, String pnfFile) throws Exception, Throwable {
+ setLog(pnfFile);
+ runOnboardToDistributionFlow(filePath, pnfFile);
+ }
@Test
public void passTest() {
User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUtillViaApis.createVspViaApis(resourceReqDetails, filePath, vnfFile, user);
-// vendorSoftwareProductObject.setName(vendorSoftwareProductObject.getName());
// create VF base on VNF imported from previous step - have, resourceReqDetails object include part of resource metadata
-// ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
ExtentTestActions.log(Status.INFO, String.format("Create VF %s From VSP", resourceReqDetails.getName()));
Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails, UserRoleEnum.DESIGNER);
if (makeToscaValidationValue.equals("true")) {
- ExtentTestActions.log(Status.INFO, String.format("Start tosca validation"));
+ ExtentTestActions.log(Status.INFO, "Start tosca validation");
AtomicOperationUtils.toscaValidation(service ,vnfFile);
-
-
}
-
-
-
ExtentTestActions.log(Status.INFO, String.format("The onboarding %s test is passed ! ", vnfFile));
}
-
-
}
import org.openecomp.sdc.be.model.DataTypeDefinition;
import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
import org.openecomp.sdc.common.util.GeneralUtility;
import org.yaml.snakeyaml.Yaml;
return getFilePath("VNFs");
}
+ public static String getXnfRepositoryPath(XnfTypeEnum xnfTypeEnum) {
+ return xnfTypeEnum.getValue().equals(XnfTypeEnum.PNF.name()) ? getFilePath("PNFs") : getFilePath("VNFs");
+ }
+
public static String getPortMirroringRepositoryPath() {
return getFilePath("PortMirroring");
}
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.ci.tests.api.Urls;
import org.openecomp.sdc.ci.tests.config.Config;
+import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
public class OnboardingUtils {
/**
- * excluded VNF file list
+ * excluded VNF or PNF file list
*/
- public static List<String> exludeVnfList =
+ public static List<String> excludeXnfList =
// new ArrayList<>();
Arrays.asList(
// DUPLICATE_RESOURCE_ID_IN_DIFFERENT_FILES:
);
/**
- * additional files to exludeVnfList files for tosca parser tests
+ * additional files to excludeXnfList files for tosca parser tests
*/
- protected static List<String> exludeVnfListForToscaParser = //new ArrayList<String>();
+ protected static List<String> excludeXnfListForToscaParser = //new ArrayList<String>();
Arrays.asList(
"1-Vvig-062017-(MOBILITY)_v5.1.zip",
"1-Mvm-sbc-1710-092017-(MOBILITY)_v7.0.zip",
return headersMap;
}
-
/**
* @return
- * The method returns VNF names list from Files directory under sdc-vnfs repository
+ * The method returns XNF names list from Files directory under sdc repository
*/
- public static List<String> getVnfNamesFileList() {
- String filepath = FileHandling.getVnfRepositoryPath();
+ public static List<String> getXnfNamesFileList(XnfTypeEnum xnfTypeEnum) {
+ String filepath = FileHandling.getXnfRepositoryPath(xnfTypeEnum);
List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filepath);
- //Please remove the hardcoded configuration ONAP Tal G!!!!!!
- fileNamesFromFolder.removeAll(exludeVnfList);
- //List<String> halfResourceListByDay = divideListByDayOfMonth(fileNamesFromFolder);
- //System.out.println(halfResourceListByDay.toString());
+ fileNamesFromFolder.removeAll(excludeXnfList);
return fileNamesFromFolder;
}
* The method returns VNF names list from Files directory under sdc-vnfs repository excluding zip files that known as failed in tosca parser
*/
public static List<String> getVnfNamesFileListExcludeToscaParserFailure() {
- List<String> fileNamesFromFolder = getVnfNamesFileList();
- fileNamesFromFolder.removeAll(exludeVnfListForToscaParser);
+ List<String> fileNamesFromFolder = getXnfNamesFileList(XnfTypeEnum.VNF);
+ fileNamesFromFolder.removeAll(excludeXnfListForToscaParser);
return fileNamesFromFolder;
}
String vnfSourceFile = (String) objectArr[i][0];
String vnfUpdateFile = (String) objectArr[i][1];
- if(!exludeVnfList.contains(vnfSourceFile) && !exludeVnfList.contains(vnfUpdateFile))
+ if(!excludeXnfList.contains(vnfSourceFile) && !excludeXnfList.contains(vnfUpdateFile))
{
filteredArObject[index] = new Object[]{vnfSourceFile , vnfUpdateFile };
index++;
package org.openecomp.sdc.ci.tests.dataProvider;
+import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils;
import org.testng.annotations.DataProvider;
@DataProvider(name = "VNF_List" , parallel = true)
private static final Object[][] VnfList() throws Exception {
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
System.out.println(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size()));
return provideData(fileNamesFromFolder, filepath);
import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
+import org.openecomp.sdc.ci.tests.datatypes.enums.XnfTypeEnum;
import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
@Test
public void onboardVNFTestSanity() throws Throwable {
- List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
+ List<String> fileNamesFromFolder = OnboardingUtils.getXnfNamesFileList(XnfTypeEnum.VNF);
String vnfFile = fileNamesFromFolder.get(0).toString();
ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
ServiceReqDetails serviceReqDetails = ElementFactory.getDefaultService();//getServiceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
filenames.add(file.getName());
}
- filenames.removeAll(OnboardingUtils.exludeVnfList);
+ filenames.removeAll(OnboardingUtils.excludeXnfList);
return filenames;
}