summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/CSARConstants.java45
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/Manifest.java56
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/OnboardingManifest.java234
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/ManifestParsingTest.java114
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InValidNonManoTosca.mf36
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTocsaNonManoGarbadgeAtEnd.mf34
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca1.mf11
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca2.mf18
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca3.mf7
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca4.mf12
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidNonManoTosca.mf33
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidTosca.mf15
12 files changed, 615 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/CSARConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/CSARConstants.java
new file mode 100644
index 0000000000..94786fe0df
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/CSARConstants.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.tosca.csar;
+
+import com.google.common.collect.ImmutableSet;
+
+import static com.google.common.collect.ImmutableSet.of;
+public class CSARConstants {
+
+ public static final ImmutableSet<String> ELIGBLE_FOLDERS = of("Artifacts/","Definitions/",
+ "Licenses/", "TOSCA-Metadata/");
+
+ public static final String MAIN_SERVICE_TEMPLATE_MF_FILE_NAME = "MainServiceTemplate.mf";
+ public static final String MAIN_SERVICE_TEMPLATE_YAML_FILE_NAME = "MainServiceTemplate.yaml";
+ public static final String TOSCA_META_PATH_FILE_NAME="TOSCA-Metadata/TOSCA.meta";
+ public static final String TOSCA_META_ENTRY_DEFINITIONS="Entry-Definitions";
+ public static final String TOSCA_META_ENTRY_MANIFEST="Entry-Manifest";
+ public static final String TOSCA_META_ENTRY_CHANGE_LOG="Entry-Change-Log";
+ public static final ImmutableSet<String> ELIGIBLE_FILES =
+ of(MAIN_SERVICE_TEMPLATE_MF_FILE_NAME,MAIN_SERVICE_TEMPLATE_YAML_FILE_NAME);
+
+ public static final String METADATA_MF_ATTRIBUTE = "metadata";
+ public static final String SOURCE_MF_ATTRIBUTE = "Source";
+ public static final String SEPERATOR_MF_ATTRIBUTE = ":";
+ public static final String NON_MANO_MF_ATTRIBUTE = "non_mano_artifact_sets";
+ public static final String TOSCA_META_ORIG_PATH_FILE_NAME="TOSCA-Metadata/TOSCA.meta.original";
+
+ private CSARConstants() {
+
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/Manifest.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/Manifest.java
new file mode 100644
index 0000000000..2aac3a7be5
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/Manifest.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019, Nordix Foundation. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.tosca.csar;
+
+import java.util.List;
+import java.util.Map;
+
+public interface Manifest {
+ /**
+ * Returns if manifest is valid
+ * @return true/false
+ */
+ boolean isValid();
+
+ /**
+ * Metadata section of manifest
+ * @return
+ */
+ Map<String, String> getMetadata();
+
+ /**
+ * Source section of manifest
+ * @return
+ */
+ List<String> getSources();
+
+ /**
+ * Validation errors of manifest
+ * @return
+ */
+ List<String> getErrors();
+
+ /**
+ * non mano section of manifest sol004 #4.3.7
+ * @return
+ */
+ Map<String, List<String>> getNonManoSources();
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/OnboardingManifest.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/OnboardingManifest.java
new file mode 100644
index 0000000000..8858128b38
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/csar/OnboardingManifest.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.tosca.csar;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.openecomp.sdc.common.errors.Messages;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import static org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder.getErrorWithParameters;
+import static org.openecomp.sdc.tosca.csar.CSARConstants.METADATA_MF_ATTRIBUTE;
+import static org.openecomp.sdc.tosca.csar.CSARConstants.NON_MANO_MF_ATTRIBUTE;
+import static org.openecomp.sdc.tosca.csar.CSARConstants.SEPERATOR_MF_ATTRIBUTE;
+import static org.openecomp.sdc.tosca.csar.CSARConstants.SOURCE_MF_ATTRIBUTE;
+
+public class OnboardingManifest implements Manifest{
+ private static final Logger LOGGER = LoggerFactory.getLogger(OnboardingManifest.class);
+ private Map<String, String> metadata;
+ private List<String> sources;
+ private List<String> errors;
+ private Map<String, List<String>> nonManoSources;
+
+ private OnboardingManifest() {
+ errors = new ArrayList<>();
+ sources = new ArrayList<>();
+ metadata = new HashMap<>();
+ nonManoSources = new HashMap<>();
+ }
+
+ /**
+ * This Method will parse manifest, extracting fields mandatory/non-mandatory,
+ * if error occurred it's recorded and will be used for deciding if manifest is valid
+ * @param is manifest file input stream
+ * @return Manifest object
+ */
+ public static Manifest parse(InputStream is) {
+ OnboardingManifest manifest = new OnboardingManifest();
+ try {
+ ImmutableList<String> lines = manifest.readAllLines(is);
+ manifest.processManifest(lines);
+ } catch (IOException e){
+ LOGGER.error(e.getMessage(),e);
+ manifest.errors.add(Messages.MANIFEST_PARSER_INTERNAL.getErrorMessage());
+ }
+ return manifest;
+ }
+
+ private void processManifest(ImmutableList<String> lines) {
+ if(lines == null || lines.isEmpty()){
+ errors.add(Messages.MANIFEST_EMPTY.getErrorMessage());
+ return;
+ }
+ Iterator<String> iterator = lines.iterator();
+ //SOL004 #4.3.2: The manifest file shall start with the package metadata
+ String line = iterator.next();
+ if(!line.trim().equals(METADATA_MF_ATTRIBUTE + SEPERATOR_MF_ATTRIBUTE)){
+ reportError(line);
+ return;
+ }
+ //handle metadata
+ processMetadata(iterator);
+
+ if (errors.isEmpty()) {
+ if (metadata.isEmpty()) {
+ errors.add(Messages.MANIFEST_NO_METADATA.getErrorMessage());
+ }
+ if (sources.isEmpty()) {
+ errors.add(Messages.MANIFEST_NO_SOURCES.getErrorMessage());
+ }
+ }
+ }
+
+ private void processSourcesAndNonManoSources(Iterator<String> iterator, String prevLine) {
+ if(prevLine.isEmpty()){
+ if(iterator.hasNext()){
+ processSourcesAndNonManoSources(iterator, iterator.next());
+ }
+ }else if(prevLine.startsWith(SOURCE_MF_ATTRIBUTE+SEPERATOR_MF_ATTRIBUTE)){
+ processSource(iterator, prevLine);
+ } else if(prevLine.startsWith(NON_MANO_MF_ATTRIBUTE+SEPERATOR_MF_ATTRIBUTE)){
+ //non mano should be the last bit in manifest file,
+ // all sources after non mano will be placed to the last non mano
+ // key, if any other structure met error reported
+ processNonManoInputs(iterator, iterator.next());
+ }else{
+ reportError(prevLine);
+ }
+ }
+
+ private void processSource(Iterator<String> iterator, String prevLine) {
+ String value = prevLine.substring((SOURCE_MF_ATTRIBUTE + SEPERATOR_MF_ATTRIBUTE).length()).trim();
+ sources.add(value);
+ if(iterator.hasNext()) {
+ processSourcesAndNonManoSources(iterator, iterator.next());
+ }
+ }
+
+ private void processMetadata(Iterator<String> iterator) {
+ if(!iterator.hasNext()){
+ return;
+ }
+ String line = iterator.next();
+ if(line.isEmpty()){
+ processMetadata(iterator);
+ return;
+ }
+ String[] metaSplit = line.split(SEPERATOR_MF_ATTRIBUTE);
+ if (metaSplit.length < 2){
+ return;
+ }
+ if (!metaSplit[0].equals(SOURCE_MF_ATTRIBUTE) && !metaSplit[0].equals(NON_MANO_MF_ATTRIBUTE)){
+ String value = line.substring((metaSplit[0] + SEPERATOR_MF_ATTRIBUTE).length()).trim();
+ metadata.put(metaSplit[0],value);
+ processMetadata(iterator);
+ }
+ else {
+ processSourcesAndNonManoSources(iterator, line);
+ }
+ }
+
+ private void processNonManoInputs(Iterator<String> iterator, String prevLine) {
+ //Non Mano input should always start with key, if no key available report an error
+ if(prevLine.trim().equals(SOURCE_MF_ATTRIBUTE + SEPERATOR_MF_ATTRIBUTE)){
+ reportError(prevLine);
+ return;
+ }
+ //key should contain : separator
+ if(!prevLine.contains(SEPERATOR_MF_ATTRIBUTE)){
+ reportError(prevLine);
+ return;
+ }
+ //key shouldn't have value in the same line
+ String[] metaSplit = prevLine.trim().split(SEPERATOR_MF_ATTRIBUTE);
+ if (metaSplit.length > 1){
+ reportError(prevLine);
+ return;
+ }
+ int index = prevLine.indexOf(':');
+ if(index > 0){
+ prevLine = prevLine.substring(0, index);
+ }
+ processNonManoSource(iterator, prevLine, new ArrayList<>());
+
+ }
+
+ private void processNonManoSource(Iterator<String> iterator, String key, List<String> sources) {
+ if(!iterator.hasNext()){
+ return;
+ }
+ String line = iterator.next();
+ if(line.isEmpty()){
+ processNonManoSource(iterator, key, sources);
+ }else if(line.trim().startsWith(SOURCE_MF_ATTRIBUTE + SEPERATOR_MF_ATTRIBUTE)){
+ String value = line.replace(SOURCE_MF_ATTRIBUTE + SEPERATOR_MF_ATTRIBUTE, "").trim();
+ sources.add(value);
+ processNonManoSource(iterator, key, sources);
+ }else {
+ processNonManoInputs(iterator, line);
+ }
+ nonManoSources.put(key.trim(), sources);
+ }
+
+ private void reportError(String line) {
+ errors.add(getErrorWithParameters(Messages.MANIFEST_INVALID_LINE.getErrorMessage(), line));
+ }
+
+ private ImmutableList<String> readAllLines(InputStream is) throws IOException {
+ if(is == null){
+ throw new IOException("Input Stream cannot be null!");
+ }
+ ImmutableList.Builder<String> builder = ImmutableList.<String> builder();
+ try (BufferedReader bufferedReader = new BufferedReader(
+ new InputStreamReader(is, StandardCharsets.UTF_8.newDecoder()))) {
+ bufferedReader.lines().forEach(builder::add);
+ }
+ return builder.build();
+ }
+
+ public Map<String, String> getMetadata() {
+ if (!isValid()){
+ return Collections.emptyMap();
+ }
+ return ImmutableMap.copyOf(metadata);
+ }
+
+ public List<String> getSources() {
+ if (!isValid()){
+ return Collections.emptyList();
+ }
+ return ImmutableList.copyOf(sources);
+ }
+
+ public List<String> getErrors() {
+ return ImmutableList.copyOf(errors);
+ }
+
+ public boolean isValid() {
+ return errors.isEmpty();
+ }
+
+ public Map<String, List<String>> getNonManoSources() {
+ if (!isValid()){
+ return Collections.emptyMap();
+ }
+ return ImmutableMap.copyOf(nonManoSources);
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/ManifestParsingTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/ManifestParsingTest.java
new file mode 100644
index 0000000000..c6008f03d7
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/csar/ManifestParsingTest.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.openecomp.sdc.tosca.csar;
+
+import org.junit.Test;
+import org.openecomp.sdc.common.errors.Messages;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+
+public class ManifestParsingTest {
+
+ @Test
+ public void testSuccessfulParsing() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/ValidTosca.mf")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertTrue(onboardingManifest.isValid());
+ assertEquals(onboardingManifest.getMetadata().size(), 4);
+ assertEquals(onboardingManifest.getSources().size(), 5);
+ }
+ }
+
+ @Test
+ public void testNoMetadataParsing() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca1.mf")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertFalse(onboardingManifest.isValid());
+ assertTrue(onboardingManifest.getErrors().stream().anyMatch(error -> error
+ .contains(Messages.MANIFEST_INVALID_LINE.getErrorMessage().substring(0, 10))));
+ }
+ }
+
+ @Test
+ public void testBrokenMDParsing() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca2.mf")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertFalse(onboardingManifest.isValid());
+ assertTrue(onboardingManifest.getErrors().stream().anyMatch(error -> error
+ .contains(Messages.MANIFEST_INVALID_LINE.getErrorMessage().substring(0, 10))));
+ }
+ }
+
+ @Test
+ public void testNoMetaParsing() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/InvalidTosca4.mf")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertFalse(onboardingManifest.isValid());
+ assertTrue(onboardingManifest.getErrors().stream().anyMatch(error -> error
+ .contains(Messages.MANIFEST_NO_METADATA.getErrorMessage().substring(0, 10))));
+ }
+ }
+
+ @Test
+ public void testSuccessfulNonManoParsing() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/ValidNonManoTosca.mf")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertTrue(onboardingManifest.isValid());
+ assertEquals(onboardingManifest.getMetadata().size(), 4);
+ assertEquals(onboardingManifest.getSources().size(), 5);
+ assertEquals(onboardingManifest.getNonManoSources().size(), 2);
+ }
+ }
+
+ @Test
+ public void testFailfulNonManoParsing() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/InValidNonManoTosca.mf")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertFalse(onboardingManifest.isValid());
+ }
+ }
+
+ @Test
+ public void testFailfulNonManoParsingWithGarbadge() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/InvalidTocsaNonManoGarbadgeAtEnd.mf")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertFalse(onboardingManifest.isValid());
+ }
+ }
+
+ @Test
+ public void testParseManifestWithNoFile() throws IOException {
+ try (InputStream is = getClass()
+ .getResourceAsStream("/vspmanager.csar/manifest/SOME_WRONG_FILE")) {
+ Manifest onboardingManifest = OnboardingManifest.parse(is);
+ assertFalse(onboardingManifest.isValid());
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InValidNonManoTosca.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InValidNonManoTosca.mf
new file mode 100644
index 0000000000..9cced6b371
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InValidNonManoTosca.mf
@@ -0,0 +1,36 @@
+metadata:
+ vnf_product_name: Mock
+ vnf_provider_id: ZTE
+ vnf_package_version: 1.0
+ vnf_release_data_time: 2017.01.01T10:00+03:00
+
+Source: MainServiceTemplate.yaml
+
+Source: Definitions/GlobalSubstitutionTypesServiceTemplate.yaml
+
+Source: Artifacts/install.sh
+
+Source: Artifacts/create_stack.sh
+
+Source: Licenses/license.xml
+
+non_mano_artifact_sets:
+ foo_bar:
+ Source: foobar/foo/foo.yaml
+
+ Source: foobar/foo/foo.script
+
+ Source: foobar/bar/descriptor.xml
+
+ prv.happy-nfv.cool:
+
+ Source: happy/cool/123.html
+
+ Source: happy/cool/cool.json
+
+ Source: happy/cool/hot/hot_or_cool.json
+
+
+vnf_product_name: Mock
+vnf_provider_id: ZTE
+vnf_package_version: 1.0 \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTocsaNonManoGarbadgeAtEnd.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTocsaNonManoGarbadgeAtEnd.mf
new file mode 100644
index 0000000000..cfe6bc48da
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTocsaNonManoGarbadgeAtEnd.mf
@@ -0,0 +1,34 @@
+metadata:
+ vnf_product_name: Mock
+ vnf_provider_id: ZTE
+ vnf_package_version: 1.0
+ vnf_release_data_time: 2017.01.01T10:00+03:00
+
+Source: MainServiceTemplate.yaml
+
+Source: Definitions/GlobalSubstitutionTypesServiceTemplate.yaml
+
+Source: Artifacts/install.sh
+
+Source: Artifacts/create_stack.sh
+
+Source: Licenses/license.xml
+
+non_mano_artifact_sets:
+ foo_bar:
+ Source: foobar/foo/foo.yaml
+
+ Source: foobar/foo/foo.script
+
+ Source: foobar/bar/descriptor.xml
+
+ prv.happy-nfv.cool:
+
+ Source: happy/cool/123.html
+
+ Source: happy/cool/cool.json
+
+ Source: happy/cool/hot/hot_or_cool.json
+
+
+some garbadge \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca1.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca1.mf
new file mode 100644
index 0000000000..ebdec213d3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca1.mf
@@ -0,0 +1,11 @@
+
+
+Source: MainServiceTemplate.yaml
+
+Source: Definitions/GlobalSubstitutionTypesServiceTemplate.yaml
+
+Source: Artifacts/install.sh
+
+Source: Artifacts/create_stack.sh
+
+Source: Licenses/license.xml
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca2.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca2.mf
new file mode 100644
index 0000000000..057f54867b
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca2.mf
@@ -0,0 +1,18 @@
+metadata:
+ vnf_product_name: Mock
+ vnf_provider_id: ZTE
+
+Source: MainServiceTemplate.yaml
+
+ vnf_package_version: 1.0
+ vnf_release_data_time: 2017.01.01T10:00+03:00
+
+
+
+Source: Definitions/GlobalSubstitutionTypesServiceTemplate.yaml
+
+Source: Artifacts/install.sh
+
+Source: Artifacts/create_stack.sh
+
+Source: Licenses/license.xml
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca3.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca3.mf
new file mode 100644
index 0000000000..64e9445f7f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca3.mf
@@ -0,0 +1,7 @@
+metadata:
+ vnf_product_name: Mock
+ vnf_provider_id: ZTE
+ vnf_package_version: 1.0
+ vnf_release_data_time: 2017.01.01T10:00+03:00
+
+
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca4.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca4.mf
new file mode 100644
index 0000000000..d8e291c4a3
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/InvalidTosca4.mf
@@ -0,0 +1,12 @@
+metadata:
+
+
+Source: MainServiceTemplate.yaml
+
+Source: Definitions/GlobalSubstitutionTypesServiceTemplate.yaml
+
+Source: Artifacts/install.sh
+
+Source: Artifacts/create_stack.sh
+
+Source: Licenses/license.xml
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidNonManoTosca.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidNonManoTosca.mf
new file mode 100644
index 0000000000..25ec14c7cc
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidNonManoTosca.mf
@@ -0,0 +1,33 @@
+metadata:
+ vnf_product_name: Mock
+ vnf_provider_id: ZTE
+ vnf_package_version: 1.0
+ vnf_release_data_time: 2017.01.01T10:00+03:00
+
+Source: MainServiceTemplate.yaml
+
+Source: Definitions/GlobalSubstitutionTypesServiceTemplate.yaml
+
+Source: Artifacts/install.sh
+
+Source: Artifacts/create_stack.sh
+
+Source: Licenses/license.xml
+
+non_mano_artifact_sets:
+ foo_bar:
+ Source: foobar/foo/foo.yaml
+
+ Source: foobar/foo/foo.script
+
+ Source: foobar/bar/descriptor.xml
+
+ prv.happy-nfv.cool:
+
+ Source: happy/cool/123.html
+
+ Source: happy/cool/cool.json
+
+ Source: happy/cool/hot/hot_or_cool.json
+
+
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidTosca.mf b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidTosca.mf
new file mode 100644
index 0000000000..b2accb7a1c
--- /dev/null
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/vspmanager.csar/manifest/ValidTosca.mf
@@ -0,0 +1,15 @@
+metadata:
+ vnf_product_name: Mock
+ vnf_provider_id: ZTE
+ vnf_package_version: 1.0
+ vnf_release_data_time: 2017.01.01T10:00+03:00
+
+Source: MainServiceTemplate.yaml
+
+Source: Definitions/GlobalSubstitutionTypesServiceTemplate.yaml
+
+Source: Artifacts/install.sh
+
+Source: Artifacts/create_stack.sh
+
+Source: Licenses/license.xml