summaryrefslogtreecommitdiffstats
path: root/nokiav2
diff options
context:
space:
mode:
authorDenes Nemeth <denes.nemeth@nokia.com>2018-05-31 13:59:34 +0200
committerDenes Nemeth <denes.nemeth@nokia.com>2018-05-31 14:37:56 +0200
commitd4ee0c786ca2cc27b35fdfaa7d9d53718fa0bd20 (patch)
tree02436311987bda3c499e923a2f75a02c3aaa7d03 /nokiav2
parentce16741b481dbaae3a3447f84efb2b4ce5dffc82 (diff)
Fix template generation for R2
Change-Id: Ibf53ee4f203f248c930611812f3eb248e3023be8 Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com> Issue-ID: VFC-728
Diffstat (limited to 'nokiav2')
-rw-r--r--nokiav2/docs/onboarding.rst2
-rw-r--r--nokiav2/docs/sampleVnfs/simple/cbam.instantiation.request.json60
-rw-r--r--nokiav2/docs/sampleVnfs/simple/simple.v1.csarbin11484 -> 7668 bytes
-rw-r--r--nokiav2/docs/sampleVnfs/simple/simple.v2.csarbin0 -> 7787 bytes
-rw-r--r--nokiav2/docs/sampleVnfs/simpleDual/cbam.instantiation.request.json60
-rw-r--r--nokiav2/docs/sampleVnfs/simpleDual/cbam.package.zipbin0 -> 7488 bytes
-rw-r--r--nokiav2/docs/sampleVnfs/simpleDual/etsi_config.json39
-rw-r--r--nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v1.csarbin0 -> 8334 bytes
-rw-r--r--nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v2.csarbin0 -> 8516 bytes
-rw-r--r--nokiav2/docs/sampleVnfs/simpleDual/simpleDual.csarbin12325 -> 0 bytes
-rw-r--r--nokiav2/docs/sampleVnfs/simple_cmcc/simple.v1.csarbin11484 -> 7668 bytes
-rw-r--r--nokiav2/docs/sampleVnfs/simple_cmcc/simple.v2.csarbin7773 -> 7787 bytes
-rw-r--r--nokiav2/docs/samplevnf.rst34
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapAbstractVnfdBuilder.java83
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR1VnfdBuilder.java (renamed from nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java)126
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR2VnfdBuilder.java117
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfPackageBuilder.java (renamed from nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR1VnfPackageBuilder.java)6
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java4
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java1
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/FullUnitTestSuite.java8
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapAbstractVnfdBuilder.java33
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR1VnfdBuilder.java (renamed from nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfdBuilder.java)18
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR2VnfdBuilder.java8
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfPackageBuilder.java53
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java25
-rw-r--r--nokiav2/driver/src/test/resources/application-direct.properties4
-rw-r--r--nokiav2/driver/src/test/resources/application.properties4
-rw-r--r--nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zipbin1288 -> 1333 bytes
-rw-r--r--nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip.vnfd5
-rw-r--r--nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.cbam.yaml1
-rw-r--r--nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.v2.yaml1
31 files changed, 306 insertions, 386 deletions
diff --git a/nokiav2/docs/onboarding.rst b/nokiav2/docs/onboarding.rst
index 80aff0b2..4613777d 100644
--- a/nokiav2/docs/onboarding.rst
+++ b/nokiav2/docs/onboarding.rst
@@ -181,6 +181,8 @@ The following section requires the CSAR and the ETSI configuration of the VNF to
- Select the ETSI configuration file using Browse
+ - the name of the file on the local file system must be etsi_config.json
+
- Click on Done
- Click on Check in
diff --git a/nokiav2/docs/sampleVnfs/simple/cbam.instantiation.request.json b/nokiav2/docs/sampleVnfs/simple/cbam.instantiation.request.json
deleted file mode 100644
index a85ca0ae..00000000
--- a/nokiav2/docs/sampleVnfs/simple/cbam.instantiation.request.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "apiVersion":"3.1",
- "computeResourceFlavours": [
- {
- "vnfdVirtualComputeDescId": "server_compute",
- "resourceId": "m1.small"
- }
- ],
- "extVirtualLinks": [
- {
- "extCps": [
- {
- "cpdId": "commisioning_ecp"
- }
- ],
- "resourceId": "pub_net"
- },
- {
- "extCps": [
- {
- "cpdId": "vnftovnf_ecp"
- }
- ],
- "resourceId": "preservedNetwork"
- }
- ],
- "zones": [
- {
- "resourceId": "compute-a",
- "id": "zoneInfoId"
- }
- ],
- "flavourId": "scalable",
- "grantlessMode": true,
- "softwareImages": [
- {
- "resourceId": "ubuntu.16.04",
- "vnfdSoftwareImageId": "server_image"
- }
- ],
- "vims": [
- {
- "accessInfo": {
- "username": "<username>",
- "tenant": "<tenantName>",
- "password": "<password>",
- "region": "RegionOne"
- },
- "interfaceInfo": {
- "endpoint": "https://<keyStoneIp>:5000/v2.0/",
- "trustedCertificates": [],
- "skipCertificateVerification": true,
- "skipCertificateHostnameCheck": true
- },
- "vimInfoType": "OPENSTACK_V2_INFO",
- "id": "vim_id"
- }
- ],
- "instantiationLevelId": "default"
-}
diff --git a/nokiav2/docs/sampleVnfs/simple/simple.v1.csar b/nokiav2/docs/sampleVnfs/simple/simple.v1.csar
index bdea8ad8..3f66c11f 100644
--- a/nokiav2/docs/sampleVnfs/simple/simple.v1.csar
+++ b/nokiav2/docs/sampleVnfs/simple/simple.v1.csar
Binary files differ
diff --git a/nokiav2/docs/sampleVnfs/simple/simple.v2.csar b/nokiav2/docs/sampleVnfs/simple/simple.v2.csar
new file mode 100644
index 00000000..a7466259
--- /dev/null
+++ b/nokiav2/docs/sampleVnfs/simple/simple.v2.csar
Binary files differ
diff --git a/nokiav2/docs/sampleVnfs/simpleDual/cbam.instantiation.request.json b/nokiav2/docs/sampleVnfs/simpleDual/cbam.instantiation.request.json
deleted file mode 100644
index 16fc4d14..00000000
--- a/nokiav2/docs/sampleVnfs/simpleDual/cbam.instantiation.request.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "apiVersion":"3.1",
- "computeResourceFlavours": [
- {
- "vnfdVirtualComputeDescId": "server_compute",
- "resourceId": "m1.small"
- }
- ],
- "extVirtualLinks": [
- {
- "extCps": [
- {
- "cpdId": "commisioning_ecp"
- }
- ],
- "resourceId": "pub_net"
- },
- {
- "extCps": [
- {
- "cpdId": "vnftovnf_ecp"
- }
- ],
- "resourceId": "preservedNetwork"
- }
- ],
- "zones": [
- {
- "resourceId": "compute-a",
- "id": "zoneInfoId"
- }
- ],
- "flavourId": "scalable",
- "grantlessMode": true,
- "softwareImages": [
- {
- "resourceId": "ubuntu.16.04",
- "vnfdSoftwareImageId": "server_image"
- }
- ],
- "vims": [
- {
- "accessInfo": {
- "username": "<username>",
- "tenant": "<tenantName>",
- "password": "<password>",
- "region": "RegionOne"
- },
- "interfaceInfo": {
- "endpoint": "https://<keyStoneIp>:5000/v2.0/",
- "trustedCertificates": [],
- "skipCertificateVerification": true,
- "skipCertificateHostnameCheck": true
- },
- "vimInfoType": "OPENSTACK_V2_INFO",
- "id": "vim_id"
- }
- ],
- "instantiationLevelId": "default"
-}
diff --git a/nokiav2/docs/sampleVnfs/simpleDual/cbam.package.zip b/nokiav2/docs/sampleVnfs/simpleDual/cbam.package.zip
new file mode 100644
index 00000000..48841624
--- /dev/null
+++ b/nokiav2/docs/sampleVnfs/simpleDual/cbam.package.zip
Binary files differ
diff --git a/nokiav2/docs/sampleVnfs/simpleDual/etsi_config.json b/nokiav2/docs/sampleVnfs/simpleDual/etsi_config.json
new file mode 100644
index 00000000..a0cff014
--- /dev/null
+++ b/nokiav2/docs/sampleVnfs/simpleDual/etsi_config.json
@@ -0,0 +1,39 @@
+{
+ "extensions": [
+ {
+ "name": "myNameKey",
+ "value": "myName"
+ }
+ ],
+ "computeResourceFlavours": [
+ {
+ "vnfdVirtualComputeDescId": "server_compute",
+ "resourceId": "m1.small"
+ }
+ ],
+ "extVirtualLinks": [
+ {
+ "extCps": [
+ {
+ "cpdId": "universal_ecp"
+ }
+ ],
+ "resourceId": "pub_net"
+ }
+ ],
+ "zones": [
+ {
+ "resourceId": "compute-a",
+ "id": "zoneInfoId"
+ }
+ ],
+ "flavourId": "scalable",
+ "vimType": "OPENSTACK_V3_INFO",
+ "instantiationLevel": "default",
+ "softwareImages": [
+ {
+ "resourceId": "ubuntu.16.04",
+ "vnfdSoftwareImageId": "server_image"
+ }
+ ]
+} \ No newline at end of file
diff --git a/nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v1.csar b/nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v1.csar
new file mode 100644
index 00000000..6f2aeec6
--- /dev/null
+++ b/nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v1.csar
Binary files differ
diff --git a/nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v2.csar b/nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v2.csar
new file mode 100644
index 00000000..89c448b7
--- /dev/null
+++ b/nokiav2/docs/sampleVnfs/simpleDual/simple.dual.v2.csar
Binary files differ
diff --git a/nokiav2/docs/sampleVnfs/simpleDual/simpleDual.csar b/nokiav2/docs/sampleVnfs/simpleDual/simpleDual.csar
deleted file mode 100644
index 3a43b788..00000000
--- a/nokiav2/docs/sampleVnfs/simpleDual/simpleDual.csar
+++ /dev/null
Binary files differ
diff --git a/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v1.csar b/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v1.csar
index bdea8ad8..eb52ccb3 100644
--- a/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v1.csar
+++ b/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v1.csar
Binary files differ
diff --git a/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v2.csar b/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v2.csar
index dbb6cdad..e142609d 100644
--- a/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v2.csar
+++ b/nokiav2/docs/sampleVnfs/simple_cmcc/simple.v2.csar
Binary files differ
diff --git a/nokiav2/docs/samplevnf.rst b/nokiav2/docs/samplevnf.rst
index dd6efdbe..3228786d 100644
--- a/nokiav2/docs/samplevnf.rst
+++ b/nokiav2/docs/samplevnf.rst
@@ -4,7 +4,13 @@ Sample VNFs
Simple
------
-- CSAR: :download:`csar <sampleVnfs/simple/simple.csar>`
+- CSAR R1: :download:`csar <sampleVnfs/simple/simple.v1.csar>`
+
+- CSAR R2: :download:`csar <sampleVnfs/simple/simple.v2.csar>`
+
+- Original CBAM package: :download:`csar <sampleVnfs/simple_cmcc/cbam.package.zip>`
+
+- ETSI configuration: :download:`csar <sampleVnfs/simple/etsi_config.json>`
- NS creation request on VF-C API :download:`create.json <sampleVnfs/simple/vfc.ns.create.request.json>` (several fields must be changed to fit actual environment)
@@ -23,7 +29,11 @@ Simple CMCC
The Simple VNF altered to suite the CMCC lab environment (no support for floating IPs)
-- CSAR: :download:`csar <sampleVnfs/simple_cmcc/simple.csar>`
+- CSAR R1: :download:`csar <sampleVnfs/simple_cmcc/simple.v1.csar>`
+
+- CSAR R2: :download:`csar <sampleVnfs/simple_cmcc/simple.v2.csar>`
+
+- Original CBAM package: :download:`csar <sampleVnfs/simple_cmcc/cbam.package.zip>`
- ETSI configuration: :download:`csar <sampleVnfs/simple_cmcc/etsi_config.json>`
@@ -43,18 +53,22 @@ The Simple VNF altered to suite the CMCC lab environment (no support for floatin
Simple Dual
-----------
-- CSAR: :download:`csar <sampleVnfs/simpleDual/simpleDual.csar>`
+- CSAR R1: :download:`csar <sampleVnfs/simpleDual/simpleDual.v1.csar>`
-- NS creation request on VF-C API :download:`create.json <sampleVnfs/simpleDual/vfc.ns.create.request.json>` (several fields must be changed to fit actual environment)
+- CSAR R2: :download:`csar <sampleVnfs/simpleDual/simpleDual.v2.csar>`
-- NS instantiation request on VF-C API :download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.json>` (several fields must be changed to fit actual environment)
+- Original CBAM package: :download:`csar <sampleVnfs/simpleDual/cbam.package.zip>`
-- NS heal request on VF-C API: :download:`heal.json <sampleVnfs/simpleDual/vfc.ns.heal.request.json>` (several fields must be changed to fit actual environment)
+- ETSI configuration: :download:`csar <sampleVnfs/simple_cmcc/etsi_config.json>`
+
+- NS creation request on VF-C API :download:`create.json <sampleVnfs/simpleDual/vfc.ns.create.request.json>` (several fields must be changed to fit actual environment)
+
+- NS instantiation request on VF-C API :download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.direct.json>` (several fields must be changed to fit actual environment)
-- VNF scale request on VF-C API: :download:`scale.json <sampleVnfs/simpleDual/vfc.vnf.scale.request.json>` (several fields must be changed to fit actual environment)
+- NS instantiation request on VF-C API when ETSI config is not supplied: download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.json>` (several fields must be changed to fit actual environment)
+- E2E scaling data: :download:`instantiate.json <sampleVnfs/simpleDual/vfc.ns.instantiation.request.direct.json>` (several fields must be changed to fit actual environment)
-VOLTE IMS
----------
+- NS heal request on VF-C API: :download:`heal.json <sampleVnfs/simpleDual/vfc.ns.heal.request.json>` (several fields must be changed to fit actual environment)
-- TODO \ No newline at end of file
+- VNF scale request on VF-C API: :download:`scale.json <sampleVnfs/simpleDual/vfc.vnf.scale.request.json>` (several fields must be changed to fit actual environment) \ No newline at end of file
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapAbstractVnfdBuilder.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapAbstractVnfdBuilder.java
index f7f247a0..5e9be7f6 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapAbstractVnfdBuilder.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapAbstractVnfdBuilder.java
@@ -21,6 +21,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
+import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
@@ -33,9 +34,9 @@ import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.childElem
import static org.slf4j.LoggerFactory.getLogger;
/**
- * Transforms a CBAM package into an ONAP package
+ * Generic non ONAP version dependent package conversion
*/
-public class OnapAbstractVnfdBuilder {
+abstract class OnapAbstractVnfdBuilder {
public static final String DESCRIPTION = "description";
public static final String PROPERTIES = "properties";
public static final String REQUIREMENTS = "requirements";
@@ -63,7 +64,7 @@ public class OnapAbstractVnfdBuilder {
return null;
}
- private JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
+ protected JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
for (Map.Entry<String, JsonElement> node : nodes) {
if (name.equals(node.getKey())) {
return node.getValue();
@@ -71,4 +72,80 @@ public class OnapAbstractVnfdBuilder {
}
throw new NoSuchElementException("The VNFD does not have a node called " + name + " but required by an other node");
}
+
+ protected String buildEcp(String name, JsonElement ecp, Set<Map.Entry<String, JsonElement>> nodes) {
+ if (ecp.getAsJsonObject().has(REQUIREMENTS)) {
+ String icpName = getRequirement(ecp.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "internal_connection_point");
+ if (icpName != null) {
+ return buildEcpInternal(name, icpName, nodes);
+ } else {
+ logger.warn("The {} ecp does not have an internal connection point", name);
+ }
+ } else {
+ logger.warn("The {} ecp does not have an requirements section", name);
+ }
+ return "";
+ }
+
+ private String buildEcpInternal(String ecpName, String icpName, Set<Map.Entry<String, JsonElement>> nodes) {
+ JsonObject icpNode = get(icpName, nodes).getAsJsonObject();
+ if (icpNode.has(REQUIREMENTS)) {
+ String vdu = getRequirement(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "virtual_binding");
+ //internal connection point is bound to VDU
+ if (vdu != null) {
+ return buildVduCpd(ecpName, vdu, child(icpNode, PROPERTIES));
+ } else {
+ logger.warn("The {} internal connection point of the {} ecp does not have a VDU", icpName, ecpName);
+ }
+ } else {
+ logger.warn("The {} internal connection point of the {} ecp does not have a requirements section", icpName, ecpName);
+ }
+ return "";
+ }
+
+ /**
+ * @param cbamVnfd the CBAM VNFD
+ * @return the converted ONAP VNFD
+ */
+ public String toOnapVnfd(String cbamVnfd) {
+ JsonObject root = new Gson().toJsonTree(new Yaml().load(cbamVnfd)).getAsJsonObject();
+ JsonObject topologyTemplate = child(root, "topology_template");
+ JsonObject substitution_mappings = child(topologyTemplate, "substitution_mappings");
+ Map<String, JsonElement> virtualLinks = new HashMap<>();
+ if (topologyTemplate.has("node_templates")) {
+ Set<Map.Entry<String, JsonElement>> nodeTemplates = child(topologyTemplate, "node_templates").entrySet();
+ StringBuilder body = new StringBuilder();
+ for (Map.Entry<String, JsonElement> node : nodeTemplates) {
+ String type = childElement(node.getValue().getAsJsonObject(), "type").getAsString();
+ if ("tosca.nodes.nfv.VDU".equals(type)) {
+ body.append(buildVdu(node.getKey(), substitution_mappings, node.getValue().getAsJsonObject(), nodeTemplates));
+ } else if ("tosca.nodes.nfv.VirtualStorage".equals(type)) {
+ body.append(buildVolume(node.getKey(), node.getValue().getAsJsonObject()));
+ } else if ("tosca.nodes.nfv.VL".equals(type)) {
+ virtualLinks.put(node.getKey(), node.getValue());
+ body.append(buildVl(node.getValue().getAsJsonObject().get(PROPERTIES).getAsJsonObject(), node.getKey()));
+ } else if ("tosca.nodes.nfv.ICP".equals(type)) {
+ body.append(buildIcp(node.getKey(), node.getValue().getAsJsonObject()));
+ } else if ("tosca.nodes.nfv.ECP".equals(type)) {
+ body.append(buildEcp(node.getKey(), node.getValue(), nodeTemplates));
+ } else {
+ logger.warn("The {} type is not converted", type);
+ }
+ }
+ return buildHeader(topologyTemplate, virtualLinks) + body.toString();
+ }
+ return buildHeader(topologyTemplate, virtualLinks);
+ }
+
+ abstract protected String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks);
+
+ abstract protected String buildVduCpd(String name, String vdu, JsonObject properties);
+
+ abstract protected String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes);
+
+ abstract protected String buildIcp(String name, JsonObject icp);
+
+ abstract protected String buildVolume(String nodeName, JsonObject volume);
+
+ abstract protected String buildVl(JsonObject vlProperties, String name);
}
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR1VnfdBuilder.java
index b5dd9616..4e0fbb0b 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR1VnfdBuilder.java
@@ -16,90 +16,33 @@
package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.Map;
-import java.util.NoSuchElementException;
import java.util.Set;
-import java.util.regex.Pattern;
import org.slf4j.Logger;
-import org.yaml.snakeyaml.Yaml;
import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.child;
import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.childElement;
+import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.LifecycleManager.ETSI_CONFIG;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Transforms a CBAM package into an ONAP package
*/
-public class OnapVnfdBuilder {
- public static final String DESCRIPTION = "description";
- public static final String PROPERTIES = "properties";
- public static final String REQUIREMENTS = "requirements";
- private static Logger logger = getLogger(OnapVnfdBuilder.class);
-
- @VisibleForTesting
- static String indent(String content, int prefixSize) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < prefixSize; i++) {
- sb.append(" ");
- }
- Pattern pattern = Pattern.compile("^(.*)$", Pattern.MULTILINE);
- return pattern.matcher(content).replaceAll(sb.toString() + "$1");
- }
+public class OnapR1VnfdBuilder extends OnapAbstractVnfdBuilder {
+ private static Logger logger = getLogger(OnapR1VnfdBuilder.class);
private static String trimUnit(String data) {
- //FIXME the unit should not be trimmed VF-C bug
+ //The R1 templates in Amsterdam release can not handle the scalar-unit types in Tosca
+ //templates, so that the MB, GB, ... units need to be removed even though the created
+ //Tosca template will be invalid
return data.trim().replaceAll("[^0-9]", "");
}
- public static String getRequirement(JsonArray requirements, String key) {
- for (int i = 0; i < requirements.size(); i++) {
- JsonElement requirement = requirements.get(i);
- Map.Entry<String, JsonElement> next = requirement.getAsJsonObject().entrySet().iterator().next();
- String s = next.getKey();
- if (key.equals(s)) {
- return next.getValue().getAsString();
- }
- }
- return null;
- }
-
- /**
- * @param cbamVnfd the CBAM VNFD
- * @return the converted ONAP VNFD
- */
- public String toOnapVnfd(String cbamVnfd) {
- JsonObject root = new Gson().toJsonTree(new Yaml().load(cbamVnfd)).getAsJsonObject();
- JsonObject topologyTemplate = child(root, "topology_template");
- if (topologyTemplate.has("node_templates")) {
- Set<Map.Entry<String, JsonElement>> nodeTemplates = child(topologyTemplate, "node_templates").entrySet();
- StringBuilder body = new StringBuilder();
- for (Map.Entry<String, JsonElement> node : nodeTemplates) {
- String type = childElement(node.getValue().getAsJsonObject(), "type").getAsString();
- if ("tosca.nodes.nfv.VDU".equals(type)) {
- body.append(buildVdu(node.getKey(), node.getValue().getAsJsonObject(), nodeTemplates));
- } else if ("tosca.nodes.nfv.VirtualStorage".equals(type)) {
- body.append(buildVolume(node.getKey(), node.getValue().getAsJsonObject()));
- } else if ("tosca.nodes.nfv.VL".equals(type)) {
- body.append(buildVl(node.getKey()));
- } else if ("tosca.nodes.nfv.ICP".equals(type)) {
- body.append(buildIcp(node.getKey(), node.getValue().getAsJsonObject()));
- } else if ("tosca.nodes.nfv.ECP".equals(type)) {
- body.append(buildEcp(node.getKey(), node.getValue(), nodeTemplates));
- } else {
- logger.warn("The {} type is not converted", type);
- }
- }
- return buildHeader(topologyTemplate) + body.toString();
- }
- return buildHeader(topologyTemplate);
- }
-
- private String buildHeader(JsonObject toplogyTemplate) {
+ @Override
+ protected String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks) {
JsonObject properties = child(child(toplogyTemplate, "substitution_mappings"), PROPERTIES);
String descriptorVersion = properties.get("descriptor_version").getAsString();
return "tosca_definitions_version: tosca_simple_yaml_1_0\n" +
@@ -115,22 +58,14 @@ public class OnapVnfdBuilder {
" vnfdVersion: " + descriptorVersion + "\n\n" +
"topology_template:\n" +
" inputs:\n" +
- " etsi_config:\n" +
+ " " + ETSI_CONFIG + ":\n" +
" type: string\n" +
" description: The ETSI configuration\n" +
" node_templates:\n";
}
- private JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
- for (Map.Entry<String, JsonElement> node : nodes) {
- if (name.equals(node.getKey())) {
- return node.getValue();
- }
- }
- throw new NoSuchElementException("The VNFD does not have a node called " + name + " but required by an other node");
- }
-
- private String buildVdu(String name, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
+ @Override
+ protected String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
String memorySize = "";
String cpuCount = "";
StringBuilder body = new StringBuilder();
@@ -167,37 +102,7 @@ public class OnapVnfdBuilder {
return header + body.toString();
}
- private String buildEcp(String name, JsonElement ecp, Set<Map.Entry<String, JsonElement>> nodes) {
- if (ecp.getAsJsonObject().has(REQUIREMENTS)) {
- String icpName = getRequirement(ecp.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "internal_connection_point");
- if (icpName != null) {
- return buildEcpInternal(name, icpName, nodes);
- } else {
- logger.warn("The {} ecp does not have an internal connection point", name);
- }
- } else {
- logger.warn("The {} ecp does not have an requirements section", name);
- }
- return "";
- }
-
- private String buildEcpInternal(String ecpName, String icpName, Set<Map.Entry<String, JsonElement>> nodes) {
- JsonObject icpNode = get(icpName, nodes).getAsJsonObject();
- if (icpNode.has(REQUIREMENTS)) {
- String vdu = getRequirement(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "virtual_binding");
- //internal connection point is bound to VDU
- if (vdu != null) {
- return buildVduCpd(ecpName, vdu, child(icpNode, PROPERTIES));
- } else {
- logger.warn("The {} internal connection point of the {} ecp does not have a VDU", icpName, ecpName);
- }
- } else {
- logger.warn("The {} internal connection point of the {} ecp does not have a requirements section", icpName, ecpName);
- }
- return "";
- }
-
- private String buildIcp(String name, JsonObject icp) {
+ protected String buildIcp(String name, JsonObject icp) {
if (icp.has(REQUIREMENTS)) {
JsonArray requirements = icp.get(REQUIREMENTS).getAsJsonArray();
String vdu = getRequirement(requirements, "virtual_binding");
@@ -224,7 +129,7 @@ public class OnapVnfdBuilder {
return "";
}
- private String buildVduCpd(String name, String vdu, JsonObject properties) {
+ protected String buildVduCpd(String name, String vdu, JsonObject properties) {
return indent(name + ":\n" +
" type: tosca.nodes.nfv.VduCpd\n" +
" " + PROPERTIES + ":\n" +
@@ -236,7 +141,7 @@ public class OnapVnfdBuilder {
" - virtual_binding: " + vdu + "\n", 2);
}
- private String buildVolume(String nodeName, JsonObject volume) {
+ protected String buildVolume(String nodeName, JsonObject volume) {
return indent(nodeName + ":\n" +
" type: tosca.nodes.nfv.VDU.VirtualStorage\n" +
" properties:\n" +
@@ -245,7 +150,8 @@ public class OnapVnfdBuilder {
" size_of_storage: " + trimUnit(childElement(child(volume, PROPERTIES), "size_of_storage").getAsString()) + "\n", 2);
}
- private String buildVl(String name) {
+ @Override
+ protected String buildVl(JsonObject vlProperties, String name) {
return indent(name + ":\n" +
" type: tosca.nodes.nfv.VnfVirtualLinkDesc\n" +
" properties:\n" +
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR2VnfdBuilder.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR2VnfdBuilder.java
index 099f641c..e242284c 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR2VnfdBuilder.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR2VnfdBuilder.java
@@ -16,97 +16,39 @@
package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer;
-import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
-import java.util.HashMap;
import java.util.Map;
-import java.util.NoSuchElementException;
import java.util.Set;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.core.SelfRegistrationManager;
import org.slf4j.Logger;
-import org.yaml.snakeyaml.Yaml;
-import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfdBuilder.getRequirement;
-import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfdBuilder.indent;
import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.child;
import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.childElement;
+import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.LifecycleManager.ETSI_CONFIG;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Transforms a CBAM package into an ONAP package
*/
-public class OnapR2VnfdBuilder {
- public static final String DESCRIPTION = "description";
- public static final String PROPERTIES = "properties";
- public static final String REQUIREMENTS = "requirements";
+public class OnapR2VnfdBuilder extends OnapAbstractVnfdBuilder {
private static Logger logger = getLogger(OnapR2VnfdBuilder.class);
- private static String trimUnit(String data) {
- //FIXME the unit should not be trimmed VF-C bug
- return data;
- //data.trim().replaceAll("[^0-9]", "");
- }
-
- /**
- * @param cbamVnfd the CBAM VNFD
- * @return the converted ONAP VNFD
- */
- public String toOnapVnfd(String cbamVnfd) {
- JsonObject root = new Gson().toJsonTree(new Yaml().load(cbamVnfd)).getAsJsonObject();
- JsonObject topologyTemplate = child(root, "topology_template");
- JsonObject substitution_mappings = child(topologyTemplate, "substitution_mappings");
- Map<String, JsonElement> virtualLinks = new HashMap<>();
- if (topologyTemplate.has("node_templates")) {
- Set<Map.Entry<String, JsonElement>> nodeTemplates = child(topologyTemplate, "node_templates").entrySet();
-
- StringBuilder body = new StringBuilder();
- for (Map.Entry<String, JsonElement> node : nodeTemplates) {
- String type = childElement(node.getValue().getAsJsonObject(), "type").getAsString();
- if ("tosca.nodes.nfv.VDU".equals(type)) {
- body.append(buildVdu(node.getKey(), substitution_mappings, node.getValue().getAsJsonObject(), nodeTemplates));
- } else if ("tosca.nodes.nfv.VirtualStorage".equals(type)) {
- body.append(buildVolume(node.getKey(), node.getValue().getAsJsonObject()));
- } else if ("tosca.nodes.nfv.VL".equals(type)) {
- virtualLinks.put(node.getKey(), node.getValue());
- body.append(buildVl(node.getValue().getAsJsonObject().get(PROPERTIES).getAsJsonObject(), node.getKey()));
- } else if ("tosca.nodes.nfv.ICP".equals(type)) {
- body.append(buildIcp(node.getKey(), node.getValue().getAsJsonObject()));
- } else if ("tosca.nodes.nfv.ECP".equals(type)) {
- body.append(buildEcp(node.getKey(), node.getValue(), nodeTemplates));
- } else {
- logger.warn("The {} type is not converted", type);
- }
- }
- return buildHeader(topologyTemplate, virtualLinks) + body.toString();
- }
- return buildHeader(topologyTemplate, virtualLinks);
- }
-
- private String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks) {
+ protected String buildHeader(JsonObject toplogyTemplate, Map<String, JsonElement> virtualLinks) {
JsonObject substitution_mappings = child(toplogyTemplate, "substitution_mappings");
String vnfContent = buildVnf(substitution_mappings, virtualLinks);
return "tosca_definitions_version: tosca_simple_profile_yaml_1_1\n" +
"\n" +
"topology_template:\n" +
" inputs:\n" +
- " etsi_config:\n" +
+ " " + ETSI_CONFIG + ":\n" +
" type: string\n" +
" description: The ETSI configuration\n" +
" node_templates:\n" + vnfContent;
}
- private JsonElement get(String name, Set<Map.Entry<String, JsonElement>> nodes) {
- for (Map.Entry<String, JsonElement> node : nodes) {
- if (name.equals(node.getKey())) {
- return node.getValue();
- }
- }
- throw new NoSuchElementException("The VNFD does not have a node called " + name + " but required by an other node");
- }
-
- private String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
+ protected String buildVdu(String name, JsonObject vnf, JsonObject vdu, Set<Map.Entry<String, JsonElement>> nodes) {
String memorySize = "";
String cpuCount = "";
StringBuilder body = new StringBuilder();
@@ -118,7 +60,7 @@ public class OnapR2VnfdBuilder {
if ("virtual_compute".equals(s)) {
JsonObject virtualCompute = get(next.getValue().getAsString(), nodes).getAsJsonObject();
cpuCount = childElement(child(child(virtualCompute, PROPERTIES), "virtual_cpu"), "num_virtual_cpu").getAsString();
- memorySize = trimUnit(childElement(child(child(virtualCompute, PROPERTIES), "virtual_memory"), "virtual_mem_size").getAsString());
+ memorySize = childElement(child(child(virtualCompute, PROPERTIES), "virtual_memory"), "virtual_mem_size").getAsString();
} else if ("virtual_storage".equals(s)) {
String item = indent(
"- virtual_storage:\n" +
@@ -144,27 +86,13 @@ public class OnapR2VnfdBuilder {
indent(
"properties:\n" +
" virtual_memory:\n" +
- " virtual_mem_size: " + trimUnit(memorySize) + "\n" +
+ " virtual_mem_size: " + memorySize + "\n" +
" virtual_cpu:\n" +
" num_virtual_cpu: " + cpuCount + "\n", 3) +
" " + REQUIREMENTS + ":\n", 2);
return header + body.toString();
}
- private String buildEcp(String name, JsonElement ecp, Set<Map.Entry<String, JsonElement>> nodes) {
- if (ecp.getAsJsonObject().has(REQUIREMENTS)) {
- String icpName = getRequirement(ecp.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "internal_connection_point");
- if (icpName != null) {
- return buildEcpInternal(name, icpName, nodes);
- } else {
- logger.warn("The {} ecp does not have an internal connection point", name);
- }
- } else {
- logger.warn("The {} ecp does not have an requirements section", name);
- }
- return "";
- }
-
private String buildVnf(JsonObject vnf, Map<String, JsonElement> virtualLinks) {
JsonObject vnfProperties = child(vnf, PROPERTIES);
JsonObject flavourProperties = child(child(child(vnf, "capabilities"), "deployment_flavour"), "properties");
@@ -192,23 +120,7 @@ public class OnapR2VnfdBuilder {
vlContent.toString();
}
- private String buildEcpInternal(String ecpName, String icpName, Set<Map.Entry<String, JsonElement>> nodes) {
- JsonObject icpNode = get(icpName, nodes).getAsJsonObject();
- if (icpNode.has(REQUIREMENTS)) {
- String vdu = getRequirement(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray(), "virtual_binding");
- //internal connection point is bound to VDU
- if (vdu != null) {
- return buildVduCpd(ecpName, vdu, child(icpNode, PROPERTIES));
- } else {
- logger.warn("The {} internal connection point of the {} ecp does not have a VDU", icpName, ecpName);
- }
- } else {
- logger.warn("The {} internal connection point of the {} ecp does not have a requirements section", icpName, ecpName);
- }
- return "";
- }
-
- private String buildIcp(String name, JsonObject icp) {
+ protected String buildIcp(String name, JsonObject icp) {
if (icp.has(REQUIREMENTS)) {
JsonArray requirements = icp.get(REQUIREMENTS).getAsJsonArray();
String vdu = getRequirement(requirements, "virtual_binding");
@@ -237,7 +149,7 @@ public class OnapR2VnfdBuilder {
return "";
}
- private String buildVduCpd(String name, String vdu, JsonObject properties) {
+ protected String buildVduCpd(String name, String vdu, JsonObject properties) {
return indent(name + ":\n" +
" type: tosca.nodes.nfv.VduCp\n" +
" " + PROPERTIES + ":\n" +
@@ -250,21 +162,22 @@ public class OnapR2VnfdBuilder {
" - virtual_binding: " + vdu + "\n", 2);
}
- private String buildVolume(String nodeName, JsonObject volume) {
+ protected String buildVolume(String nodeName, JsonObject volume) {
return indent(nodeName + ":\n" +
" type: tosca.nodes.nfv.Vdu.VirtualStorage\n" +
" properties:\n" +
" type_of_storage: volume\n" +
- " size_of_storage: " + trimUnit(childElement(child(volume, PROPERTIES), "size_of_storage").getAsString()) + "\n", 2);
+ " size_of_storage: " + childElement(child(volume, PROPERTIES), "size_of_storage").getAsString() + "\n", 2);
}
- private String buildVl(JsonObject vlProperties, String name) {
+ protected String buildVl(JsonObject vlProperties, String name) {
+ JsonObject connectivityType = child(vlProperties, "connectivity_type");
return indent(name + ":\n" +
" type: tosca.nodes.nfv.VnfVirtualLink\n" +
" properties:\n" +
" connectivity_type:\n" +
- " layer_protocol: [ " + childElement(child(vlProperties, "connectivity_type"), "layer_protocol").getAsString() + " ]\n" +
- " flow_pattern: " + childElement(child(vlProperties, "connectivity_type"), "flow_pattern").getAsString() + "\n" +
+ " layer_protocol: [ " + childElement(connectivityType, "layer_protocol").getAsString() + " ]\n" +
+ (connectivityType.has("flow_pattern") ? " flow_pattern: " + childElement(connectivityType, "flow_pattern").getAsString() + "\n" : "") +
" vl_profile:\n" +
" max_bit_rate_requirements:\n" +
" root: " + Integer.MAX_VALUE + "\n" + //FIXME GAP IN CBAM TEMPLATE
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR1VnfPackageBuilder.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfPackageBuilder.java
index 6542a032..8de82347 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapR1VnfPackageBuilder.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfPackageBuilder.java
@@ -33,7 +33,7 @@ import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CatalogManager.getV
* Transforms a CBAM package into an ONAP package
*/
-public class OnapR1VnfPackageBuilder {
+public class OnapVnfPackageBuilder {
/**
* Entry point for the command line package transformer
@@ -41,7 +41,7 @@ public class OnapR1VnfPackageBuilder {
* @param args not used (required due to signature)
*/
public static void main(String[] args) throws Exception {
- byte[] covert = new OnapR1VnfPackageBuilder().covert(systemFunctions().in(), SupportedOnapPackageVersions.V1);
+ byte[] covert = new OnapVnfPackageBuilder().covert(systemFunctions().in(), SupportedOnapPackageVersions.V1);
systemFunctions().out().write(covert);
}
@@ -57,7 +57,7 @@ public class OnapR1VnfPackageBuilder {
byte[] cbamVnfdContent = vnfdContent.toByteArray();
String onapVnfd = SupportedOnapPackageVersions.V2 == version ?
new OnapR2VnfdBuilder().toOnapVnfd(new String(cbamVnfdContent, StandardCharsets.UTF_8)) :
- new OnapVnfdBuilder().toOnapVnfd(new String(cbamVnfdContent, StandardCharsets.UTF_8));
+ new OnapR1VnfdBuilder().toOnapVnfd(new String(cbamVnfdContent, StandardCharsets.UTF_8));
byte[] modifiedCbamPackage = new CbamVnfPackageBuilder().toModifiedCbamVnfPackage(cbamVnfPackage, vnfdLocation, new CbamVnfdBuilder().build(new String(cbamVnfdContent)));
return buildNewOnapPackage(modifiedCbamPackage, onapVnfd);
}
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java
index 95438caa..758c8b3f 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java
@@ -22,7 +22,7 @@ import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapR1VnfPackageBuilder;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfPackageBuilder;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.SupportedOnapPackageVersions;
import org.slf4j.Logger;
import org.springframework.stereotype.Controller;
@@ -47,7 +47,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.POST;
@RequestMapping(value = BASE_URL)
public class ConverterApi {
private static Logger logger = getLogger(ConverterApi.class);
- private OnapR1VnfPackageBuilder vnfPackageConverter = new OnapR1VnfPackageBuilder();
+ private OnapVnfPackageBuilder vnfPackageConverter = new OnapVnfPackageBuilder();
/**
* Return the converted ONAP package
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java
index f64ce1e0..7c8e2318 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java
@@ -334,6 +334,7 @@ public class LifecycleManager {
return child(child(operation.getValue().getAsJsonObject(), "inputs"), "additional_parameters").entrySet();
}
}
+
throw buildFatalFailure(logger, "Unable to find operation named " + operationName);
}
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/FullUnitTestSuite.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/FullUnitTestSuite.java
index 69e3482c..b37d95ff 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/FullUnitTestSuite.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/FullUnitTestSuite.java
@@ -28,10 +28,7 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.direct.TestSdcPackageProvi
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.direct.notification.*;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.so.TestSoLifecycleManager;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.vfc.*;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestCbamVnfPackageBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestCbamVnfdBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestOnapVnfPackageBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.TestOnapVnfdBuilder;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.*;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.restapi.*;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring.TestRealConfig;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring.TestServletInitializer;
@@ -70,7 +67,8 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification.TestReportedA
TestVfcNotificationSender.class,
TestCbamVnfdBuilder.class,
- TestOnapVnfdBuilder.class,
+ TestOnapR1VnfdBuilder.class,
+ TestOnapR2VnfdBuilder.class,
TestCbamVnfPackageBuilder.class,
TestOnapVnfPackageBuilder.class,
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapAbstractVnfdBuilder.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapAbstractVnfdBuilder.java
new file mode 100644
index 00000000..0d2c348c
--- /dev/null
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapAbstractVnfdBuilder.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2016-2017, Nokia Corporation
+ *
+ * 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.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer;
+
+import org.junit.Test;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
+
+import static junit.framework.TestCase.assertEquals;
+
+public class TestOnapAbstractVnfdBuilder extends TestBase {
+
+ @Test
+ public void indent() {
+ assertEquals(" x", OnapAbstractVnfdBuilder.indent("x", 2));
+ assertEquals(" x\n", OnapAbstractVnfdBuilder.indent("x\n", 2));
+ assertEquals(" x\n y", OnapAbstractVnfdBuilder.indent("x\ny", 2));
+ assertEquals(" x\n y\n", OnapAbstractVnfdBuilder.indent("x\ny\n", 2));
+ assertEquals(" \n", OnapAbstractVnfdBuilder.indent("\n", 2));
+ }
+}
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfdBuilder.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR1VnfdBuilder.java
index a97ee4f1..8c0e8a46 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfdBuilder.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR1VnfdBuilder.java
@@ -27,22 +27,14 @@ import static org.mockito.Mockito.verify;
import static org.springframework.test.util.ReflectionTestUtils.setField;
-public class TestOnapVnfdBuilder extends TestBase {
- private OnapVnfdBuilder packageTransformer = new OnapVnfdBuilder();
+public class TestOnapR1VnfdBuilder extends TestBase {
+ private OnapR1VnfdBuilder packageTransformer = new OnapR1VnfdBuilder();
@Before
public void init() {
- setField(OnapVnfdBuilder.class, "logger", logger);
- }
-
- @Test
- public void indent() {
- assertEquals(" x", packageTransformer.indent("x", 2));
- assertEquals(" x\n", packageTransformer.indent("x\n", 2));
- assertEquals(" x\n y", packageTransformer.indent("x\ny", 2));
- assertEquals(" x\n y\n", packageTransformer.indent("x\ny\n", 2));
- assertEquals(" \n", packageTransformer.indent("\n", 2));
+ setField(OnapAbstractVnfdBuilder.class, "logger", logger);
+ setField(OnapR1VnfdBuilder.class, "logger", logger);
}
/**
@@ -73,7 +65,7 @@ public class TestOnapVnfdBuilder extends TestBase {
* if a node refers to a non existing node it results in a failure
*/
@Test
- public void testInconsitentVnfd() {
+ public void testInconsistentVnfd() {
try {
packageTransformer.toOnapVnfd(new String(TestUtil.loadFile("unittests/packageconverter/nodes.vnfd.inconsistent.cbam.yaml")));
fail();
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR2VnfdBuilder.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR2VnfdBuilder.java
index 6916d382..a8f6a645 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR2VnfdBuilder.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapR2VnfdBuilder.java
@@ -23,6 +23,7 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.fail;
+import static org.mockito.Mockito.verify;
import static org.springframework.test.util.ReflectionTestUtils.setField;
@@ -32,7 +33,8 @@ public class TestOnapR2VnfdBuilder extends TestBase {
@Before
public void init() {
- setField(OnapVnfdBuilder.class, "logger", logger);
+ setField(OnapAbstractVnfdBuilder.class, "logger", logger);
+ setField(OnapR2VnfdBuilder.class, "logger", logger);
}
@@ -50,14 +52,14 @@ public class TestOnapR2VnfdBuilder extends TestBase {
@Test
public void testNodes() {
assertEquals(new String(TestUtil.loadFile("unittests/packageconverter/nodes.vnfd.onap.v2.yaml")), packageTransformer.toOnapVnfd(new String(TestUtil.loadFile("unittests/packageconverter/nodes.vnfd.cbam.yaml"))));
- /* verify(logger).warn("The {} ecp does not have an internal connection point", "myEcpWithoutIcp");
+ verify(logger).warn("The {} ecp does not have an internal connection point", "myEcpWithoutIcp");
verify(logger).warn("The {} ecp does not have an requirements section", "ecpWithIcpWithOutRequirements");
verify(logger).warn("The {} internal connection point of the {} ecp does not have a VDU", "icpWithoutVdu", "myEcpWithoutIcpWithoutVdu");
verify(logger).warn("The {} internal connection point of the {} ecp does not have a requirements section", "icpWithOutRequiements", "myEcpWithoutIcpWithoutIcpReq");
verify(logger).warn("The {} internal connection point does not have a VDU", "icpWithOutVdu");
verify(logger).warn("The {} internal connection point does not have a requirements section", "icpWithOutRequiements");
verify(logger).warn("The {} internal connection point does not have a VL", "icpWithOutVl");
- verify(logger).warn("The {} type is not converted", "tosca.nodes.nfv.Unknown")*/
+ verify(logger).warn("The {} type is not converted", "tosca.nodes.nfv.Unknown");
}
/**
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfPackageBuilder.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfPackageBuilder.java
index 55949ab0..d2a92556 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfPackageBuilder.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/TestOnapVnfPackageBuilder.java
@@ -46,10 +46,10 @@ public class TestOnapVnfPackageBuilder extends TestBase {
when(systemFunctions.loadFile("MainServiceTemplate.mf")).thenCallRealMethod();
String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
- String expectedOnapVnfd = new OnapVnfdBuilder().toOnapVnfd(cbamVnfd);
+ String expectedOnapVnfd = new OnapR1VnfdBuilder().toOnapVnfd(cbamVnfd);
//when
- OnapR1VnfPackageBuilder.main(null);
+ OnapVnfPackageBuilder.main(null);
//verify
assertFileInZip(bos.toByteArray(), "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
assertFileInZip(bos.toByteArray(), "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
@@ -59,13 +59,60 @@ public class TestOnapVnfPackageBuilder extends TestBase {
assertItenticalZips(expectedModifiedCbamPackage, actualModifiedCbamVnfPackage.toByteArray());
}
+ /**
+ * Test conversion for V1 package
+ */
+ @Test
+ public void testConversionViaV1() throws Exception {
+ when(systemFunctions.loadFile("cbam.pre.collectConnectionPoints.js")).thenCallRealMethod();
+ when(systemFunctions.loadFile("cbam.collectConnectionPoints.js")).thenCallRealMethod();
+ when(systemFunctions.loadFile("cbam.post.collectConnectionPoints.js")).thenCallRealMethod();
+ when(systemFunctions.loadFile("TOSCA.meta")).thenCallRealMethod();
+ when(systemFunctions.loadFile("MainServiceTemplate.mf")).thenCallRealMethod();
+
+ String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
+ String expectedOnapVnfd = new OnapR1VnfdBuilder().toOnapVnfd(cbamVnfd);
+ //when
+ byte[] convertedPackage = new OnapVnfPackageBuilder().covert(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip")), SupportedOnapPackageVersions.V1);
+ //verify
+ assertFileInZip(convertedPackage, "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
+ assertFileInZip(convertedPackage, "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
+ assertFileInZip(convertedPackage, "MainServiceTemplate.mf", TestUtil.loadFile("MainServiceTemplate.mf"));
+ ByteArrayOutputStream actualModifiedCbamVnfPackage = getFileInZip(new ByteArrayInputStream(convertedPackage), "Artifacts/Deployment/OTHER/cbam.package.zip");
+ byte[] expectedModifiedCbamPackage = new CbamVnfPackageBuilder().toModifiedCbamVnfPackage(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip"), "vnfdloc/a.yaml", new CbamVnfdBuilder().build(cbamVnfd));
+ assertItenticalZips(expectedModifiedCbamPackage, actualModifiedCbamVnfPackage.toByteArray());
+ }
+
+ /**
+ * Test conversion for V2 package
+ */
+ @Test
+ public void testConversionViaV2() throws Exception {
+ when(systemFunctions.loadFile("cbam.pre.collectConnectionPoints.js")).thenCallRealMethod();
+ when(systemFunctions.loadFile("cbam.collectConnectionPoints.js")).thenCallRealMethod();
+ when(systemFunctions.loadFile("cbam.post.collectConnectionPoints.js")).thenCallRealMethod();
+ when(systemFunctions.loadFile("TOSCA.meta")).thenCallRealMethod();
+ when(systemFunctions.loadFile("MainServiceTemplate.mf")).thenCallRealMethod();
+
+ String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
+ String expectedOnapVnfd = new OnapR2VnfdBuilder().toOnapVnfd(cbamVnfd);
+ //when
+ byte[] convertedPackage = new OnapVnfPackageBuilder().covert(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip")), SupportedOnapPackageVersions.V2);
+ //verify
+ assertFileInZip(convertedPackage, "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
+ assertFileInZip(convertedPackage, "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
+ assertFileInZip(convertedPackage, "MainServiceTemplate.mf", TestUtil.loadFile("MainServiceTemplate.mf"));
+ ByteArrayOutputStream actualModifiedCbamVnfPackage = getFileInZip(new ByteArrayInputStream(convertedPackage), "Artifacts/Deployment/OTHER/cbam.package.zip");
+ byte[] expectedModifiedCbamPackage = new CbamVnfPackageBuilder().toModifiedCbamVnfPackage(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip"), "vnfdloc/a.yaml", new CbamVnfdBuilder().build(cbamVnfd));
+ assertItenticalZips(expectedModifiedCbamPackage, actualModifiedCbamVnfPackage.toByteArray());
+ }
/**
* Prevents moving the class (customer documentation) must be updated
*/
@Test
public void testPreventMove() {
- assertEquals("b3JnLm9uYXAudmZjLm5mdm8uZHJpdmVyLnZuZm0uc3ZuZm0ubm9raWEucGFja2FnZXRyYW5zZm9ybWVyLk9uYXBSMVZuZlBhY2thZ2VCdWlsZGVy", Base64.getEncoder().encodeToString(OnapR1VnfPackageBuilder.class.getCanonicalName().getBytes()));
+ assertEquals("b3JnLm9uYXAudmZjLm5mdm8uZHJpdmVyLnZuZm0uc3ZuZm0ubm9raWEucGFja2FnZXRyYW5zZm9ybWVyLk9uYXBWbmZQYWNrYWdlQnVpbGRlcg==", Base64.getEncoder().encodeToString(OnapVnfPackageBuilder.class.getCanonicalName().getBytes()));
}
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java
index 48d2cab0..99fd203a 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java
@@ -31,7 +31,7 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.CbamVnfPackageBuilder;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.CbamVnfdBuilder;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapVnfdBuilder;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.packagetransformer.OnapR1VnfdBuilder;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.TestUtil;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
import org.springframework.http.HttpHeaders;
@@ -88,7 +88,7 @@ public class TestConverterApi extends TestBase {
private void verifyVnfPackageWritterToOutputStream(ByteArrayOutputStream bos) throws Exception {
String cbamVnfd = new String(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip.vnfd"));
- String expectedOnapVnfd = new OnapVnfdBuilder().toOnapVnfd(cbamVnfd);
+ String expectedOnapVnfd = new OnapR1VnfdBuilder().toOnapVnfd(cbamVnfd);
assertFileInZip(bos.toByteArray(), "TOSCA-Metadata/TOSCA.meta", TestUtil.loadFile("TOSCA.meta"));
assertFileInZip(bos.toByteArray(), "MainServiceTemplate.yaml", expectedOnapVnfd.getBytes());
assertFileInZip(bos.toByteArray(), "MainServiceTemplate.mf", TestUtil.loadFile("MainServiceTemplate.mf"));
@@ -134,6 +134,27 @@ public class TestConverterApi extends TestBase {
}
/**
+ * error is propagated if unable to extract version from HTTP request
+ */
+ @Test
+ public void testUnableToExtractVersion() throws Exception {
+ IOException expectedException = new IOException();
+ Part part = Mockito.mock(Part.class);
+ when(part.getInputStream()).thenReturn(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip")));
+ when(httpRequest.getPart("fileToUpload")).thenReturn(part);
+ when(httpRequest.getPart("version")).thenThrow(expectedException);
+ when(part.getInputStream()).thenReturn(new ByteArrayInputStream("V1".getBytes()));
+ try {
+ converterApi.convert(httpResponse, httpRequest);
+ fail();
+ } catch (Exception e) {
+ verify(logger).error("Unable to determine the desired ONAP package version", expectedException);
+ assertEquals("Unable to determine the desired ONAP package version", e.getMessage());
+ assertEquals(expectedException, e.getCause());
+ }
+ }
+
+ /**
* error is propagated if unable to extract package from HTTP request
*/
@Test
diff --git a/nokiav2/driver/src/test/resources/application-direct.properties b/nokiav2/driver/src/test/resources/application-direct.properties
index 5702c913..b9c1c68c 100644
--- a/nokiav2/driver/src/test/resources/application-direct.properties
+++ b/nokiav2/driver/src/test/resources/application-direct.properties
@@ -13,9 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
-
server.error.whitelabel.enabled=false
-
###############################################################################
# Beginning of mandatory properties #
###############################################################################
@@ -42,7 +40,6 @@ skipCertificateVerification=true
trustedCertificates=
# the identifier of the VNFM in A&AI core system registry
vnfmId=7c267318-2a6a-4d47-b039-a7cce5fea38b
-
###############################################################################
# Configuration parameters for direct integration
###############################################################################
@@ -61,7 +58,6 @@ aaiPassword=AAI
sdcUsername=SDC
#The password to access SDC
sdcPassword=SDC
-
###############################################################################
# End of mandatory properties for driver #
###############################################################################
diff --git a/nokiav2/driver/src/test/resources/application.properties b/nokiav2/driver/src/test/resources/application.properties
index af64fd95..d2732910 100644
--- a/nokiav2/driver/src/test/resources/application.properties
+++ b/nokiav2/driver/src/test/resources/application.properties
@@ -13,9 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
-
server.error.whitelabel.enabled=false
-
###############################################################################
# Beginning of mandatory properties #
###############################################################################
@@ -42,7 +40,6 @@ skipCertificateVerification=true
trustedCertificates=
# the identifier of the VNFM in A&AI core system registry
vnfmId=53fbba58-464e-4cc4-8d33-aaaf072f0a27
-
###############################################################################
# Configuration parameters for direct integration
###############################################################################
@@ -61,7 +58,6 @@ aaiPassword=AAI
sdcUsername=SDC
#The password to access SDC
sdcPassword=SDC
-
###############################################################################
# End of mandatory properties for driver #
###############################################################################
diff --git a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip
index ac555dff..fe996956 100644
--- a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip
+++ b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip
Binary files differ
diff --git a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip.vnfd b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip.vnfd
index 3c121386..af4a530a 100644
--- a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip.vnfd
+++ b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.package.zip.vnfd
@@ -15,3 +15,8 @@ topology_template:
Basic:
instantiate:
terminate:
+ capabilities:
+ deployment_flavour:
+ properties:
+ flavour_id: myFlavorId
+ description: myFlavorDescription
diff --git a/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.cbam.yaml b/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.cbam.yaml
index 3870605f..c893b930 100644
--- a/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.cbam.yaml
+++ b/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.cbam.yaml
@@ -67,7 +67,6 @@ topology_template:
properties:
connectivity_type:
layer_protocol: ipv4
- flow_pattern: mesh
description: myDescription
icpWithOutEcp:
diff --git a/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.v2.yaml b/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.v2.yaml
index fe0ccf4c..ba1c8fa8 100644
--- a/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.v2.yaml
+++ b/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.v2.yaml
@@ -77,7 +77,6 @@ topology_template:
properties:
connectivity_type:
layer_protocol: [ ipv4 ]
- flow_pattern: mesh
vl_profile:
max_bit_rate_requirements:
root: 2147483647