summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001
diff options
context:
space:
mode:
Diffstat (limited to 'csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001')
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java69
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR15837.java36
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java34
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java36
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java70
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35854.java36
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java35
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java36
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR65486.java36
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java34
-rw-r--r--csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java36
11 files changed, 458 insertions, 0 deletions
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java
new file mode 100644
index 0000000..cbacc35
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR09467.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import java.io.FileInputStream;
+import java.util.Map;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.CSARArchive.CSARErrorEntryMissing;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+import org.yaml.snakeyaml.Yaml;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r09467.yaml")
+public class VTPValidateCSARR09467 extends VTPValidateCSARBase {
+
+ public static class CSARErrorEntryMissingFlavor extends CSARErrorEntryMissing {
+ public CSARErrorEntryMissingFlavor(String defYaml, String entry) {
+ super(entry, defYaml);
+ this.setCode("0x1000");
+ }
+ }
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+ try(FileInputStream ipStream = new FileInputStream(csar.getDefinitionYamlFile())) {
+ Map<String, ?> yaml = (Map<String, ?>) new Yaml().load(ipStream);
+ yaml = (Map<String, ?>) yaml.get("topology_template");
+ Map<String, ?> nodeTmpls = (Map<String,?>) yaml.get("node_templates");
+
+ boolean vlExist = false;
+
+ for (Object nodeO: nodeTmpls.values()) {
+ Map<String, ?> node = (Map<String, ?>) nodeO;
+ if (node.containsKey("type")) {
+ String type = (String)node.get("type");
+ if (type.equalsIgnoreCase("tosca.nodes.nfv.VDU.Compute")) {
+ vlExist = true;
+ break;
+ }
+ }
+ }
+
+ if (!vlExist)
+ this.errors.add(new CSARErrorEntryMissingFlavor(
+ csar.getDefinitionYamlFile().getName(),
+ "Flavor"));
+ }
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R09467";
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR15837.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR15837.java
new file mode 100644
index 0000000..e89bb85
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR15837.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r15837.yaml")
+public class VTPValidateCSARR15837 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R15837";
+ }
+
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java
new file mode 100644
index 0000000..96181fd
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR17852.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r17852.yaml")
+public class VTPValidateCSARR17852 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R17852";
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java
new file mode 100644
index 0000000..fac261a
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR32155.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r32155.yaml")
+public class VTPValidateCSARR32155 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R32155";
+ }
+
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java
new file mode 100644
index 0000000..6c7b3a6
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35851.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import java.io.FileInputStream;
+import java.util.Map;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.CSARArchive.CSARErrorEntryMissing;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+import org.yaml.snakeyaml.Yaml;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r35851.yaml")
+public class VTPValidateCSARR35851 extends VTPValidateCSARBase {
+
+ public static class CSARErrorEntryMissingDefinitionYamlTopology extends CSARErrorEntryMissing {
+ public CSARErrorEntryMissingDefinitionYamlTopology(String defYaml, String entry) {
+ super(entry, defYaml);
+ this.setCode("0x1000");
+ }
+ }
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+ try(FileInputStream ipStream = new FileInputStream(csar.getDefinitionYamlFile())) {
+ Map<String, ?> yaml = (Map<String, ?>) new Yaml().load(ipStream);
+ yaml = (Map<String, ?>) yaml.get("topology_template");
+ Map<String, ?> nodeTmpls = (Map<String,?>) yaml.get("node_templates");
+
+ boolean vlExist = false;
+
+ for (Object nodeO: nodeTmpls.values()) {
+ Map<String, ?> node = (Map<String, ?>) nodeO;
+ if (node.containsKey("type")) {
+ String type = (String)node.get("type");
+ if (type.equalsIgnoreCase("tosca.nodes.nfv.VnfVirtualLink")) {
+ vlExist = true;
+ break;
+ }
+ }
+ }
+
+ if (!vlExist)
+ this.errors.add(new CSARErrorEntryMissingDefinitionYamlTopology(
+ csar.getDefinitionYamlFile().getName(),
+ "Topology VL"));
+ }
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R35851";
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35854.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35854.java
new file mode 100644
index 0000000..1b442cb
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR35854.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r35854.yaml")
+public class VTPValidateCSARR35854 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R35854";
+ }
+
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java
new file mode 100644
index 0000000..bc680a3
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR46527.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r46527.yaml")
+public class VTPValidateCSARR46527 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R46527";
+ }
+
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java
new file mode 100644
index 0000000..02f7b0d
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR54356.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r54356.yaml")
+public class VTPValidateCSARR54356 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R54356";
+ }
+
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR65486.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR65486.java
new file mode 100644
index 0000000..0f4f64d
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR65486.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r65486.yaml")
+public class VTPValidateCSARR65486 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R65486";
+ }
+
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java
new file mode 100644
index 0000000..a45ba5e
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR67895.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r67895.yaml")
+public class VTPValidateCSARR67895 extends VTPValidateCSARBase {
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R67895";
+ }
+}
diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java
new file mode 100644
index 0000000..fd9b2d6
--- /dev/null
+++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol001/VTPValidateCSARR95321.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * 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.cc.sol001;
+
+import org.onap.cli.fw.schema.OnapCommandSchema;
+import org.onap.cvc.csar.CSARArchive;
+import org.onap.cvc.csar.cc.VTPValidateCSARBase;
+
+@OnapCommandSchema(schema = "vtp-validate-csar-r95321.yaml")
+public class VTPValidateCSARR95321 extends VTPValidateCSARBase {
+
+ @Override
+ protected void validateCSAR(CSARArchive csar) throws Exception {
+
+ }
+
+ @Override
+ protected String getVnfReqsNo() {
+ return "R95321";
+ }
+
+}