summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'csarvalidation/src/main')
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/CsarValidator.java156
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/ReleasesResolver.java62
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/RulesToValidate.java40
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java123
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/oclip/Command.java43
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/oclip/CommandFactory.java61
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r02454.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r09467.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r15837.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r17852.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r32155.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35851.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35854.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r46527.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r54356.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r65486.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r67895.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r95321.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r01123.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r04298.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r07879.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r10087.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r130206.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r13390.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r146092.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r21322.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r23823.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26881.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26885.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r27310.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r293901.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40293.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40820.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r43958.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r51347.yaml3
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r57019.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r66070.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77707.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77786.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r787965.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r816745.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r87234.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r972082.yaml4
-rw-r--r--csarvalidation/src/main/resources/open-cli-schema/vtp-validate-csar.yaml9
-rw-r--r--csarvalidation/src/main/resources/vnfreqs.properties1
45 files changed, 522 insertions, 120 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/CsarValidator.java b/csarvalidation/src/main/java/org/onap/cvc/csar/CsarValidator.java
new file mode 100644
index 0000000..cee45fe
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/CsarValidator.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2021 Nokia
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.onap.cvc.csar;
+
+import org.apache.commons.lang3.tuple.Pair;
+import org.onap.cli.fw.error.OnapCommandException;
+import org.onap.cvc.csar.oclip.Command;
+import org.onap.cvc.csar.oclip.CommandFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class CsarValidator {
+
+ private final CommandFactory commandFactory;
+ private final List<String> ignoreCodes;
+ private final List<String> activeRules;
+ private final ReleasesResolver releasesResolver;
+ private final RulesToValidate rulesToValidate;
+
+ public CsarValidator(CommandFactory commandFactory, List<String> ignoreCodes,
+ List<String> activeRules, ReleasesResolver releasesResolver,
+ RulesToValidate rulesToValidate) {
+ this.commandFactory = commandFactory;
+ this.ignoreCodes = ignoreCodes;
+ this.activeRules = activeRules;
+ this.releasesResolver = releasesResolver;
+ this.rulesToValidate = rulesToValidate;
+ }
+
+ Pair<Boolean, List<VTPValidateCSAR.CSARValidation.Result>> validate(ValidationContext validationContext) {
+
+ boolean overallPass = true;
+ List<VTPValidateCSAR.CSARValidation.Result> results = new ArrayList<>();
+
+ final List<String> rules = getRulesToExecute();
+
+ for (String rule : rules) {
+ final Pair<Boolean, List<VTPValidateCSAR.CSARValidation.Result>> pair = executeValidation(releasesResolver, ignoreCodes, rule, validationContext);
+ overallPass &= pair.getLeft();
+ results.addAll(pair.getRight());
+ }
+
+ return Pair.of(overallPass, results);
+ }
+
+ private List<String> getRulesToExecute() {
+ final List<String> rulesToExecute = rulesToValidate.get();
+
+ return activeRules.stream().filter(
+ it -> rulesToExecute.isEmpty() || rulesToExecute.contains(it)
+ ).collect(Collectors.toList());
+ }
+
+ private Pair<Boolean, List<VTPValidateCSAR.CSARValidation.Result>> executeValidation(
+ ReleasesResolver releasesResolver, List<String> ignoreCodes,
+ String reqName, ValidationContext validationContext) {
+
+ boolean overallPass = true;
+ List<VTPValidateCSAR.CSARValidation.Result> results = new ArrayList<>();
+ VTPValidateCSAR.CSARValidation.Result result = new VTPValidateCSAR.CSARValidation.Result();
+ result.setVnfreqName(reqName);
+
+ try {
+ Command cmd = getCommand(reqName, validationContext);
+ if (releasesResolver.resolveWithAncestors(validationContext.getRelease()).contains(cmd.getRelease())) {
+ final List<CSARArchive.CSARError> errors = cmd.run();
+
+ result.setDescription(cmd.getDescription());
+
+ final Pair<List<CSARArchive.CSARError>, List<CSARArchive.CSARError>> segregateErrors = segregate(errors, ignoreCodes, reqName);
+ overallPass = segregateErrors.getLeft().isEmpty();
+ result.addErrors(segregateErrors.getLeft());
+ result.addErrorsAsWarnings(segregateErrors.getRight());
+ result.setPassed(result.getErrors().isEmpty());
+ results.add(result);
+ }
+ } catch (Exception e) {
+ result.setPassed(false);
+ overallPass = false;
+ result.addError(new CSARArchive.CSARErrorUnknown(e.getMessage()));
+ results.add(result);
+ }
+ return Pair.of(overallPass, results);
+ }
+
+ private Command getCommand(String reqName, ValidationContext validationContext) throws OnapCommandException {
+ return validationContext.isPnf() ? commandFactory.createForPnf(reqName, validationContext.getPathToCsar(), validationContext.getProduct()) : commandFactory.createForVnf(reqName, validationContext.getPathToCsar(), validationContext.getProduct());
+ }
+
+ private Pair<List<CSARArchive.CSARError>, List<CSARArchive.CSARError>> segregate(
+ List<CSARArchive.CSARError> errors, List<String> ignoreCodes, String reqName){
+
+ final List<CSARArchive.CSARError> errorsList = new ArrayList<>();
+ final List<CSARArchive.CSARError> warningsList = new ArrayList<>();
+
+ for (CSARArchive.CSARError error : errors) {
+ if (!isErrorIgnored(ignoreCodes, reqName, error)) {
+ errorsList.add(error);
+ } else {
+ warningsList.add(error);
+ }
+ }
+
+ return Pair.of(errorsList,warningsList);
+ }
+
+ private boolean isErrorIgnored(List<String> ignoreCodes, String reqName, CSARArchive.CSARError error) {
+ return ignoreCodes.contains(error.getCode()) || ignoreCodes.contains(reqName + "-" + error.getCode());
+ }
+
+ public static class ValidationContext {
+ private final String pathToCsar;
+ private final String product;
+ private final String release;
+ private final boolean isPnf;
+
+
+ public ValidationContext(String pathToCsar, String product, String release, boolean isPnf) {
+ this.pathToCsar = pathToCsar;
+ this.product = product;
+ this.release = release;
+ this.isPnf = isPnf;
+ }
+
+ public String getPathToCsar() {
+ return pathToCsar;
+ }
+
+ public String getProduct() {
+ return product;
+ }
+
+ public String getRelease() {
+ return release;
+ }
+
+ public boolean isPnf() {
+ return isPnf;
+ }
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/ReleasesResolver.java b/csarvalidation/src/main/java/org/onap/cvc/csar/ReleasesResolver.java
new file mode 100644
index 0000000..4a9c8d1
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/ReleasesResolver.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2021 Nokia
+ *
+ * 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.onap.cvc.csar;
+
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+public class ReleasesResolver {
+ public static final String SPLIT_BY_COMMA = ",";
+ public static final String SPECIAL_KEYWORD = "latest";
+ public static final int NOT_FOUND = -1;
+ private final String[] releaseInOrder;
+
+ private ReleasesResolver(String[] releaseInOrder) {
+ this.releaseInOrder = releaseInOrder;
+ }
+
+ public static ReleasesResolver create(String releaseInOrder) {
+ return new ReleasesResolver(releaseInOrder.split(SPLIT_BY_COMMA));
+ }
+
+ public List<String> resolveWithAncestors(String release) {
+ final int index = findIndexOf(release);
+ if (isReleaseAvailable(index)) {
+ throw new IllegalArgumentException(String.format("Release '%s' is not defined at the releases.order list in a vnfreqs.properties file!", release));
+ }
+ return new LinkedList<>(getElements(this.releaseInOrder, index));
+ }
+
+ private boolean isReleaseAvailable(int index) {
+ return index == NOT_FOUND;
+ }
+
+ private List<String> getElements(String[] elements, int index) {
+ return Arrays.asList(elements).subList(0, index + 1);
+ }
+
+ private int findIndexOf(String release) {
+ if (release.equals(SPECIAL_KEYWORD)) {
+ return getIndexOfLastElement();
+ }
+ return Arrays.asList(this.releaseInOrder).indexOf(release);
+ }
+
+ private int getIndexOfLastElement() {
+ return this.releaseInOrder.length - 1;
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/RulesToValidate.java b/csarvalidation/src/main/java/org/onap/cvc/csar/RulesToValidate.java
new file mode 100644
index 0000000..7ca0dc5
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/RulesToValidate.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2021 Nokia
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.onap.cvc.csar;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class RulesToValidate {
+ private static final String RULES_ATTRIBUTE_SEPARATOR = ",";
+ private final String rulesToValidate;
+
+ public RulesToValidate(String rulesToValidate) {
+ this.rulesToValidate = rulesToValidate;
+ }
+
+ public List<String> get(){
+ List<String> rules = new ArrayList<>();
+
+ if(!rulesToValidate.isEmpty()){
+ String[] listOfRulesToValidate = rulesToValidate.split(RULES_ATTRIBUTE_SEPARATOR);
+ rules.addAll(Arrays.asList(listOfRulesToValidate));
+ }
+
+ return rules;
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java b/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java
index 637a454..2e99be3 100644
--- a/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/VTPValidateCSAR.java
@@ -18,19 +18,21 @@ package org.onap.cvc.csar;
import com.google.gson.Gson;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Properties;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.tuple.Pair;
import org.onap.cli.fw.cmd.OnapCommand;
import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cli.fw.error.OnapCommandExecutionFailed;
-import org.onap.cli.fw.error.OnapCommandInvalidParameterValue;
-import org.onap.cli.fw.input.OnapCommandParameter;
import org.onap.cli.fw.output.OnapCommandResultType;
-import org.onap.cli.fw.registrar.OnapCommandRegistrar;
import org.onap.cli.fw.schema.OnapCommandSchema;
import org.onap.cvc.csar.CSARArchive.CSARError;
+import org.onap.cvc.csar.oclip.CommandFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,9 +42,9 @@ import org.slf4j.LoggerFactory;
@OnapCommandSchema(schema = "vtp-validate-csar.yaml")
public class VTPValidateCSAR extends OnapCommand {
- private static Gson gson = new Gson();
+ private static final Gson GSON = new Gson();
private static final Logger LOG = LoggerFactory.getLogger(VTPValidateCSAR.class);
- private static final String RULES_ATTRIBUTE_SEPARATOR = ",";
+ private static final String RELEASE_ATTRIBUTE_NAME = "release";
private static final String PNF_ATTRIBUTE_NAME = "pnf";
private static final String CSAR_ATTRIBUTE_NAME = "csar";
private static final String RULES_ATTRIBUTE_NAME = "rules";
@@ -107,8 +109,8 @@ public class VTPValidateCSAR extends OnapCommand {
private boolean passed;
private String vnfreqName;
private String description;
- private List<CSARError> errors = new ArrayList<>();
- private List<CSARError> warnings = new ArrayList<>();
+ private final List<CSARError> errors = new ArrayList<>();
+ private final List<CSARError> warnings = new ArrayList<>();
public boolean isPassed() {
return passed;
@@ -149,6 +151,14 @@ public class VTPValidateCSAR extends OnapCommand {
public void addErrorAsWarning(CSARError error) {
this.warnings.add(error);
}
+
+ public void addErrors(List<CSARError> errors) {
+ this.errors.addAll(errors);
+ }
+
+ public void addErrorsAsWarnings(List<CSARError> warnings) {
+ this.warnings.addAll(warnings);
+ }
}
private List<Result> results = new ArrayList<>();
@@ -206,11 +216,11 @@ public class VTPValidateCSAR extends OnapCommand {
}
}
- private static Properties properties = new Properties();
+ private static final Properties PROPERTIES = new Properties();
static {
try {
- properties.load(VTPValidateCSAR.class.getResourceAsStream("/vnfreqs.properties"));
+ PROPERTIES.load(VTPValidateCSAR.class.getResourceAsStream("/vnfreqs.properties"));
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
@@ -219,13 +229,14 @@ public class VTPValidateCSAR extends OnapCommand {
@Override
protected void run() throws OnapCommandException {
//Read the input arguments
- String path = (String) getParametersMap().get(CSAR_ATTRIBUTE_NAME).getValue();
+ String release = (String) getParametersMap().get(RELEASE_ATTRIBUTE_NAME).getValue();
+ String pathToCsarFile = (String) getParametersMap().get(CSAR_ATTRIBUTE_NAME).getValue();
boolean isPnf = (boolean) getParametersMap().get(PNF_ATTRIBUTE_NAME).getValue();
String rulesToValidate = (String) getParametersMap().get(RULES_ATTRIBUTE_NAME).getValue();
boolean overallPass = true;
try (CSARArchive csar = isPnf ? new PnfCSARArchive() : new CSARArchive()) {
- csar.init(path);
+ csar.init(pathToCsarFile);
csar.parse();
CSARValidation validation = createCsarValidationFor(csar);
@@ -248,26 +259,11 @@ public class VTPValidateCSAR extends OnapCommand {
validation.getResults().add(resultSOL004);
- String keyReqs = isPnf ? "pnfreqs.enabled" : "vnfreqs.enabled";
- List<String> activeRules = this.getPropertiesList(keyReqs);
- if(rulesToValidate.isEmpty()) {
- // Run thru the vnfreqs requirement checks
- for (String vnfreq : activeRules) {
- CSARValidation.Result result = new CSARValidation.Result();
- result.setVnfreqName(vnfreq);
- overallPass = validateVnfOrPnf(path, validation, ignoreCodes, vnfreq, result, isPnf, overallPass);
- }
- } else {
- // Validate selected rules
- String[] listOfRulesToValidate = rulesToValidate.split(RULES_ATTRIBUTE_SEPARATOR);
- for (String rule : listOfRulesToValidate) {
- if(activeRules.contains(rule)) {
- CSARValidation.Result result = new CSARValidation.Result();
- result.setVnfreqName(rule);
- overallPass = validateVnfOrPnf(path, validation, ignoreCodes, rule, result, isPnf, overallPass);
- }
- }
- }
+ final Pair<Boolean, List<CSARValidation.Result>> validationResult =
+ validate(pathToCsarFile, release, isPnf, ignoreCodes, new RulesToValidate(rulesToValidate));
+
+ overallPass &= validationResult.getLeft();
+ validation.getResults().addAll(validationResult.getRight());
validation.setDate(new Date().toString());
validation.setCriteria(overallPass ? "PASS" : "FAILED");
@@ -279,39 +275,15 @@ public class VTPValidateCSAR extends OnapCommand {
}
}
- private boolean validateVnfOrPnf(String path, CSARValidation validation,
- List<String> ignoreCodes, String vnfreq, CSARValidation.Result result, boolean isPnf, boolean overallPass) {
- try {
- String command = "csar-validate-" + vnfreq;
- OnapCommand cmd = OnapCommandRegistrar.getRegistrar().get(command, this.getInfo().getProduct());
- cmd.getParametersMap().get("csar").setValue(path);
- setPnfValueIfAvailable(isPnf, cmd);
-
- result.setDescription(cmd.getDescription());
- cmd.execute();
-
- for (CSARError error : (List<CSARError>) cmd.getResult().getOutput()) {
- if (!isErrorIgnored(ignoreCodes, vnfreq, error)) {
- result.addError(error);
- overallPass = false;
- } else {
- result.addErrorAsWarning(error);
- }
- }
-
- result.setPassed(result.getErrors().isEmpty());
- validation.getResults().add(result);
- } catch (Exception e) {
- result.setPassed(false);
- overallPass = false;
- result.addError(new CSARArchive.CSARErrorUnknown(e.getMessage()));
- validation.getResults().add(result);
- }
- return overallPass;
- }
+ private Pair<Boolean,List<CSARValidation.Result>> validate(String path, String release, boolean isPnf, List<String> ignoreCodes, RulesToValidate rulesToValidate) {
+ final String keyReqs = isPnf ? "pnfreqs.enabled" : "vnfreqs.enabled";
+ final List<String> activeRules = this.getPropertiesList(keyReqs);
+ final String releasesOrder = PROPERTIES.getProperty("releases.order");
+ final ReleasesResolver releasesResolver = ReleasesResolver.create(releasesOrder);
+ final String product = this.getInfo().getProduct();
- private boolean isErrorIgnored(List<String> ignoreCodes, String vnfreq, CSARError error) {
- return ignoreCodes.contains(error.getCode()) || ignoreCodes.contains(vnfreq + "-" + error.getCode());
+ return new CsarValidator(new CommandFactory(), ignoreCodes, activeRules, releasesResolver, rulesToValidate)
+ .validate(new CsarValidator.ValidationContext(path, product, release, isPnf));
}
static CSARValidation createCsarValidationFor(CSARArchive csar) {
@@ -325,33 +297,20 @@ public class VTPValidateCSAR extends OnapCommand {
return validation;
}
- private void setOperationResult(CSARValidation validation) throws Exception { //NOSONAR
+ private void setOperationResult(CSARValidation validation) {
this.getResult().getRecordsMap().get("vnf").getValues().add(
- gson.toJson(validation.getVnf()));
+ GSON.toJson(validation.getVnf()));
this.getResult().getRecordsMap().get("date").getValues().add(validation.getDate());
this.getResult().getRecordsMap().get("criteria").getValues().add(validation.getCriteria());
this.getResult().getRecordsMap().get("results").getValues().add(
- gson.toJson(validation.getResults()));
+ GSON.toJson(validation.getResults()));
- this.getResult().setOutput(gson.toJson(validation));
+ this.getResult().setOutput(GSON.toJson(validation));
this.getResult().setType(OnapCommandResultType.TEXT);
}
- private void setPnfValueIfAvailable(boolean isPnf, OnapCommand cmd) throws OnapCommandInvalidParameterValue {
- final OnapCommandParameter pnf = cmd.getParametersMap().get(PNF_ATTRIBUTE_NAME);
- if (pnf != null) {
- pnf.setValue(isPnf);
- }
- }
-
private List<String> getPropertiesList(String key) {
- String[] enabledReqs = properties.getProperty(key, "").split(",");
- List<String> list = new ArrayList<>();
- for (String req : enabledReqs) {
- if (!req.isEmpty()) {
- list.add(req);
- }
- }
- return list;
+ String[] enabledReqs = PROPERTIES.getProperty(key, "").split(",");
+ return Arrays.stream(enabledReqs).filter(it->!it.isEmpty()).collect(Collectors.toList());
}
}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/oclip/Command.java b/csarvalidation/src/main/java/org/onap/cvc/csar/oclip/Command.java
new file mode 100644
index 0000000..6c43cc5
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/oclip/Command.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2021 Nokia
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.onap.cvc.csar.oclip;
+
+import org.onap.cli.fw.cmd.OnapCommand;
+import org.onap.cli.fw.error.OnapCommandException;
+import org.onap.cvc.csar.CSARArchive;
+
+import java.util.List;
+
+public class Command {
+ private final OnapCommand cmd;
+
+ public Command(OnapCommand cmd) {
+ this.cmd = cmd;
+ }
+
+ public List<CSARArchive.CSARError> run() throws OnapCommandException {
+ cmd.execute();
+ return (List<CSARArchive.CSARError>) cmd.getResult().getOutput();
+ }
+
+ public String getDescription() {
+ return cmd.getDescription();
+ }
+
+ public String getRelease(){
+ return cmd.getInfo().getMetadata().getOrDefault("release","unknown");
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/oclip/CommandFactory.java b/csarvalidation/src/main/java/org/onap/cvc/csar/oclip/CommandFactory.java
new file mode 100644
index 0000000..18c1a2c
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/oclip/CommandFactory.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2021 Nokia
+ * <p>
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.onap.cvc.csar.oclip;
+
+import org.onap.cli.fw.cmd.OnapCommand;
+import org.onap.cli.fw.error.OnapCommandException;
+import org.onap.cli.fw.error.OnapCommandInvalidParameterValue;
+import org.onap.cli.fw.input.OnapCommandParameter;
+import org.onap.cli.fw.registrar.OnapCommandRegistrar;
+
+
+public class CommandFactory {
+
+ private static final String PNF_ATTRIBUTE_NAME = "pnf";
+ private static final String COMMAND_PREFIX = "csar-validate-";
+ private static final String CSAR_PARAM_NAME = "csar";
+
+ public Command createForVnf(String req, String pathToCsarFile, String product) throws OnapCommandException {
+ OnapCommand cmd = createCommand(req, pathToCsarFile, product);
+ return new Command(cmd);
+ }
+
+ public Command createForPnf(String req, String pathToCsarFile, String product) throws OnapCommandException {
+ OnapCommand cmd = createCommand(req, pathToCsarFile, product);
+ markCommandAsPnf(cmd);
+ return new Command(cmd);
+ }
+
+ private OnapCommand createCommand(String req, String pathToCsarFile, String product) throws OnapCommandException {
+ String command = createCommandFor(req);
+ OnapCommand cmd = OnapCommandRegistrar.getRegistrar().get(command, product);
+ setPathToCsar(pathToCsarFile, cmd);
+ return cmd;
+ }
+
+ private String createCommandFor(String req) {
+ return COMMAND_PREFIX + req;
+ }
+
+ private void setPathToCsar(String pathToCsarFile, OnapCommand cmd) throws OnapCommandInvalidParameterValue {
+ cmd.getParametersMap().get(CSAR_PARAM_NAME).setValue(pathToCsarFile);
+ }
+
+ private void markCommandAsPnf(OnapCommand cmd) throws OnapCommandInvalidParameterValue {
+ final OnapCommandParameter pnf = cmd.getParametersMap().get(PNF_ATTRIBUTE_NAME);
+ pnf.setValue(true);
+ }
+}
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r02454.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r02454.yaml
index dc3d18b..5606d67 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r02454.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r02454.yaml
@@ -22,10 +22,12 @@ description: |
and backward compatibility to be transparent to the Service Provider usage.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: casablanca
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r09467.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r09467.yaml
index 71aa8f0..50c6771 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r09467.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r09467.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r09467
description: The VNF MUST utilize only NCSP standard compute flavors. [5] - compute, virtual storage.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r15837.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r15837.yaml
index 8e7cd11..1853e92 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r15837.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r15837.yaml
@@ -20,10 +20,12 @@ description: |
Major TOSCA Types specified in ETSI NFV-SOL001 standard draft.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r17852.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r17852.yaml
index 7e1f4b9..7ebe770 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r17852.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r17852.yaml
@@ -21,10 +21,12 @@ description: |
these definitions MUST comply with TOSCA Simple Profile in YAML v.1.2.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r32155.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r32155.yaml
index b2e8dc9..15e12b7 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r32155.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r32155.yaml
@@ -21,10 +21,12 @@ description: |
An on-boarding entity (ONAP SDC) MUST support them..
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35851.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35851.yaml
index 127dc75..4bed68b 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35851.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35851.yaml
@@ -22,10 +22,12 @@ description: |
latency, jitter, QoS (if applicable) for each interface.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: casablanca
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35854.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35854.yaml
index ebdc83c..dce36ad 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35854.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r35854.yaml
@@ -21,10 +21,12 @@ description: |
for VNF/PNF descriptor specified in ETSI NFV-SOL001.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r46527.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r46527.yaml
index 72c8967..7a2e25d 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r46527.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r46527.yaml
@@ -22,10 +22,12 @@ description: |
and interfaces requirements and MUST comply with info elements specified in ETSI GS NFV-IFA 011.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r54356.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r54356.yaml
index 9d19257..26d365d 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r54356.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r54356.yaml
@@ -21,10 +21,12 @@ description: |
The node data definitions/attributes used in VNFD MUST comply.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r65486.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r65486.yaml
index 082da04..2f00535 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r65486.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r65486.yaml
@@ -21,10 +21,12 @@ description: |
maintaining the gaps with the requirements specified in ETSI GS NFV-IFA011 standard.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r67895.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r67895.yaml
index 280dc68..36e6599 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r67895.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r67895.yaml
@@ -21,10 +21,12 @@ description: |
An on-boarding entity (ONAP SDC) MUST support them.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r95321.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r95321.yaml
index 60fe9ed..486f286 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r95321.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol001/vtp-validate-csar-r95321.yaml
@@ -21,10 +21,12 @@ description: |
An on-boarding entity (ONAP SDC) MUST support them.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r01123.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r01123.yaml
index 577b2ca..7ba4d36 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r01123.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r01123.yaml
@@ -26,10 +26,12 @@ description: |
description, provider and version.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r04298.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r04298.yaml
index 889eb2f..0c170fe 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r04298.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r04298.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r04298
description: VNF provider MUST provider their testing scripts to support testing
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: casablanca
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r07879.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r07879.yaml
index 9c53315..dbba3c0 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r07879.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r07879.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r07879
description: The VNF Package MUST include all relevant playbooks to ONAP to be loaded on the Ansible Server.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r10087.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r10087.yaml
index ea8cd8d..d9911b8 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r10087.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r10087.yaml
@@ -22,10 +22,12 @@ description: |
CSAR Manifest file as per SOL004 - for example ROOT\ MainServiceTemplate.mf
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r130206.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r130206.yaml
index ff349bc..5f02207 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r130206.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r130206.yaml
@@ -20,10 +20,12 @@ description: |
The VNF/PNF package shall contain a Digest (a.k.a. hash) for each of the components of the VNF package. The table of hashes is included in the manifest file, which is signed with the VNF provider private key. In addition, the VNF provider shall include a signing certificate that includes the VNF provider public key, following a pre-defined naming convention and located either at the root of the archive or in a predefined location (e.g. directory).
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: validation
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: guilin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r13390.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r13390.yaml
index b157456..c7dccf4 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r13390.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r13390.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r13390
description: The VNF provider MUST provide cookbooks to be loaded on the appropriate Chef Server.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r146092.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r146092.yaml
index 0f4201e..df53e7c 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r146092.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r146092.yaml
@@ -27,10 +27,12 @@ description: |
-onap_yang_modules
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r21322.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r21322.yaml
index 08251ef..0d48065 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r21322.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r21322.yaml
@@ -21,10 +21,12 @@ description: |
Testing directory in CSAR.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r23823.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r23823.yaml
index e061889..f877072 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r23823.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r23823.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r23823
description: The VNF Package MUST include appropriate credentials so that ONAP can interact with the Chef Server
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26881.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26881.yaml
index 5836de2..7900ea1 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26881.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26881.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r26881
description: The VNF provider MUST provide the binaries and images needed to instantiate the VNF (VNF and VNFC images).
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26885.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26885.yaml
index 44f4f04..b3a1fe2 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26885.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r26885.yaml
@@ -23,10 +23,12 @@ description: |
Note: Currently, ONAP doesn’t have the capability of Image management, we upload the image into VIM/VNFM manually.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r27310.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r27310.yaml
index 29e1fc9..3d8afa4 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r27310.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r27310.yaml
@@ -21,10 +21,12 @@ description: |
required to execute VNF actions requested by ONAP for loading on appropriate Chef Server.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r293901.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r293901.yaml
index eee8c36..99ed88d 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r293901.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r293901.yaml
@@ -25,10 +25,12 @@ description: |
-ETSI-Entry-Change-Log
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40293.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40293.yaml
index 7173dc2..924c425 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40293.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40293.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r40293
description: The VNF MUST make available (or load on VNF Ansible Server) playbooks that conform to the ONAP requirement.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40820.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40820.yaml
index 45808ad..33991c3 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40820.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r40820.yaml
@@ -21,10 +21,12 @@ description: |
directory as per ETSI SOL004. for example ROOT\Licenses\ License_term.txt
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r43958.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r43958.yaml
index 084644a..99c5a1f 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r43958.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r43958.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r43958
description: The VNF Package MUST include documentation describing the tests that were conducted by the VNF provider and the test results.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r51347.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r51347.yaml
index 7ed4222..5036de5 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r51347.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r51347.yaml
@@ -20,13 +20,14 @@ description: |
The VNF package MUST be arranged as a CSAR archive as specified in TOSCA Simple Profile in YAML 1.2.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
metadata:
keyword: MUST
introduced: casablanca
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r57019.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r57019.yaml
index 1ca611a..ec2ab07 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r57019.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r57019.yaml
@@ -26,10 +26,12 @@ description: |
-pnfd_archive_version
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r66070.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r66070.yaml
index d5eaf4f..5b069a0 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r66070.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r66070.yaml
@@ -23,10 +23,12 @@ description: |
VNF provider, and version
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: casablanca
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77707.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77707.yaml
index 42331e3..e6478bd 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77707.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77707.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r77707
description: VNF provider MUST include manifest file that contains a list of all the components in VNF package
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: casablanca
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77786.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77786.yaml
index 2f9c8ae..c296474 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77786.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r77786.yaml
@@ -19,10 +19,12 @@ name: csar-validate-r77786
description: The VNF Package MUST include all relevant cookbooks to be loaded on the ONAP Chef Server.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: casablanca
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r787965.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r787965.yaml
index db5a1a1..e07434f 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r787965.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r787965.yaml
@@ -20,10 +20,12 @@ description: |
If the VNF or PNF CSAR Package utilizes Option 2 for package security, then the complete CSAR file MUST be digitally signed with the VNF or PNF provider private key. The VNF or PNF provider delivers one zip file consisting of the CSAR file, a signature file and a certificate file that includes the VNF or PNF provider public key. The certificate may also be included in the signature container, if the signature format allows that. The VNF or PNF provider creates a zip file consisting of the CSAR file with .csar extension, signature and certificate files. The signature and certificate files must be siblings of the CSAR file with extensions .cms and .cert respectively.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r816745.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r816745.yaml
index 8ef80dd..14b838a 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r816745.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r816745.yaml
@@ -25,10 +25,12 @@ description: |
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: guilin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r87234.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r87234.yaml
index de78d8b..5d63612 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r87234.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r87234.yaml
@@ -22,10 +22,12 @@ description: |
(ONAP SDC) must support both options.
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: dublin
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r972082.yaml b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r972082.yaml
index 53a6827..84d8a5c 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r972082.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/sol004/vtp-validate-csar-r972082.yaml
@@ -24,10 +24,12 @@ description: |
- pnf_software_version: "<version>"
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
+ metadata:
+ release: frankfurt
parameters:
- name: csar
diff --git a/csarvalidation/src/main/resources/open-cli-schema/vtp-validate-csar.yaml b/csarvalidation/src/main/resources/open-cli-schema/vtp-validate-csar.yaml
index b77dfa2..e6727eb 100644
--- a/csarvalidation/src/main/resources/open-cli-schema/vtp-validate-csar.yaml
+++ b/csarvalidation/src/main/resources/open-cli-schema/vtp-validate-csar.yaml
@@ -19,12 +19,19 @@ name: csar-validate
description: Validate CSAR package formats compliants to ETSI SOL004, SOL001 and VNFREQS
info:
- product: onap-dublin
+ product: onap-vtp
version: 1.0
service: vnf-compliance
author: ONAP VTP Team onap-discuss@lists.onap.org
parameters:
+ - name: release
+ description: Name of release [amsterdam|casablanca|dublin|frankfurt|guilin|honolulu]
+ long_option: release
+ short_option: rel
+ type: binary
+ is_optional: true
+ default_value: "latest"
- name: csar
description: CSAR file path
long_option: csar
diff --git a/csarvalidation/src/main/resources/vnfreqs.properties b/csarvalidation/src/main/resources/vnfreqs.properties
index 2e0baaf..1829629 100644
--- a/csarvalidation/src/main/resources/vnfreqs.properties
+++ b/csarvalidation/src/main/resources/vnfreqs.properties
@@ -3,3 +3,4 @@ pnfreqs.enabled=r01123,r10087,r15837,r17852,r35854,r57019,r87234,r130206,r146092
# ignored all chef and ansible related tests
vnferrors.ignored=0x1005,0x1006,r07879-0x1000,r13390-0x1000,r27310-0x1000,r40293-0x1000,r77786-0x1000,r04298-0x1000,r07879-0x1000,r10087-0x1000,r13390-0x1000,r23823-0x1000,r26881-0x1000,r40820-0x1000,r35851-0x1000,r32155-0x1000,r54356-0x1000,r67895-0x1000,r95321-0x1000,r46527-0x1000,r02454-0x1000
pnferrors.ignored=0x1006,r130206-0x1006
+releases.order=amsterdam,casablanca,dublin,frankfurt,guilin,honolulu