summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java16
-rw-r--r--catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py2
-rw-r--r--docs/configuration.rst95
-rw-r--r--pom.xml4
-rwxr-xr-xsdc-os-chef/scripts/docker_run.sh8
-rw-r--r--sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb2
-rw-r--r--sdc-os-chef/sdc-backend/startup.sh4
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/Huawei_vSPGW.csarbin0 -> 3664 bytes
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ZteEpcSpgwVf-csar.csarbin0 -> 2804 bytes
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/cscf_si_fixed.csarbin0 -> 50982 bytes
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ntas.csarbin0 -> 61134 bytes
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csarbin0 -> 4790 bytes
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/vCSCF_v3.0.csarbin0 -> 44851 bytes
-rw-r--r--sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/sanityTests_3_sanity_execution.rb2
-rw-r--r--sdc-os-chef/sdc-sanity/startup.sh2
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java6
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java40
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java137
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java9
-rw-r--r--test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java17
-rw-r--r--test-apis-ci/src/main/resources/ci/testSuites/onap.xml2
21 files changed, 293 insertions, 53 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
index 6e971f215d..b9956063d6 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java
@@ -243,8 +243,13 @@ public class AssetsDataServlet extends AbstractValidationsServlet {
ComponentTypeEnum componentType = ComponentTypeEnum.findByParamName(assetType);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, instanceIdHeader);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, requestURI);
- additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, uuid);
+ if (componentType == null) {
+ log.debug("getMetaData: assetType parameter {} is not valid", assetType);
+ responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT);
+ return buildErrorResponse(responseFormat);
+ }
+ additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
// Mandatory
if (instanceIdHeader == null || instanceIdHeader.isEmpty()) {
@@ -331,8 +336,15 @@ public class AssetsDataServlet extends AbstractValidationsServlet {
EnumMap<AuditingFieldsKeysEnum, Object> additionalParam = new EnumMap<AuditingFieldsKeysEnum, Object>(AuditingFieldsKeysEnum.class);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_CONSUMER_ID, instanceIdHeader);
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_DISTRIBUTION_RESOURCE_URL, url);
- additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
additionalParam.put(AuditingFieldsKeysEnum.AUDIT_SERVICE_INSTANCE_ID, uuid);
+
+ if (componentType == null) {
+ log.debug("getToscaModel: assetType parameter {} is not valid", assetType);
+ responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT);
+ return buildErrorResponse(responseFormat);
+ }
+ additionalParam.put(AuditingFieldsKeysEnum.AUDIT_RESOURCE_TYPE, componentType.getValue());
+
if (instanceIdHeader == null || instanceIdHeader.isEmpty()) {
log.debug("getToscaModel: Missing X-ECOMP-InstanceID header");
diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
index d47c0b8073..1f523858b6 100644
--- a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
+++ b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
@@ -84,7 +84,7 @@ def usage():
def importNormativeTypes(beHost, bePort, adminUser, fileDir, updateversion):
- normativeTypes = [ "root", "compute", "softwareComponent", "webServer", "webApplication", "DBMS", "database", "objectStorage", "blockStorage", "containerRuntime", "containerApplication", "loadBalancer", "port", "network"]
+ normativeTypes = [ "root", "compute", "softwareComponent", "webServer", "webApplication", "DBMS", "database", "objectStorage", "blockStorage", "containerRuntime", "containerApplication", "loadBalancer", "port", "network", "allottedResource"]
#normativeTypes = [ "root" ]
responseCodes = [200, 201]
diff --git a/docs/configuration.rst b/docs/configuration.rst
index 70352cda6e..281f07d1a0 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -18,14 +18,22 @@ environment.json
::
{
+ # Environment name
"name": "xxx",
+
+ # Environment description
"description": "OpenSource-xxx",
+
+ # Chef properties
"cookbook_versions": {
"Deploy-SDandC": "= 1.0.0"
},
"json_class": "Chef::Environment",
"chef_type": "environment",
+
"default_attributes": {
+
+ # IPs used for docker configuration
"CS_VIP": "yyy",
"BE_VIP": "yyy",
"FE_VIP": "yyy",
@@ -34,6 +42,8 @@ environment.json
"application": "eth0",
"private": "eth1"
},
+
+ # Configuration parameters used in portal properties
"ECompP": {
"ecomp_rest_url": "http://portal.api.simpledemo.onap.org:8989/ONAPPORTAL/auxapi",
"ueb_url_list": "10.0.11.1,10.0.11.1",
@@ -44,11 +54,15 @@ environment.json
"app_topic_name": "ECOMP-PORTAL-OUTBOX-SDC1",
"decryption_key": "AGLDdG4D04BKm2IxIWEr8o=="
},
+
+ # Configuration parameters used by SDC to work with Dmaap
"UEB": {
"PublicKey": "iPIxkpAMI8qTcQj8",
"SecretKey": "Ehq3WyT4bkif4zwgEbvshGal",
"fqdn": ["10.0.11.1", "10.0.11.1"]
},
+
+ # IPs used for docker configuration
"Nodes": {
"CS": "yyy",
"BE": "yyy",
@@ -57,6 +71,8 @@ environment.json
}
},
"override_attributes": {
+
+ # FE and BE listening ports
"FE": {
"http_port": "8181",
"https_port": "9443"
@@ -65,6 +81,8 @@ environment.json
"http_port": "8080",
"https_port": "8443"
},
+
+ # Elasticsearch configuration
"elasticsearch": {
"cluster_name": "SDC-ES-",
"ES_path_home": "/usr/share/elasticsearch",
@@ -72,6 +90,8 @@ environment.json
"num_of_replicas": "0",
"num_of_shards": "1"
},
+
+ # Cassandra configuration
"cassandra": {
"concurrent_reads": "32",
"num_tokens": "256",
@@ -179,7 +199,7 @@ BE-configuration.yaml
file: policies.yml
# Users
- **Is this neccessary**
+ # Deprecated. Will be removed in future releases
users:
tom: passwd
bob: passwd
@@ -220,8 +240,7 @@ BE-configuration.yaml
- { name: sdccomponent, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']}
- { name: sdcrepository, replicationStrategy: NetworkTopologyStrategy, replicationInfo: ['<%= @DC_NAME %>','<%= @rep_factor %>']}
- **Commented out. Is this neccessary**
- #Application-specific settings of ES
+ # Application-specific settings of ES
elasticSearch:
# Mapping of index prefix to time-based frame. For example, if below is configured:
@@ -275,7 +294,7 @@ BE-configuration.yaml
- Installation
- CPU
- #Deployment artifacts placeHolder
+ # Resource types placeholder
resourceTypes: &allResourceTypes
- VFC
- CP
@@ -285,12 +304,7 @@ BE-configuration.yaml
- Abstract
- CVFC
- **Commented out. is this neccessary**
- # validForResourceTypes usage
- # validForResourceTypes:
- # - VF
- # - VL
-
+ #Deployment resource artifacts placeHolder
deploymentResourceArtifacts:
# Deployment resource instance artifacts placeholders
@@ -442,14 +456,21 @@ BE-configuration.yaml
displayName: Testing
type: OTHER
- **Need to add data**
+ # The maximum number of keys permited for additional information on service
additionalInformationMaxNumberOfKeys: 50
- **Need to add data**
+ # Collect process statistics
systemMonitoring:
+
+ # Should monitoring be enabled
enabled: false
+
+ # In case of going through the FE server proxy the information to the BE
isProxy: false
+
+ # What is the interval of the statistics collection
probeIntervalInSeconds: 15
+
defaultHeatArtifactTimeoutMinutes: 60
# Service deployment artifacts placeHolder
@@ -728,27 +749,34 @@ BE-configuration.yaml
- VFC
- CVFC
+ # Resource informational deployment artifact placeholder
resourceInformationalDeployedArtifacts:
+ # Requirements needed to be fulfilled before certificattion
requirementsToFulfillBeforeCert:
+ # Capabillities needed to be fulfilled before certificattion
capabilitiesToConsumeBeforeCert:
- **Need to add data**
+ # Urls that should not be logged
unLoggedUrls:
- /sdc2/rest/healthCheck
- **Need to add data**
+ # When component is being set as deleted those are the clean configurations
cleanComponentsConfiguration:
+
+ # The interval to check for deleted components to clean
cleanIntervalInMinutes: 1440
+
+ # The components types to delete
componentsToClean:
- Resource
- Service
- **Need to add data**
+ # Deprecated. Will be removed in future releases
artifactsIndex: resources
- **Need to add data**
+ # Used to add header and footer to heatENV files generated by SDC
heatEnvArtifactHeader: ""
heatEnvArtifactFooter: ""
@@ -769,8 +797,9 @@ BE-configuration.yaml
# Url for onboarding health check
healthCheckUri: "/onboarding-api/v1.0/healthcheck"
- **Need to add data**
+
#GSS IDNS
+ # Switchover configuration is used for geo redundency to provide automatic failovers
switchoverDetector:
gBeFqdn:
gFeFqdn:
@@ -788,14 +817,14 @@ BE-configuration.yaml
beSet: { changePriorityUrl: "", changePriorityBody: '{"name":"","uri":"","no_ad_redirection":false,"v4groups":{"failover_groups":["","","failover_policy":["FAILALL"]},"comment":"","intended_app_proto":"DNS"}'}
feSet: { changePriorityUrl: "", changePriorityBody: '{"name":"","uri":"","no_ad_redirection":false,"v4groups":{"failover_groups":["",""],"failover_policy":["FAILALL"]},"comment":"","intended_app_proto":"DNS"}'}
- **Need to add data**
+ # Cache for datatypes. Improving run times for data type search
applicationL1Cache:
datatypes:
enabled: true
firstRunDelay: 10
pollIntervalInSec: 60
- **Need to add data**
+ # Deprecated. Will be removed in future releases
applicationL2Cache:
enabled: false
catalogL1Cache:
@@ -808,14 +837,14 @@ BE-configuration.yaml
waitOnShutDownInMinutes: 10
numberOfCacheWorkers: 4
- **Need to add data**
+ # Validators for tosca properties
toscaValidators:
stringMaxLength: 2500
# Should audit be disabled
disableAudit: false
- **Need to add data**
+ # VF module validations properties
vfModuleProperties:
min_vf_module_instances:
forBaseModule: 1
@@ -868,12 +897,12 @@ BE-distribution-engine-configuration.yaml
# Distribution initializtion maximum interval time
initMaxIntervalSec: 60
- **Need to add data**
+ # Deprecated. Will be removed in future releases
distribNotifServiceArtifactTypes:
info:
- MURANO-PKG
- **Need to add data**
+ # Deprecated. Will be removed in future releases
distribNotifResourceArtifactTypes:
lifecycle:
- HEAT
@@ -908,7 +937,7 @@ BE-distribution-engine-configuration.yaml
# Maximum waiting time after sending a notification
maxWaitingAfterSendingSeconds: 5
- **Need to add data**
+ # Deprecated. Will be removed in future releases
createTopic:
partitionCount: 1
replicationCount: 1
@@ -979,9 +1008,13 @@ BE-titan.properties
# Does titan should use cache
cache.db-cache = false
- **Need to add data**
+ # How long in milliseconds should the cache keep entries before flushing them
cache.db-cache-clean-wait = 20
+
+ # Default experation time in milliseconds for entries in the cache
cache.db-cache-time = 180000
+
+ # Size of titan database cache
cache.db-cache-size = 0.5
# Titan cassandra read consistency level
@@ -999,8 +1032,10 @@ BE-titan.properties
# Titan cassandra local data center name
storage.cassandra.astyanax.local-datacenter=<%= @DC_NAME %>
- **Need to add data**
+ # Number of times the system attempts to acquire a lock before giving up and throwing an exception
storage.lock.retries=5
+
+ # Number of milliseconds the system waits for a lock application to be acknowledged by the storage backend
storage.lock.wait-time=500
@@ -1102,10 +1137,16 @@ FE-configuration.yaml
- http
- https
- **Need to add data**
+ # Collect process statistics
systemMonitoring:
+
+ # Should monitoring be enabled
enabled: false
+
+ # In case of going through the FE server proxy the information to the BE
isProxy: true
+
+ # What is the interval of the statistics collection
probeIntervalInSeconds: 15
# Kibana hostname
diff --git a/pom.xml b/pom.xml
index 6a7d39d8f2..b633606dc8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
<extentreports.version>3.0.3</extentreports.version>
<!-- parser-->
- <sdc-tosca-parser.version>1.1.34</sdc-tosca-parser.version>
+ <sdc-tosca-parser.version>1.1.32</sdc-tosca-parser.version>
<!--JaCoCO -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
@@ -408,7 +408,7 @@
<artifact-generator-api.version>1710.0.0</artifact-generator-api.version>
<artifact-generator-core.version>1710.0.0</artifact-generator-core.version>
<dox-common-lib.version>1710.0.0</dox-common-lib.version>
- <sdc-tosca-parser.version>1.1.14</sdc-tosca-parser.version>
+ <sdc-tosca-parser.version>1.1.32</sdc-tosca-parser.version>
</properties>
</profile>
diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh
index 3b68bb9afb..963b2fcf14 100755
--- a/sdc-os-chef/scripts/docker_run.sh
+++ b/sdc-os-chef/scripts/docker_run.sh
@@ -17,16 +17,16 @@ function cleanup {
function dir_perms {
- mkdir -p /data/logs/BE/ASDC/ASDC-BE
- mkdir -p /data/logs/FE/ASDC/ASDC-FE
+ mkdir -p /data/logs/BE/SDC/SDC-BE
+ mkdir -p /data/logs/FE/SDC/SDC-FE
chmod -R 777 /data/logs
}
function monitor_docker {
echo monitor $1 Docker
-
-TIME_OUT=180
+sleep 5
+TIME_OUT=600
INTERVAL=20
TIME=0
while [ "$TIME" -lt "$TIME_OUT" ]; do
diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb
index 58a3ef70af..ba72dab34b 100644
--- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb
+++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb
@@ -11,7 +11,7 @@ bash "import-normatives" do
cd normatives/scripts/import/tosca/
/bin/chmod +x importNormativeAll.py
# add --debug=true to the importNormativeAll.py arguments to enable debug
- python importNormativeAll.py --debug=true -i localhost > /var/lib/jetty/logs/importNormativeAll.log
+ python importNormativeAll.py -i localhost > /var/lib/jetty/logs/importNormativeAll.log
EOH
end
diff --git a/sdc-os-chef/sdc-backend/startup.sh b/sdc-os-chef/sdc-backend/startup.sh
index 87f4ae674d..8e5926cdc4 100644
--- a/sdc-os-chef/sdc-backend/startup.sh
+++ b/sdc-os-chef/sdc-backend/startup.sh
@@ -37,7 +37,9 @@ else
chef-solo -c normatives.rb
fi
+echo "###### DOCKER STARTED #####"
+
while true; do sleep 2; done
-echo "###### DOCKER STARTED #####"
+
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/Huawei_vSPGW.csar b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/Huawei_vSPGW.csar
new file mode 100644
index 0000000000..8beae6e74a
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/Huawei_vSPGW.csar
Binary files differ
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ZteEpcSpgwVf-csar.csar b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ZteEpcSpgwVf-csar.csar
new file mode 100644
index 0000000000..0eacd74655
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ZteEpcSpgwVf-csar.csar
Binary files differ
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/cscf_si_fixed.csar b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/cscf_si_fixed.csar
new file mode 100644
index 0000000000..bc8397a86e
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/cscf_si_fixed.csar
Binary files differ
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ntas.csar b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ntas.csar
new file mode 100644
index 0000000000..6b6f7c4d8c
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/ntas.csar
Binary files differ
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csar b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csar
new file mode 100644
index 0000000000..bf0e775102
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/resource-ZteEpcMmeVf-csar_fix.csar
Binary files differ
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/vCSCF_v3.0.csar b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/vCSCF_v3.0.csar
new file mode 100644
index 0000000000..1c52cca12d
--- /dev/null
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/Files/VNFs/vCSCF_v3.0.csar
Binary files differ
diff --git a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/sanityTests_3_sanity_execution.rb b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/sanityTests_3_sanity_execution.rb
index 690559a74d..c4323c233f 100644
--- a/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/sanityTests_3_sanity_execution.rb
+++ b/sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/recipes/sanityTests_3_sanity_execution.rb
@@ -6,7 +6,7 @@ cwd "#{tests_base}"
code <<-EOH
cd "#{tests_base}"
jar_file=`ls test-apis*-jar-with-dependencies.jar`
- nohup ./startTest.sh $jar_file #{ci_test_suite} &
+ ./startTest.sh $jar_file #{ci_test_suite} > #{tests_base}/target/startTest.out 2>&1
echo "return code from startTest.sh = [$?]"
EOH
timeout 72000
diff --git a/sdc-os-chef/sdc-sanity/startup.sh b/sdc-os-chef/sdc-sanity/startup.sh
index d4316c383f..e4edfc67e6 100644
--- a/sdc-os-chef/sdc-sanity/startup.sh
+++ b/sdc-os-chef/sdc-sanity/startup.sh
@@ -14,7 +14,7 @@ rc=$?
# exit 0
#fi
-while true; do sleep 2; done
+#while true; do sleep 2; done
##/docker-entrypoint.sh
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
index 6b0dc56357..01fad09d0d 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java
@@ -28,6 +28,7 @@ import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.core.TitanGraph;
import com.thinkaurelius.titan.core.TitanVertex;
import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.ImmutableTriple;
import org.apache.log4j.Logger;
@@ -48,6 +49,7 @@ import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
+import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
import org.openecomp.sdc.ci.tests.utils.rest.*;
import org.slf4j.LoggerFactory;
import org.testng.ITestContext;
@@ -186,6 +188,10 @@ public abstract class ComponentBaseTest {
performClean();
shutdownTitanLogic();
+ String basePath = FileHandling.getBasePath();
+ String csarDir = FileHandling.getCreateDirByName("outputCsar");
+ FileUtils.cleanDirectory(new File(csarDir));
+
}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java
index 44e386ada6..4db35a2ce5 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java
@@ -24,8 +24,10 @@ package org.openecomp.sdc.ci.tests.sanity;
+import org.apache.http.HttpResponse;
import org.junit.Rule;
import org.junit.rules.TestName;
+import org.openecomp.sdc.be.datatypes.enums.AssetTypeEnum;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.Service;
@@ -39,9 +41,14 @@ import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
+import org.openecomp.sdc.ci.tests.utils.CsarToscaTester;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
+import org.openecomp.sdc.ci.tests.utils.rest.AssetRestUtils;
+import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
@@ -52,9 +59,10 @@ import com.clearspring.analytics.util.Pair;
import fj.data.Either;
-
-
-
+import java.io.File;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
public class Onboard extends ComponentBaseTest {
@@ -68,6 +76,8 @@ public class Onboard extends ComponentBaseTest {
}
protected String makeDistributionValue;
+ protected ISdcCsarHelper fdntCsarHelper;
+ protected SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
@@ -115,12 +125,30 @@ public class Onboard extends ComponentBaseTest {
ExtentTestActions.log(Status.INFO, String.format("Certify Service"));
service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
+
// ExtentTestActions.log(Status.INFO, String.format("Distribute Service"));
// AtomicOperationUtils.distributeService(service, true);
-
- ExtentTestActions.log(Status.INFO, String.format("The onboarding %s test is passed ! ", vnfFile));
- }
+ try{
+// HttpResponse assetResponse = AssetRestUtils.getComponentToscaModel(AssetTypeEnum.SERVICES, service.getUUID());
+// InputStream inputStream = assetResponse.getEntity().getContent();
+ File csarFile = AssetRestUtils.getToscaModelCsarFile(AssetTypeEnum.SERVICES, service.getUUID());
+
+ ExtentTestActions.log(Status.INFO, "Tosca parser is going to convert service csar file to ISdcCsarHelper object...");
+ fdntCsarHelper = factory.getSdcCsarHelper(csarFile.getAbsolutePath());
+ CsarToscaTester.processCsar(fdntCsarHelper);
+ ExtentTestActions.log(Status.INFO, String.format("Tosca parser successfully parsed service CSAR"));
+ ExtentTestActions.log(Status.INFO, String.format("The onboarding %s test is passed ! ", vnfFile));
+
+ }catch(Exception e){
+ ExtentTestActions.log(Status.ERROR, "Tosca parser FAILED to convert service csar file to ISdcCsarHelper object...");
+ ExtentTestActions.log(Status.FAIL, e);
+
+ }
+
+
+
+ }
}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java
new file mode 100644
index 0000000000..afdfa43d94
--- /dev/null
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/CsarToscaTester.java
@@ -0,0 +1,137 @@
+package org.openecomp.sdc.ci.tests.utils;
+
+import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
+import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
+import org.openecomp.sdc.toscaparser.api.Group;
+import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.elements.Metadata;
+import org.openecomp.sdc.toscaparser.api.parameters.Input;
+import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+public class CsarToscaTester {
+ public static void main(String[] args) throws Exception {
+ System.out.println("CsarToscaParser - path to CSAR's Directory is " + Arrays.toString(args));
+ SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
+
+ File folder = new File(args[0]);
+ File[] listOfFiles = folder.listFiles();
+ Date now = new Date();
+ SimpleDateFormat dateFormat = new SimpleDateFormat("d-MM-y-HH_mm_ss");
+ String time = dateFormat.format(now);
+ String csarsDir = args[1] + "/csar-reports-" + time;
+ File dir = new File(csarsDir);
+ dir.mkdir();
+
+
+ for (File file : listOfFiles) {
+ if (file.isFile()) {
+ System.out.println("File " + file.getAbsolutePath());
+ String name = file.getName();
+ String currentCsarDir = csarsDir+"/"+name+"-"+time;
+ dir = new File(currentCsarDir);
+ dir.mkdir();
+ try {
+ processCsar(factory, file);
+ } catch (SdcToscaParserException e){
+ System.out.println("SdcToscaParserException caught. Code: "+e.getCode()+", message: "+ e.getMessage());
+ }
+ List<String> notAnalyzedReport = ThreadLocalsHolder.getCollector().getNotAnalyzedExceptionsReport();
+ System.out.println("NOT ANALYZED during CSAR parsing are: " + (notAnalyzedReport != null ? notAnalyzedReport.toString() : "none"));
+ List<String> warningsReport = ThreadLocalsHolder.getCollector().getWarningsReport();
+ //System.out.println("WARNINGS during CSAR parsing are: " + (warningsReport != null ? warningsReport.toString() : "none"));
+ List<String> criticalsReport = ThreadLocalsHolder.getCollector().getCriticalsReport();
+ System.out.println("CRITICALS during CSAR parsing are: " + (criticalsReport != null ? criticalsReport.toString() : "none"));
+
+ try {
+ generateReport(time, name, currentCsarDir, criticalsReport, "critical");
+ generateReport(time, name, currentCsarDir, warningsReport, "warning");
+ generateReport(time, name, currentCsarDir, notAnalyzedReport, "notAnalyzed");
+
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ }
+ }
+
+ public static void processCsar(SdcToscaParserFactory factory, File file) throws SdcToscaParserException {
+ ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(file.getAbsolutePath());
+ processCsarImpl(sdcCsarHelper);
+
+ }
+
+ public static void processCsar(ISdcCsarHelper sdcCsarHelper) throws SdcToscaParserException {
+ processCsarImpl(sdcCsarHelper);
+
+ }
+
+ private static void processCsarImpl(ISdcCsarHelper sdcCsarHelper) {
+
+ //Service level
+ System.out.println("Invoking sdc-tosca methods on this CSAR....");
+ String conformanceLevel = sdcCsarHelper.getConformanceLevel();
+ System.out.println("getConformanceLevel() - conformance level is "+conformanceLevel);
+ String serviceSubstitutionMappingsTypeName = sdcCsarHelper.getServiceSubstitutionMappingsTypeName();
+ System.out.println("serviceSubstitutionMappingsTypeName() - subst mappings type of service is "+serviceSubstitutionMappingsTypeName);
+ List<Input> serviceInputs = sdcCsarHelper.getServiceInputs();
+ System.out.println("getServiceInputs() - service inputs are "+serviceInputs);
+ Metadata serviceMetadata = sdcCsarHelper.getServiceMetadata();
+ System.out.println("getServiceMetadata() - service metadata is "+serviceMetadata);
+ Map<String, Object> serviceMetadataProperties = sdcCsarHelper.getServiceMetadataProperties();
+ System.out.println("getServiceMetadataProperties() - service metadata properties is "+serviceMetadataProperties);
+ List<NodeTemplate> allottedResources = sdcCsarHelper.getAllottedResources();
+ System.out.println("getAllottedResources() - service allotted resources are "+allottedResources);
+ List<NodeTemplate> serviceVfList = sdcCsarHelper.getServiceVfList();
+ System.out.println("getServiceVfList() - VF list is "+serviceVfList);
+ List<NodeTemplate> serviceNodeTemplateBySdcType = sdcCsarHelper.getServiceNodeTemplateBySdcType(SdcTypes.VF);
+ System.out.println("getServiceNodeTemplateBySdcType() - VF list is "+serviceNodeTemplateBySdcType);
+ List<NodeTemplate> serviceNodeTemplates = sdcCsarHelper.getServiceNodeTemplates();
+ System.out.println("getServiceNodeTemplates() - all node templates list of service is "+serviceNodeTemplates);
+
+ serviceVfList.forEach(x -> {
+ String nodeTemplateCustomizationUuid = sdcCsarHelper.getNodeTemplateCustomizationUuid(x);
+ System.out.println("getNodeTemplateCustomizationUuid() - VF ID is "+nodeTemplateCustomizationUuid);
+ String typeOfNodeTemplate = sdcCsarHelper.getTypeOfNodeTemplate(x);
+ System.out.println("getTypeOfNodeTemplate() - VF tosca type is "+typeOfNodeTemplate);
+ List<Group> vfModulesByVf = sdcCsarHelper.getVfModulesByVf(nodeTemplateCustomizationUuid);
+ System.out.println("getVfModulesByVf() - VF modules list is "+vfModulesByVf);
+ vfModulesByVf.forEach(y -> {
+ List<NodeTemplate> membersOfVfModule = sdcCsarHelper.getMembersOfVfModule(x, y);
+ System.out.println("getMembersOfVfModule() - members of VfModule are "+membersOfVfModule);
+ });
+ List<NodeTemplate> vfcListByVf = sdcCsarHelper.getVfcListByVf(nodeTemplateCustomizationUuid);
+ System.out.println("getVfcListByVf() - VFC list is "+vfcListByVf);
+ vfcListByVf.forEach(z -> {
+ List<NodeTemplate> nodeTemplateBySdcType = sdcCsarHelper.getNodeTemplateBySdcType(z, SdcTypes.CP);
+ System.out.println("getNodeTemplateBySdcType() - CP children node templates of this VFC are "+nodeTemplateBySdcType);
+ Map<String, Map<String, Object>> cpPropertiesFromVfcAsObject = sdcCsarHelper.getCpPropertiesFromVfcAsObject(z);
+ System.out.println("getCpPropertiesFromVfcAsObject() - consolidated CP properties for this VFC are "+cpPropertiesFromVfcAsObject);
+ boolean hasTopology = sdcCsarHelper.hasTopology(z);
+ System.out.println("hasTopology() - this VFC is "+(hasTopology ? "nested" : "not nested"));
+ });
+ });
+ }
+
+ private static void generateReport(String time, String name, String currentCsarDir, List<String> criticalsReport, String type)
+ throws IOException {
+ FileWriter fw;
+ fw = new FileWriter(new File(currentCsarDir + "/" + criticalsReport.size() + "-"+type+"-" + name +"-"+time + ".txt"));
+ for (String exception : criticalsReport) {
+ fw.write(exception);
+ fw.write("\r\n");
+ }
+ fw.close();
+ }
+}
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java
index c8f9ee4139..2c5d985aa5 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java
@@ -390,6 +390,15 @@ public class FileHandling {
//
// }
// }
+
+ public static String getCreateDirByName(String dirName) {
+ File dir = new File(dirName);
+ dir.mkdir();
+ if(!dir.exists()) {
+ }
+
+ return dir.getPath();
+ }
public static boolean isFileDownloaded(String downloadPath, String fileName) {
boolean flag = false;
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java
index 13a56417e8..7bcf33801a 100644
--- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java
+++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/AssetRestUtils.java
@@ -26,10 +26,7 @@ import static org.testng.AssertJUnit.assertTrue;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.Map.Entry;
import org.apache.http.HttpEntity;
@@ -62,6 +59,7 @@ import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -105,7 +103,9 @@ public class AssetRestUtils extends BaseRestUtils {
String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
assetType.getValue(), uuid);
HttpGet httpGet = new HttpGet(url);
- File myFile = new File("tmpCSAR");
+
+ String csarDir = FileHandling.getCreateDirByName("outputCsar");
+ File myFile = new File(csarDir+ File.separator + "tmpCSAR" + getShortUUID()+".csar");
httpGet.addHeader(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
@@ -123,7 +123,9 @@ public class AssetRestUtils extends BaseRestUtils {
}
return myFile;
}
-
+
+
+
public static RestResponse getRestResponseComponentToscaModel(AssetTypeEnum assetType, String uuid) throws IOException {
Config config = Utils.getConfig();
@@ -622,5 +624,8 @@ public class AssetRestUtils extends BaseRestUtils {
}
return null;
}
+ private static String getShortUUID() {
+ return UUID.randomUUID().toString().split("-")[0];
+ }
}
diff --git a/test-apis-ci/src/main/resources/ci/testSuites/onap.xml b/test-apis-ci/src/main/resources/ci/testSuites/onap.xml
index c075f10b11..1d5bc4b1bf 100644
--- a/test-apis-ci/src/main/resources/ci/testSuites/onap.xml
+++ b/test-apis-ci/src/main/resources/ci/testSuites/onap.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="2" data-provider-thread-count="2">
+<suite name="externalApis" configfailurepolicy="continue" verbose="2" parallel="methods" thread-count="1" data-provider-thread-count="1">
<test name="ExternalApis">
<classes>