summaryrefslogtreecommitdiffstats
path: root/nokiav2
diff options
context:
space:
mode:
authorDenes Nemeth <denes.nemeth@nokia.com>2018-04-13 00:46:20 +0200
committerDenes Nemeth <denes.nemeth@nokia.com>2018-04-13 00:49:43 +0200
commitb754227da778e1e835336ae39e304ffc8059a009 (patch)
treeeffc31892c2018b0cef20e41b8481e99707557f9 /nokiav2
parentb6618c139b786a947efd695b7bc484eac3401642 (diff)
Fix backward compatibility issues
Change-Id: I4f79713050074622e5375096baca64ae52594647 Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com> Issue-ID: VFC-728
Diffstat (limited to 'nokiav2')
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcExternalSystemInfoProvider.java4
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java11
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcPackageProvider.java4
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/CbamVnfdBuilder.java2
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java12
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java58
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/AdditionalParameters.java13
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/CatalogManager.java8
-rw-r--r--nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java34
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcExternalSystemInfoProvider.java7
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java13
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java2
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcPackageProvider.java10
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestLcmApi.java13
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java1
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestCbamCatalogManager.java22
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java169
-rw-r--r--nokiav2/driver/src/test/resources/.gitignore2
-rw-r--r--nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.full.modified.vnfd.yaml1
-rw-r--r--nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.minimal.modified.vnfd.yaml1
-rw-r--r--nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.yaml6
-rw-r--r--nokiav2/generatedapis/pom.xml8
-rw-r--r--nokiav2/generatedapis/src/main/resources/vfc.vnfdriver.swagger.json24
23 files changed, 320 insertions, 105 deletions
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcExternalSystemInfoProvider.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcExternalSystemInfoProvider.java
index 83b10872..eb8e1f65 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcExternalSystemInfoProvider.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcExternalSystemInfoProvider.java
@@ -46,7 +46,7 @@ public class VfcExternalSystemInfoProvider extends GenericExternalSystemInfoProv
@Override
public VnfmInfo queryVnfmInfoFromSource(String vnfmId) {
try {
- return vfcRestApiProvider.getNsLcmApi().queryVnfmInfo(vnfmId).execute().body();
+ return vfcRestApiProvider.getNsLcmApi().queryVnfmInfo(vnfmId).blockingFirst();
} catch (Exception e) {
throw buildFatalFailure(logger, "Unable to query VNFM from VF-C with " + vnfmId + " identifier", e);
}
@@ -55,7 +55,7 @@ public class VfcExternalSystemInfoProvider extends GenericExternalSystemInfoProv
@Override
public VimInfo getVimInfo(String vimId) {
try {
- return vfcRestApiProvider.getNsLcmApi().queryVIMInfo(vimId).execute().body();
+ return vfcRestApiProvider.getNsLcmApi().queryVIMInfo(vimId).blockingFirst();
} catch (Exception e) {
throw buildFatalFailure(logger, "Unable to query VIM from VF-C with " + vimId + " identifier", e);
}
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java
index 01b75027..7b985c84 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java
@@ -157,14 +157,17 @@ public class VfcGrantManager implements IGrantManager {
private GrantVNFResponseVim requestGrant(GrantVNFRequest grantRequest) {
try {
- return vfcRestApiProvider.getNsLcmApi().grantvnf(grantRequest).execute().body().getVim();
+ logger.info("Requesting grant with ", grantRequest);
+ GrantVNFResponse grantVNFResponse = vfcRestApiProvider.getNsLcmApi().grantvnf(grantRequest).blockingFirst();
+ logger.info("Successfully received grant {}", grantVNFResponse);
+ return grantVNFResponse.getVim();
} catch (Exception e) {
- throw buildFatalFailure(logger, "Unable to request grant", e);
+ throw buildFatalFailure(logger, "Unable to request grant with " + grantRequest, e);
}
}
- private Set<ResourceChange> calculateResourceChangeDuringInstantiate(String vnfdContent, String instantiationLevelId) {
- JsonObject root = new Gson().toJsonTree(new Yaml().load(vnfdContent)).getAsJsonObject();
+ private Set<ResourceChange> calculateResourceChangeDuringInstantiate(String cbamVnfdContent, String instantiationLevelId) {
+ JsonObject root = new Gson().toJsonTree(new Yaml().load(cbamVnfdContent)).getAsJsonObject();
JsonObject capabilities = child(child(child(root, "topology_template"), "substitution_mappings"), "capabilities");
JsonObject deploymentFlavorProperties = child(child(capabilities, "deployment_flavour"), "properties");
JsonObject instantiationLevels = child(deploymentFlavorProperties, "instantiation_levels");
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcPackageProvider.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcPackageProvider.java
index 9ade5f4a..5831d9b5 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcPackageProvider.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcPackageProvider.java
@@ -62,7 +62,7 @@ public class VfcPackageProvider implements IPackageProvider {
VnfPkgDetailInfo vnfPackageDetails;
try {
VnfpackageApi onapCatalogApi = restApiProvider.getVfcCatalogApi();
- vnfPackageDetails = onapCatalogApi.queryVnfPackage(csarId).execute().body();
+ vnfPackageDetails = onapCatalogApi.queryVnfPackage(csarId).blockingFirst();
} catch (Exception e) {
throw buildFatalFailure(logger, "Unable to query VNF package with " + csarId, e);
}
@@ -75,7 +75,7 @@ public class VfcPackageProvider implements IPackageProvider {
String downloadUrl;
try {
VnfpackageApi onapCatalogApi = restApiProvider.getVfcCatalogApi();
- VnfPkgDetailInfo vnfPackageDetails = onapCatalogApi.queryVnfPackage(csarId).execute().body();
+ VnfPkgDetailInfo vnfPackageDetails = onapCatalogApi.queryVnfPackage(csarId).blockingFirst();
String urlFromVfc = vnfPackageDetails.getPackageInfo().getDownloadUrl();
String host = new URL(urlFromVfc).getHost();
downloadUrl = urlFromVfc.replaceFirst("://" + host, "://" + ipMappingProvider.mapPrivateIpToPublicIp(host));
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/CbamVnfdBuilder.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/CbamVnfdBuilder.java
index 1c1e4c76..ec2ad27c 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/CbamVnfdBuilder.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/CbamVnfdBuilder.java
@@ -37,6 +37,8 @@ public class CbamVnfdBuilder {
JsonObject extensions = addChild(addChild(addChild(addChild(addChild(substitutionMappings, "capabilities"), "vnf"), "properties"), "modifiable_attributes"), "extensions");
JsonObject onapCsarId = addChild(extensions, "onapCsarId");
onapCsarId.add("default", new JsonPrimitive("kuku"));
+ JsonObject externalVnfmId = addChild(extensions, "externalVnfmId");
+ externalVnfmId.add("default", new JsonPrimitive("kuku"));
JsonObject vimId = addChild(extensions, "vimId");
vimId.add("default", new JsonPrimitive("kuku"));
JsonObject interfaces = child(substitutionMappings, "interfaces");
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/OnapVnfdBuilder.java
index dcac5cdf..6a20bc20 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/OnapVnfdBuilder.java
@@ -51,6 +51,11 @@ public class OnapVnfdBuilder {
return pattern.matcher(content).replaceAll(sb.toString() + "$1");
}
+ private static String trimUnit(String data) {
+ //FIXME the unit should not be trimmed VF-C bug
+ return data.trim().replaceAll("[^0-9]", "");
+ }
+
/**
* @param cbamVnfd the CBAM VNFD
* @return the converted ONAP VNFD
@@ -121,8 +126,7 @@ public class OnapVnfdBuilder {
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 = childElement(child(child(virtualCompute, PROPERTIES), "virtual_memory"), "virtual_mem_size").getAsString();
-
+ memorySize = trimUnit(childElement(child(child(virtualCompute, PROPERTIES), "virtual_memory"), "virtual_mem_size").getAsString());
} else if ("virtual_storage".equals(s)) {
String item = indent(
"- virtual_storage:\n" +
@@ -140,7 +144,7 @@ public class OnapVnfdBuilder {
indent(
"properties:\n" +
" virtual_memory:\n" +
- " virtual_mem_size: " + memorySize + "\n" +
+ " virtual_mem_size: " + trimUnit(memorySize) + "\n" +
" virtual_cpu:\n" +
" num_virtual_cpu: " + cpuCount + "\n", 3) +
" " + REQUIREMENTS + ":\n", 2);
@@ -258,7 +262,7 @@ public class OnapVnfdBuilder {
" properties:\n" +
" id: " + nodeName + "\n" +
" type_of_storage: volume\n" +
- " size_of_storage: " + childElement(child(volume, PROPERTIES), "size_of_storage").getAsString() + "\n", 2);
+ " size_of_storage: " + trimUnit(childElement(child(volume, PROPERTIES), "size_of_storage").getAsString()) + "\n", 2);
}
private String buildVl(String name) {
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java
index 92148029..a3be0636 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/LcmApi.java
@@ -64,7 +64,7 @@ public class LcmApi {
@RequestMapping(value = "/{vnfmId}/vnfs", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
@ResponseBody
public VnfInstantiateResponse instantiateVnf(@RequestBody VnfInstantiateRequest request, @PathVariable("vnfmId") String vnfmId, HttpServletResponse httpResponse) {
- logger.info("REST: Instantiate VNF");
+ logger.info("REST: Instantiate VNF with " + request.getVnfPackageId() + " CSAR identifier");
VnfInstantiateResponse response = lifecycleManager.createAndInstantiate(vnfmId, request, httpResponse);
httpResponse.setStatus(SC_CREATED);
return response;
@@ -73,32 +73,32 @@ public class LcmApi {
/**
* Terminate the VNF (defined further in the VF-C driver integration documentation)
*
- * @param request the termination request
- * @param vnfmId the identifier of the VNFM
- * @param vnfInstanceId the identifier of the VNF
- * @param httpResponse the HTTP response
+ * @param request the termination request
+ * @param vnfmId the identifier of the VNFM
+ * @param vnfId the identifier of the VNF
+ * @param httpResponse the HTTP response
* @return the job representing the VNF termination operation
*/
@RequestMapping(value = "/{vnfmId}/vnfs/{vnfId}/terminate", method = POST, produces = APPLICATION_JSON_VALUE)
@ResponseBody
- public JobInfo terminateVnf(@RequestBody VnfTerminateRequest request, @PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfInstanceId, HttpServletResponse httpResponse) {
- logger.info("REST: Terminate VNF");
- return lifecycleManager.terminateAndDelete(vnfmId, vnfInstanceId, request, httpResponse);
+ public JobInfo terminateVnf(@RequestBody VnfTerminateRequest request, @PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfId, HttpServletResponse httpResponse) {
+ logger.info("REST: Terminate VNF with " + vnfId + " identifier");
+ return lifecycleManager.terminateAndDelete(vnfmId, vnfId, request, httpResponse);
}
/**
* Query the VNF (defined further in the VF-C driver integration documentation)
*
- * @param vnfmId the identifier of the VNFM
- * @param vnfInstanceId the identifier of the VNF
- * @param httpResponse the HTTP response
+ * @param vnfmId the identifier of the VNFM
+ * @param vnfId the identifier of the VNF
+ * @param httpResponse the HTTP response
* @return the VNF info
*/
@RequestMapping(value = "/{vnfmId}/vnfs/{vnfId}", method = GET, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
@ResponseBody
- public VnfInfo queryVnf(@PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfInstanceId, HttpServletResponse httpResponse) {
- logger.info("REST: Query VNF");
- return lifecycleManager.queryVnf(vnfmId, vnfInstanceId);
+ public VnfInfo queryVnf(@PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfId, HttpServletResponse httpResponse) {
+ logger.info("REST: Query VNF with " + vnfId + " identifier");
+ return lifecycleManager.queryVnf(vnfmId, vnfId);
}
/**
@@ -112,39 +112,39 @@ public class LcmApi {
@RequestMapping(value = "/{vnfmId}/jobs/{jobId}", method = GET, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public JobDetailInfo getJob(@PathVariable("vnfmId") String vnfmId, @PathVariable("jobId") String jobId, HttpServletResponse httpResponse) {
- logger.debug("REST: Query job");
+ logger.debug("REST: Query job with " + jobId + " identifier");
return jobManager.getJob(vnfmId, jobId);
}
/**
* Scale the VNF (defined further in the VF-C driver integration documentation)
*
- * @param request the scaling request
- * @param vnfmId the identifier of the VNFM
- * @param vnfInstanceId the identifier of the VNF
- * @param httpResponse the HTTP response
+ * @param request the scaling request
+ * @param vnfmId the identifier of the VNFM
+ * @param vnfId the identifier of the VNF
+ * @param httpResponse the HTTP response
* @return the job representing the scaling operation
*/
@RequestMapping(value = "/{vnfmId}/vnfs/{vnfId}/scale", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
@ResponseBody
- public JobInfo scaleVnf(@RequestBody VnfScaleRequest request, @PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfInstanceId, HttpServletResponse httpResponse) {
- logger.info("REST: Scale VNF");
- return lifecycleManager.scaleVnf(vnfmId, vnfInstanceId, request, httpResponse);
+ public JobInfo scaleVnf(@RequestBody VnfScaleRequest request, @PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfId, HttpServletResponse httpResponse) {
+ logger.info("REST: Scale VNF with " + vnfId + " identifier");
+ return lifecycleManager.scaleVnf(vnfmId, vnfId, request, httpResponse);
}
/**
* Heal the VNF (defined further in the VF-C driver integration documentation)
*
- * @param request the healing request
- * @param vnfmId the identifier of the VNFM
- * @param vnfInstanceId the identifier of the VNF
- * @param httpResponse the HTTP response
+ * @param request the healing request
+ * @param vnfmId the identifier of the VNFM
+ * @param vnfId the identifier of the VNF
+ * @param httpResponse the HTTP response
* @return the job representing the healing operation
*/
@RequestMapping(value = "/{vnfmId}/vnfs/{vnfId}/heal", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
@ResponseBody
- public JobInfo healVnf(@RequestBody VnfHealRequest request, @PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfInstanceId, HttpServletResponse httpResponse) {
- logger.info("REST: Heal VNF");
- return lifecycleManager.healVnf(vnfmId, vnfInstanceId, request, empty(), httpResponse);
+ public JobInfo healVnf(@RequestBody VnfHealRequest request, @PathVariable("vnfmId") String vnfmId, @PathVariable("vnfId") String vnfId, HttpServletResponse httpResponse) {
+ logger.info("REST: Heal VNF with " + vnfId + " identifier");
+ return lifecycleManager.healVnf(vnfmId, vnfId, request, empty(), httpResponse);
}
}
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/AdditionalParameters.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/AdditionalParameters.java
index 1ec129ea..c0b5c5b8 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/AdditionalParameters.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/AdditionalParameters.java
@@ -32,6 +32,7 @@ public class AdditionalParameters {
private Map<String, List<NetworkAddress>> externalConnectionPointAddresses = new HashMap<>();
private List<ExtVirtualLinkData> extVirtualLinks = new ArrayList<>();
private Object additionalParams;
+ private String domain;
public AdditionalParameters() {
//only used through reflection (gson)
@@ -165,6 +166,7 @@ public class AdditionalParameters {
if (o == null || getClass() != o.getClass()) return false;
AdditionalParameters that = (AdditionalParameters) o;
return vimType == that.vimType &&
+ Objects.equals(domain, that.domain) &&
Objects.equals(instantiationLevel, that.instantiationLevel) &&
Objects.equals(computeResourceFlavours, that.computeResourceFlavours) &&
Objects.equals(zones, that.zones) &&
@@ -178,13 +180,14 @@ public class AdditionalParameters {
@Override
public int hashCode() {
- return Objects.hash(vimType, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, additionalParams);
+ return Objects.hash(vimType, domain, instantiationLevel, computeResourceFlavours, zones, softwareImages, extManagedVirtualLinks, externalConnectionPointAddresses, extVirtualLinks, additionalParams);
}
@Override
public String toString() {
return "AdditionalParameters{" +
"vimType=" + vimType +
+ ", domain='" + domain + '\'' +
", instantiationLevel='" + instantiationLevel + '\'' +
", computeResourceFlavours=" + computeResourceFlavours +
", zones=" + zones +
@@ -195,4 +198,12 @@ public class AdditionalParameters {
", additionalParams=" + additionalParams +
'}';
}
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
} \ No newline at end of file
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/CatalogManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/CatalogManager.java
index 5b99bad1..6283cfbc 100644
--- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/CatalogManager.java
+++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/CatalogManager.java
@@ -115,7 +115,7 @@ public class CatalogManager {
if (!isPackageReplicated(cbamVnfdId, cbamCatalogApi)) {
try {
ByteArrayOutputStream cbamPackage = getFileInZip(new ByteArrayInputStream(packageProvider.getPackage(csarId)), CBAM_PACKAGE_NAME_IN_ZIP);
- return cbamCatalogApi.create(create(parse(APPLICATION_OCTET_STREAM.toString()), cbamPackage.toByteArray())).execute().body();
+ return cbamCatalogApi.create(create(parse(APPLICATION_OCTET_STREAM.toString()), cbamPackage.toByteArray())).blockingFirst();
} catch (Exception e) {
logger.debug("Probably concurrent package uploads", e);
//retest if the VNF package exists in CBAM. It might happen that an other operation
@@ -140,7 +140,7 @@ public class CatalogManager {
*/
public String getCbamVnfdContent(String vnfmId, String vnfdId) {
try {
- byte[] vnfdContent = cbamRestApiProvider.getCbamCatalogApi(vnfmId).content(vnfdId).execute().body().bytes();
+ byte[] vnfdContent = cbamRestApiProvider.getCbamCatalogApi(vnfmId).content(vnfdId).blockingFirst().bytes();
String vnfdPath = getVnfdLocation(new ByteArrayInputStream(vnfdContent));
return new String(getFileInZip(new ByteArrayInputStream(vnfdContent), vnfdPath).toByteArray());
} catch (Exception e) {
@@ -158,14 +158,14 @@ public class CatalogManager {
private CatalogAdapterVnfpackage queryPackageFromCBAM(String cbamVnfdId, DefaultApi cbamCatalogApi) {
try {
- return cbamCatalogApi.getById(cbamVnfdId).execute().body();
+ return cbamCatalogApi.getById(cbamVnfdId).blockingFirst();
} catch (Exception e) {
throw buildFatalFailure(logger, "Unable to query VNF package with " + cbamVnfdId + " from CBAM", e);
}
}
private boolean isPackageReplicatedToCbam(String cbamVnfdId, DefaultApi cbamCatalogApi) throws IOException {
- for (CatalogAdapterVnfpackage vnfPackage : cbamCatalogApi.list().execute().body()) {
+ for (CatalogAdapterVnfpackage vnfPackage : cbamCatalogApi.list().blockingFirst()) {
if (vnfPackage.getVnfdId().equals(cbamVnfdId)) {
return true;
}
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 b7dd7168..ce9da78c 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
@@ -218,9 +218,7 @@ public class LifecycleManager {
private void instantiateVnf(String vnfmId, List<ExtVirtualLinkInfo> extVirtualLinkInfos, AdditionalParameters additionalParameters, String onapVnfdId, String vnfmVnfdId, String vnfId, String vimId, JobInfo jobInfo) {
String vnfdContent = catalogManager.getCbamVnfdContent(vnfmId, vnfmVnfdId);
GrantVNFResponseVim vim = grantManager.requestGrantForInstantiate(vnfmId, vnfId, vimId, onapVnfdId, additionalParameters.getInstantiationLevel(), vnfdContent, jobInfo.getJobId());
- if (vim.getVimId() == null) {
- throw buildFatalFailure(logger, "VF-C did not send VIM identifier in grant response");
- }
+ handleBackwardIncompatibleApiChangesInVfc(vim);
VimInfo vimInfo = vimInfoProvider.getVimInfo(vim.getVimId());
InstantiateVnfRequest instantiationRequest = new InstantiateVnfRequest();
addExternalLinksToRequest(extVirtualLinkInfos, additionalParameters, instantiationRequest, vimId);
@@ -248,13 +246,37 @@ public class LifecycleManager {
waitForOperationToFinish(vnfmId, vnfId, operationExecution.getId());
}
+ private void handleBackwardIncompatibleApiChangesInVfc(GrantVNFResponseVim vim) {
+ if (vim.getVimId() == null) {
+ if (vim.getVimid() == null) {
+ throw buildFatalFailure(logger, "VF-C did not send VIM identifier in grant response");
+ } else {
+ vim.setVimId(vim.getVimid());
+ }
+ }
+ if (vim.getAccessInfo() == null) {
+ if (vim.getAccessinfo() == null) {
+ throw buildFatalFailure(logger, "VF-C did not send access info in grant response");
+ } else {
+ vim.setAccessInfo(vim.getAccessinfo());
+ }
+ }
+ }
+
private com.nokia.cbam.lcm.v32.model.VimInfo addVim(AdditionalParameters additionalParameters, String vimId, GrantVNFResponseVim vim, VimInfo vimInfo) {
if (additionalParameters.getVimType() == OPENSTACK_V2_INFO) {
return buildOpenStackV2INFO(vimId, vim, vimInfo);
} else if (additionalParameters.getVimType() == OPENSTACK_V3_INFO) {
+ if (isEmpty(vimInfo.getDomain())) {
+ if (isEmpty(additionalParameters.getDomain())) {
+ throw buildFatalFailure(logger, "The cloud did not supply the cloud domain (Amsterdam release) and was not supplied as additional data");
+ } else {
+ logger.warn("Setting domain from additional parameters");
+ vimInfo.setDomain(additionalParameters.getDomain());
+ }
+ }
return buildOpenStackV3INFO(vimId, vim, vimInfo);
-
} else {
//OTHER VIM TYPE is not possible
return buildVcloudInfo(vimId, vimInfo);
@@ -287,10 +309,10 @@ public class LifecycleManager {
return childElement(deploymentFlavorProperties, "flavour_id").getAsString();
}
- private Set<Map.Entry<String, JsonElement>> getAcceptableOperationParameters(String vnfdContent, String categroryOfOperation, String operationName) {
+ private Set<Map.Entry<String, JsonElement>> getAcceptableOperationParameters(String vnfdContent, String categoryOfOperation, String operationName) {
JsonObject root = new Gson().toJsonTree(new Yaml().load(vnfdContent)).getAsJsonObject();
JsonObject interfaces = child(child(child(root, "topology_template"), "substitution_mappings"), "interfaces");
- JsonObject additionalParameters = child(child(child(child(interfaces, categroryOfOperation), operationName), "inputs"), "additional_parameters");
+ JsonObject additionalParameters = child(child(child(child(interfaces, categoryOfOperation), operationName), "inputs"), "additional_parameters");
return additionalParameters.entrySet();
}
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcExternalSystemInfoProvider.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcExternalSystemInfoProvider.java
index 5f1ecc85..0b49b917 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcExternalSystemInfoProvider.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcExternalSystemInfoProvider.java
@@ -22,7 +22,6 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
import org.onap.vnfmdriver.model.VimInfo;
import org.onap.vnfmdriver.model.VnfmInfo;
import org.springframework.test.util.ReflectionTestUtils;
-import retrofit2.Call;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.fail;
@@ -44,8 +43,7 @@ public class TestVfcExternalSystemInfoProvider extends TestBase {
@Test
public void testVimRetrieval() throws Exception {
VimInfo expectedVimInfo = new VimInfo();
- Call<VimInfo> vimInfoCall = buildCall(expectedVimInfo);
- when(nsLcmApi.queryVIMInfo(VIM_ID)).thenReturn(vimInfoCall);
+ when(nsLcmApi.queryVIMInfo(VIM_ID)).thenReturn(buildObservable(expectedVimInfo));
//when
VimInfo vimInfo = vfcExternalSystemInfoProvider.getVimInfo(VIM_ID);
//verify
@@ -75,8 +73,7 @@ public class TestVfcExternalSystemInfoProvider extends TestBase {
@Test
public void testVnfmRetrieval() throws Exception {
VnfmInfo expectedVimInfo = new VnfmInfo();
- Call<VnfmInfo> vnfmInfoCall = buildCall(expectedVimInfo);
- when(nsLcmApi.queryVnfmInfo(VNFM_ID)).thenReturn(vnfmInfoCall);
+ when(nsLcmApi.queryVnfmInfo(VNFM_ID)).thenReturn(buildObservable(expectedVimInfo));
//when
VnfmInfo vimInfo = vfcExternalSystemInfoProvider.queryVnfmInfoFromSource(VNFM_ID);
//verify
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java
index 6fc61981..b9d44603 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java
@@ -36,7 +36,6 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.LifecycleManager;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
import org.onap.vnfmdriver.model.*;
import org.onap.vnfmdriver.model.ScaleDirection;
-import retrofit2.Call;
import static java.nio.file.Files.readAllBytes;
@@ -58,8 +57,7 @@ public class TestVfcGrantManager extends TestBase {
@Before
public void initMocks() throws Exception {
setField(VfcGrantManager.class, "logger", logger);
- Call<GrantVNFResponse> grantVNFResponseCall = buildCall(grantResponse);
- when(nsLcmApi.grantvnf(grantRequest.capture())).thenReturn(grantVNFResponseCall);
+ when(nsLcmApi.grantvnf(grantRequest.capture())).thenReturn(buildObservable(grantResponse));
grantResponse.setVim(vim);
}
@@ -105,13 +103,15 @@ public class TestVfcGrantManager extends TestBase {
String cbamVnfdContent = new String(readAllBytes(Paths.get(TestVfcGrantManager.class.getResource("/unittests/vnfd.instantiation.yaml").toURI())));
RuntimeException expectedException = new RuntimeException("a");
when(nsLcmApi.grantvnf(Mockito.any())).thenThrow(expectedException);
+ ArgumentCaptor<String> logCaptor = ArgumentCaptor.forClass(String.class);
+ Mockito.doNothing().when(logger).error(logCaptor.capture(), Mockito.eq(expectedException));
//when
try {
vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, "level1", cbamVnfdContent, JOB_ID);
//verify
fail();
} catch (RuntimeException e) {
- verify(logger).error("Unable to request grant", expectedException);
+ assertTrue(logCaptor.getValue().contains("Unable to request grant with "));
}
}
@@ -228,13 +228,16 @@ public class TestVfcGrantManager extends TestBase {
vnf.getVnfConfigurableProperties().add(prop);
RuntimeException expectedException = new RuntimeException();
when(nsLcmApi.grantvnf(Mockito.any())).thenThrow(expectedException);
+ ArgumentCaptor<String> logCaptor = ArgumentCaptor.forClass(String.class);
+ Mockito.doNothing().when(logger).error(logCaptor.capture(), Mockito.eq(expectedException));
//when
try {
vfcGrantManager.requestGrantForTerminate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, vnf, JOB_ID);
//verify
fail();
} catch (RuntimeException e) {
- verify(logger).error(Mockito.eq("Unable to request grant"), Mockito.eq(expectedException));
+ String value = logCaptor.getValue();
+ assertTrue(value.contains("Unable to request grant with "));
}
}
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java
index a701a159..ea82882d 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java
@@ -64,7 +64,7 @@ public class TestVfcNotificationSender extends TestBase {
public void init() throws Exception {
vfcNotificationSender = new VfcNotificationSender(driverProperties, vfcRestApiProvider);
setField(VfcNotificationSender.class, "logger", logger);
- when(nsLcmApi.vNFLCMNotification(eq(VNFM_ID), eq(VNF_ID), sentLcnToVfc.capture())).thenReturn(VOID_CALL);
+ when(nsLcmApi.vNFLCMNotification(eq(VNFM_ID), eq(VNF_ID), sentLcnToVfc.capture())).thenReturn(null);
instantiationOperation.setId("instantiationOperationExecutionId");
instantiationOperation.setStartTime(OffsetDateTime.now());
instantiationOperation.setOperationType(OperationType.INSTANTIATE);
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcPackageProvider.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcPackageProvider.java
index 8d344c5b..a6bb75ac 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcPackageProvider.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcPackageProvider.java
@@ -29,7 +29,6 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.TestUtil;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
import org.onap.vfccatalog.model.VnfPkgDetailInfo;
import org.onap.vfccatalog.model.VnfPkgInfo;
-import retrofit2.Call;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.fail;
@@ -64,8 +63,7 @@ public class TestVfcPackageProvider extends TestBase {
vnfPackageDetails.setPackageInfo(new VnfPkgInfo());
vnfPackageDetails.getPackageInfo().setVnfdModel("{ \"metadata\" : { \"resourceVendorModelNumber\" : \"" + CBAM_VNFD_ID + "\" }}");
vnfPackageDetails.getPackageInfo().setDownloadUrl("http://127.0.0.1/a.csar");
- Call<VnfPkgDetailInfo> vnfPkgDetailInfoCall = buildCall(vnfPackageDetails);
- when(vfcCatalogApi.queryVnfPackage(CSAR_ID)).thenReturn(vnfPkgDetailInfoCall);
+ when(vfcCatalogApi.queryVnfPackage(CSAR_ID)).thenReturn(buildObservable(vnfPackageDetails));
//when
String cbamVnfdId = vfcPackageProvider.getCbamVnfdId(CSAR_ID);
//verify
@@ -82,8 +80,7 @@ public class TestVfcPackageProvider extends TestBase {
vnfPackageDetails.setPackageInfo(new VnfPkgInfo());
vnfPackageDetails.getPackageInfo().setVnfdModel("{ \"metadata\" : { \"resourceVendorModelNumber\" : \"" + CBAM_VNFD_ID + "\" }}");
vnfPackageDetails.getPackageInfo().setDownloadUrl("http://127.0.0.1/a.csar");
- Call<VnfPkgDetailInfo> vnfPkgDetailInfoCall = buildCall(vnfPackageDetails);
- when(vfcCatalogApi.queryVnfPackage(CSAR_ID)).thenReturn(vnfPkgDetailInfoCall);
+ when(vfcCatalogApi.queryVnfPackage(CSAR_ID)).thenReturn(buildObservable(vnfPackageDetails));
byte[] onapPackageContent = TestUtil.loadFile("unittests/TestCbamCatalogManager.sample.csar");
when(ipMappingProvider.mapPrivateIpToPublicIp("127.0.0.1")).thenReturn("1.2.3.4");
when(entity.getContent()).thenReturn(new ByteArrayInputStream(onapPackageContent));
@@ -123,8 +120,7 @@ public class TestVfcPackageProvider extends TestBase {
vnfPackageDetails.setPackageInfo(new VnfPkgInfo());
vnfPackageDetails.getPackageInfo().setVnfdModel("{ \"metadata\" : { \"resourceVendorModelNumber\" : \"" + CBAM_VNFD_ID + "\" }}");
vnfPackageDetails.getPackageInfo().setDownloadUrl("http://127.0.0.1/a.csar");
- Call<VnfPkgDetailInfo> vnfPkgDetailInfoCall = buildCall(vnfPackageDetails);
- when(vfcCatalogApi.queryVnfPackage(CSAR_ID)).thenReturn(vnfPkgDetailInfoCall);
+ when(vfcCatalogApi.queryVnfPackage(CSAR_ID)).thenReturn(buildObservable(vnfPackageDetails));
byte[] onapPackageContent = TestUtil.loadFile("unittests/TestCbamCatalogManager.sample.csar");
when(ipMappingProvider.mapPrivateIpToPublicIp("127.0.0.1")).thenReturn("1.2.3.4");
IOException expectedException = new IOException();
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestLcmApi.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestLcmApi.java
index 8711c3f4..15505ba7 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestLcmApi.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestLcmApi.java
@@ -55,12 +55,13 @@ public class TestLcmApi extends TestBase {
@Test
public void testInstantiation() {
VnfInstantiateRequest req = new VnfInstantiateRequest();
+ req.setVnfPackageId("casrId");
//when
lcmApi.instantiateVnf(req, VNFM_ID, httpResponse);
//verify
verify(lifecycleManager).createAndInstantiate(VNFM_ID, req, httpResponse);
verify(httpResponse).setStatus(SC_CREATED);
- verify(logger).info("REST: Instantiate VNF");
+ verify(logger).info("REST: Instantiate VNF with casrId CSAR identifier");
}
/**
@@ -73,7 +74,7 @@ public class TestLcmApi extends TestBase {
lcmApi.healVnf(req, VNFM_ID, VNF_ID, httpResponse);
//verify
verify(lifecycleManager).healVnf(VNFM_ID, VNF_ID, req, empty(), httpResponse);
- verify(logger).info("REST: Heal VNF");
+ verify(logger).info("REST: Heal VNF with " + VNF_ID + " identifier");
}
/**
@@ -85,7 +86,7 @@ public class TestLcmApi extends TestBase {
lcmApi.queryVnf(VNFM_ID, VNF_ID, httpResponse);
//verify
verify(lifecycleManager).queryVnf(VNFM_ID, VNF_ID);
- verify(logger).info("REST: Query VNF");
+ verify(logger).info("REST: Query VNF with " + VNF_ID + " identifier");
}
@@ -99,7 +100,7 @@ public class TestLcmApi extends TestBase {
lcmApi.scaleVnf(req, VNFM_ID, VNF_ID, httpResponse);
//verify
verify(lifecycleManager).scaleVnf(VNFM_ID, VNF_ID, req, httpResponse);
- verify(logger).info("REST: Scale VNF");
+ verify(logger).info("REST: Scale VNF with " + VNF_ID + " identifier");
}
@@ -113,7 +114,7 @@ public class TestLcmApi extends TestBase {
lcmApi.terminateVnf(req, VNFM_ID, VNF_ID, httpResponse);
//verify
verify(lifecycleManager).terminateAndDelete(VNFM_ID, VNF_ID, req, httpResponse);
- verify(logger).info("REST: Terminate VNF");
+ verify(logger).info("REST: Terminate VNF with " + VNF_ID + " identifier");
}
@@ -126,7 +127,7 @@ public class TestLcmApi extends TestBase {
lcmApi.getJob(VNFM_ID, JOB_ID, httpResponse);
//verify
verify(jobManager).getJob(VNFM_ID, JOB_ID);
- verify(logger).debug("REST: Query job");
+ verify(logger).debug("REST: Query job with " + JOB_ID + " identifier");
}
}
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java
index e61edc3c..804f395d 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestBase.java
@@ -77,7 +77,6 @@ public class TestBase {
public static final String VIM_ID = "myCloudOwnerId_myRegionName";
public static final String JOB_ID = "myJobId";
public static final String CBAM_VNFD_ID = "cbamVnfdId";
- protected static Call<Void> VOID_CALL = buildCall(null);
protected static VoidObservable VOID_OBSERVABLE = new VoidObservable();
@Mock
protected CbamRestApiProvider cbamRestApiProvider;
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestCbamCatalogManager.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestCbamCatalogManager.java
index 90e064a2..439325ec 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestCbamCatalogManager.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestCbamCatalogManager.java
@@ -36,7 +36,6 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.api.IPackageProvider;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.TestUtil;
-import retrofit2.Call;
import static junit.framework.TestCase.*;
import static org.junit.Assert.assertArrayEquals;
@@ -58,8 +57,7 @@ public class TestCbamCatalogManager extends TestBase {
@Before
public void initMocks() throws Exception {
setField(CatalogManager.class, "logger", logger);
- Call<List<CatalogAdapterVnfpackage>> value = buildCall(existingVnfPackages);
- when(cbamCatalogApi.list()).thenReturn(value);
+ when(cbamCatalogApi.list()).thenReturn(buildObservable(existingVnfPackages));
cbamCatalogManager = new CatalogManager(cbamRestApiProvider, packageProvider);
}
@@ -73,8 +71,7 @@ public class TestCbamCatalogManager extends TestBase {
existingVnfPackages.add(existingPackage);
CatalogAdapterVnfpackage createdPackage = new CatalogAdapterVnfpackage();
createdPackage.setVnfdId(CBAM_VNFD_ID);
- Call<CatalogAdapterVnfpackage> catalogAdapterVnfpackageCall = buildCall(createdPackage);
- when(cbamCatalogApi.create(uploadedFile.capture())).thenReturn(catalogAdapterVnfpackageCall);
+ when(cbamCatalogApi.create(uploadedFile.capture())).thenReturn(buildObservable(createdPackage));
byte[] onapPackageContent = TestUtil.loadFile("unittests/TestCbamCatalogManager.sample.csar");
when(packageProvider.getPackage(CSAR_ID)).thenReturn(onapPackageContent);
when(packageProvider.getCbamVnfdId(CSAR_ID)).thenReturn(CBAM_VNFD_ID);
@@ -106,8 +103,7 @@ public class TestCbamCatalogManager extends TestBase {
public CatalogAdapterVnfpackage answer(InvocationOnMock invocationOnMock) throws Throwable {
//this is done by an other thread
existingVnfPackages.add(createdPackage);
- Call<CatalogAdapterVnfpackage> catalogAdapterVnfpackageCall = buildCall(createdPackage);
- when(cbamCatalogApi.getById(CBAM_VNFD_ID)).thenReturn(catalogAdapterVnfpackageCall);
+ when(cbamCatalogApi.getById(CBAM_VNFD_ID)).thenReturn(buildObservable(createdPackage));
throw can_not_upload_package;
}
});
@@ -138,8 +134,7 @@ public class TestCbamCatalogManager extends TestBase {
CatalogAdapterVnfpackage existingPackage = new CatalogAdapterVnfpackage();
existingPackage.setVnfdId(CBAM_VNFD_ID);
existingVnfPackages.add(existingPackage);
- Call<CatalogAdapterVnfpackage> catalogAdapterVnfpackageCall = buildCall(existingPackage);
- when(cbamCatalogApi.getById(CBAM_VNFD_ID)).thenReturn(catalogAdapterVnfpackageCall);
+ when(cbamCatalogApi.getById(CBAM_VNFD_ID)).thenReturn(buildObservable(existingPackage));
//when
CatalogAdapterVnfpackage cbamPackage = cbamCatalogManager.preparePackageInCbam(VNFM_ID, CSAR_ID);
//verify
@@ -214,8 +209,7 @@ public class TestCbamCatalogManager extends TestBase {
*/
@Test
public void testExtractVnfdFromPackage() throws Exception {
- Call<ResponseBody> responseBodyCall = buildCall(buildResponse(TestUtil.loadFile("unittests/cbam.package.zip")));
- when(cbamCatalogApi.content(CBAM_VNFD_ID)).thenReturn(responseBodyCall);
+ when(cbamCatalogApi.content(CBAM_VNFD_ID)).thenReturn(buildObservable(buildResponse(TestUtil.loadFile("unittests/cbam.package.zip"))));
//when
String content = cbamCatalogManager.getCbamVnfdContent(VNFM_ID, CBAM_VNFD_ID);
//verify
@@ -227,8 +221,7 @@ public class TestCbamCatalogManager extends TestBase {
*/
@Test
public void testEmptyCbamPackage() throws Exception {
- Call<ResponseBody> responseBodyCall = buildCall(buildResponse(TestUtil.loadFile("unittests/empty.zip")));
- when(cbamCatalogApi.content(CBAM_VNFD_ID)).thenReturn(responseBodyCall);
+ when(cbamCatalogApi.content(CBAM_VNFD_ID)).thenReturn(buildObservable(buildResponse(TestUtil.loadFile("unittests/empty.zip"))));
//when
try {
cbamCatalogManager.getCbamVnfdContent(VNFM_ID, CBAM_VNFD_ID);
@@ -245,8 +238,7 @@ public class TestCbamCatalogManager extends TestBase {
@Test
public void testMissingVnfdCbamPackage() throws Exception {
byte[] bytes = TestUtil.loadFile("unittests/missing.vnfd.zip");
- Call<ResponseBody> response = buildCall(buildResponse(bytes));
- when(cbamCatalogApi.content(CBAM_VNFD_ID)).thenReturn(response);
+ when(cbamCatalogApi.content(CBAM_VNFD_ID)).thenReturn(buildObservable(buildResponse(bytes)));
//when
try {
cbamCatalogManager.getCbamVnfdContent(VNFM_ID, CBAM_VNFD_ID);
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
index 7078e02d..0ff2bae1 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
@@ -65,14 +65,11 @@ public class TestLifecycleManager extends TestBase {
public static final String OPERATION_EXECUTION_ID = "operationExecutionId";
private static final String ONAP_CSAR_ID = "myOnapCsarId";
private static final String VIM_ID = "ownerId_regionId";
- private GrantVNFResponseVim vim = new GrantVNFResponseVim();
@Mock
private CatalogManager catalogManager;
@Mock
private VfcGrantManager vfcGrantManager;
@Mock
- private CbamTokenProvider tokenProvider;
- @Mock
private JobManager jobManager;
@Mock
private LifecycleChangeNotificationManager notificationManager;
@@ -362,7 +359,6 @@ public class TestLifecycleManager extends TestBase {
@Test
public void testInstantiationV3() throws Exception {
VnfInstantiateRequest instantiationRequest = prepareInstantiationRequest(VimInfo.VimInfoTypeEnum.OPENSTACK_V3_INFO);
-
when(vnfApi.vnfsPost(createRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(vnfInfo));
additionalParam.setInstantiationLevel(INSTANTIATION_LEVEL);
when(vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, INSTANTIATION_LEVEL, cbamVnfdContent, JOB_ID)).thenReturn(grantResponse);
@@ -393,12 +389,106 @@ public class TestLifecycleManager extends TestBase {
}
/**
+ * test instantiation with backward compatibility test with Amsterdam release
+ * - the vim identifier is supplied as vimid with not camel case
+ */
+ @Test
+ public void testInstantiationNoVimId() throws Exception {
+ //given
+ VnfInstantiateRequest instantiationRequest = prepareInstantiationRequest(VimInfo.VimInfoTypeEnum.OPENSTACK_V2_INFO);
+ when(vnfApi.vnfsPost(createRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(vnfInfo));
+ additionalParam.setInstantiationLevel(INSTANTIATION_LEVEL);
+ when(vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, INSTANTIATION_LEVEL, cbamVnfdContent, JOB_ID)).thenReturn(grantResponse);
+ grantResponse.setVimid(VIM_ID);
+ GrantVNFResponseVimAccessInfo accessInfo = new GrantVNFResponseVimAccessInfo();
+ accessInfo.setTenant(TENANT);
+ grantResponse.setAccessinfo(accessInfo);
+ ArgumentCaptor<InstantiateVnfRequest> actualInstantiationRequest = ArgumentCaptor.forClass(InstantiateVnfRequest.class);
+ when(vnfApi.vnfsVnfInstanceIdInstantiatePost(eq(VNF_ID), actualInstantiationRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(instantiationOperationExecution));
+ //when
+ VnfInstantiateResponse response = lifecycleManager.createAndInstantiate(VNFM_ID, instantiationRequest, restResponse);
+ waitForJobToFinishInJobManager(finished);
+ //verify
+ assertEquals(VNF_ID, response.getVnfInstanceId());
+ assertEquals(JOB_ID, response.getJobId());
+ assertEquals(createRequest.getAllValues().size(), 1);
+ assertEquals("myDescription", createRequest.getValue().getDescription());
+ assertEquals("vnfName", createRequest.getValue().getName());
+ assertEquals(CBAM_VNFD_ID, createRequest.getValue().getVnfdId());
+ assertEquals(1, actualInstantiationRequest.getAllValues().size());
+ assertEquals(1, actualInstantiationRequest.getValue().getVims().size());
+ OPENSTACKV2INFO actualVim = (OPENSTACKV2INFO) actualInstantiationRequest.getValue().getVims().get(0);
+ assertEquals(VIM_ID, actualVim.getId());
+ assertEquals(VimInfo.VimInfoTypeEnum.OPENSTACK_V2_INFO, actualVim.getVimInfoType());
+ assertEquals(Boolean.valueOf(parseBoolean(vimInfo.getSslInsecure())), actualVim.getInterfaceInfo().isSkipCertificateVerification());
+ assertEquals("cloudUrl", actualVim.getInterfaceInfo().getEndpoint());
+ //FIXME assertEquals();actualVim.getInterfaceInfo().getTrustedCertificates());
+ assertEquals("vimPassword", actualVim.getAccessInfo().getPassword());
+ assertEquals("regionId", actualVim.getAccessInfo().getRegion());
+ assertEquals("myTenant", actualVim.getAccessInfo().getTenant());
+ assertEquals("vimUsername", actualVim.getAccessInfo().getUsername());
+ assertEquals(1, actualInstantiationRequest.getValue().getComputeResourceFlavours().size());
+ assertEquals("flavourProviderId", actualInstantiationRequest.getValue().getComputeResourceFlavours().get(0).getResourceId());
+ assertEquals(VIM_ID, actualInstantiationRequest.getValue().getComputeResourceFlavours().get(0).getVimId());
+ assertEquals("virtualComputeDescId", actualInstantiationRequest.getValue().getComputeResourceFlavours().get(0).getVnfdVirtualComputeDescId());
+ assertEquals(1, actualInstantiationRequest.getValue().getExtManagedVirtualLinks().size());
+ assertEquals(extManVl, actualInstantiationRequest.getValue().getExtManagedVirtualLinks().get(0));
+ assertEquals(2, actualInstantiationRequest.getValue().getExtVirtualLinks().size());
+
+ assertEquals("myNetworkProviderId", actualInstantiationRequest.getValue().getExtVirtualLinks().get(0).getResourceId());
+ assertEquals("myEVlId", actualInstantiationRequest.getValue().getExtVirtualLinks().get(0).getExtVirtualLinkId());
+ assertEquals(1, actualInstantiationRequest.getValue().getExtVirtualLinks().get(0).getExtCps().size());
+ assertEquals("myCpdId", actualInstantiationRequest.getValue().getExtVirtualLinks().get(0).getExtCps().get(0).getCpdId());
+
+ assertEquals(VIM_ID, actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getVimId());
+ assertEquals("evlId1", actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtVirtualLinkId());
+ assertEquals("networkProviderId1", actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getResourceId());
+ assertEquals(1, actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtCps().size());
+
+
+ assertEquals(Integer.valueOf(2), actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtCps().get(0).getNumDynamicAddresses());
+ assertEquals("cpdId3", actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtCps().get(0).getCpdId());
+ assertEquals(1, actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtCps().get(0).getAddresses().size());
+ assertEquals("1.2.3.4", actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtCps().get(0).getAddresses().get(0).getIp());
+ assertEquals("mac", actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtCps().get(0).getAddresses().get(0).getMac());
+ assertEquals("subnetId", actualInstantiationRequest.getValue().getExtVirtualLinks().get(1).getExtCps().get(0).getAddresses().get(0).getSubnetId());
+
+ assertEquals("myFlavorId", actualInstantiationRequest.getValue().getFlavourId());
+ assertEquals(Boolean.TRUE, actualInstantiationRequest.getValue().isGrantlessMode());
+ assertEquals("level1", actualInstantiationRequest.getValue().getInstantiationLevelId());
+ assertEquals(1, actualInstantiationRequest.getValue().getZones().size());
+ assertEquals(VIM_ID, actualInstantiationRequest.getValue().getZones().get(0).getVimId());
+ assertEquals("zoneProviderId", actualInstantiationRequest.getValue().getZones().get(0).getResourceId());
+ assertEquals("zoneId", actualInstantiationRequest.getValue().getZones().get(0).getId());
+ assertEquals(1, actualInstantiationRequest.getValue().getSoftwareImages().size());
+ assertEquals(VIM_ID, actualInstantiationRequest.getValue().getSoftwareImages().get(0).getVimId());
+ assertEquals("imageProviderId", actualInstantiationRequest.getValue().getSoftwareImages().get(0).getResourceId());
+ assertEquals("imageId", actualInstantiationRequest.getValue().getSoftwareImages().get(0).getVnfdSoftwareImageId());
+ String actualEmbeddedAdditionParams = new Gson().toJson(actualInstantiationRequest.getValue().getAdditionalParams());
+ assertTrue("{\"jobId\":\"myJobId\",\"a\":\"b\"}".equals(actualEmbeddedAdditionParams) || "{\"a\":\"b\",\"jobId\":\"myJobId\"}".equals(actualEmbeddedAdditionParams));
+ assertTrue(actualVim.getInterfaceInfo().isSkipCertificateVerification());
+ assertTrue(actualVim.getInterfaceInfo().isSkipCertificateHostnameCheck());
+
+ assertEquals(1, actualVnfModifyRequest.getAllValues().size());
+ assertEquals(2, actualVnfModifyRequest.getValue().getExtensions().size());
+ assertEquals(LifecycleManager.ONAP_CSAR_ID, actualVnfModifyRequest.getValue().getExtensions().get(0).getName());
+ assertEquals(ONAP_CSAR_ID, actualVnfModifyRequest.getValue().getExtensions().get(0).getValue());
+ assertEquals(LifecycleManager.EXTERNAL_VNFM_ID, actualVnfModifyRequest.getValue().getExtensions().get(1).getName());
+ assertEquals(VNFM_ID, actualVnfModifyRequest.getValue().getExtensions().get(1).getValue());
+
+ //the 3.2 API does not accept empty array
+ assertNull(actualVnfModifyRequest.getValue().getVnfConfigurableProperties());
+ verify(jobManager).spawnJob(VNF_ID, restResponse);
+ verify(logger).info(eq("Starting {} operation on VNF with {} identifier with {} parameter"), eq("creation"), eq("not yet specified"), anyString());
+ verify(logger).info(eq("Starting {} operation on VNF with {} identifier with {} parameter"), eq("instantiation"), eq(VNF_ID), anyString());
+ }
+
+ /**
* test instantiation with KeyStone V3 based with SSL
*/
@Test
public void testInstantiationV3WithSsl() throws Exception {
VnfInstantiateRequest instantiationRequest = prepareInstantiationRequest(VimInfo.VimInfoTypeEnum.OPENSTACK_V3_INFO);
-
when(vnfApi.vnfsPost(createRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(vnfInfo));
additionalParam.setInstantiationLevel(INSTANTIATION_LEVEL);
when(vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, INSTANTIATION_LEVEL, cbamVnfdContent, JOB_ID)).thenReturn(grantResponse);
@@ -438,7 +528,6 @@ public class TestLifecycleManager extends TestBase {
@Test
public void testInstantiationV3WithNonSpecifiedSsl() throws Exception {
VnfInstantiateRequest instantiationRequest = prepareInstantiationRequest(VimInfo.VimInfoTypeEnum.OPENSTACK_V3_INFO);
-
when(vnfApi.vnfsPost(createRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(vnfInfo));
additionalParam.setInstantiationLevel(INSTANTIATION_LEVEL);
when(vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, INSTANTIATION_LEVEL, cbamVnfdContent, JOB_ID)).thenReturn(grantResponse);
@@ -469,6 +558,70 @@ public class TestLifecycleManager extends TestBase {
}
/**
+ * verify backward compatibility with Amsterdam release
+ */
+ @Test
+ public void testInstantiationV3WithNoDomain() throws Exception {
+ additionalParam.setInstantiationLevel(INSTANTIATION_LEVEL);
+ additionalParam.setDomain("myDomain");
+ VnfInstantiateRequest instantiationRequest = prepareInstantiationRequest(VimInfo.VimInfoTypeEnum.OPENSTACK_V3_INFO);
+ vimInfo.setDomain(null);
+ when(vnfApi.vnfsPost(createRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(vnfInfo));
+ when(vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, INSTANTIATION_LEVEL, cbamVnfdContent, JOB_ID)).thenReturn(grantResponse);
+ grantResponse.setVimId(VIM_ID);
+ GrantVNFResponseVimAccessInfo accessInfo = new GrantVNFResponseVimAccessInfo();
+ accessInfo.setTenant(TENANT);
+ vimInfo.setSslInsecure(null);
+ grantResponse.setAccessInfo(accessInfo);
+ ArgumentCaptor<InstantiateVnfRequest> actualInstantiationRequest = ArgumentCaptor.forClass(InstantiateVnfRequest.class);
+ when(vnfApi.vnfsVnfInstanceIdInstantiatePost(eq(VNF_ID), actualInstantiationRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(instantiationOperationExecution));
+ //when
+ VnfInstantiateResponse response = lifecycleManager.createAndInstantiate(VNFM_ID, instantiationRequest, restResponse);
+ waitForJobToFinishInJobManager(finished);
+ assertEquals(1, actualInstantiationRequest.getValue().getVims().size());
+ //verify
+ OPENSTACKV3INFO actualVim = (OPENSTACKV3INFO) actualInstantiationRequest.getValue().getVims().get(0);
+ assertEquals(VIM_ID, actualVim.getId());
+ assertEquals(VimInfo.VimInfoTypeEnum.OPENSTACK_V3_INFO, actualVim.getVimInfoType());
+ assertEquals("cloudUrl", actualVim.getInterfaceInfo().getEndpoint());
+ //FIXME assertEquals();actualVim.getInterfaceInfo().getTrustedCertificates());
+ assertEquals("vimPassword", actualVim.getAccessInfo().getPassword());
+ assertEquals("regionId", actualVim.getAccessInfo().getRegion());
+ assertEquals("myTenant", actualVim.getAccessInfo().getProject());
+ assertEquals("myDomain", actualVim.getAccessInfo().getDomain());
+ assertEquals("vimUsername", actualVim.getAccessInfo().getUsername());
+ assertTrue(actualVim.getInterfaceInfo().isSkipCertificateVerification());
+ assertTrue(actualVim.getInterfaceInfo().isSkipCertificateHostnameCheck());
+ verify(logger).warn("Setting domain from additional parameters");
+ }
+
+ /**
+ * verify backward compatibility with Amsterdam release
+ * if no domain is specified error is propagated
+ */
+ @Test
+ public void testInstantiationV3WithNoDomainFail() throws Exception {
+ VnfInstantiateRequest instantiationRequest = prepareInstantiationRequest(VimInfo.VimInfoTypeEnum.OPENSTACK_V3_INFO);
+ vimInfo.setDomain(null);
+ when(vnfApi.vnfsPost(createRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(vnfInfo));
+ additionalParam.setInstantiationLevel(INSTANTIATION_LEVEL);
+ when(vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, INSTANTIATION_LEVEL, cbamVnfdContent, JOB_ID)).thenReturn(grantResponse);
+ grantResponse.setVimId(VIM_ID);
+ GrantVNFResponseVimAccessInfo accessInfo = new GrantVNFResponseVimAccessInfo();
+ accessInfo.setTenant(TENANT);
+ vimInfo.setSslInsecure(null);
+ grantResponse.setAccessInfo(accessInfo);
+ ArgumentCaptor<InstantiateVnfRequest> actualInstantiationRequest = ArgumentCaptor.forClass(InstantiateVnfRequest.class);
+ when(vnfApi.vnfsVnfInstanceIdInstantiatePost(eq(VNF_ID), actualInstantiationRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(instantiationOperationExecution));
+ //when
+ VnfInstantiateResponse response = lifecycleManager.createAndInstantiate(VNFM_ID, instantiationRequest, restResponse);
+ waitForJobToFinishInJobManager(finished);
+ assertEquals(0, actualInstantiationRequest.getAllValues().size());
+ //verify
+ verify(logger).error("The cloud did not supply the cloud domain (Amsterdam release) and was not supplied as additional data");
+ }
+
+ /**
* test instantiation with vcloud
*/
@Test
@@ -846,7 +999,7 @@ public class TestLifecycleManager extends TestBase {
boolean deleted = false;
while (!deleted) {
try {
- verify(vnfApi).vnfsVnfInstanceIdDelete(VNF_ID, NOKIA_LCM_API_VERSION);
+ verify(logger).info("The VNF with {} identifier has been deleted", VNF_ID);
deleted = true;
} catch (Error e) {
}
@@ -855,7 +1008,7 @@ public class TestLifecycleManager extends TestBase {
verify(notificationManager, never()).waitForTerminationToBeProcessed("terminationId");
verify(logger).warn("The VNF with {} identifier is not instantiated no termination is required", VNF_ID);
verify(logger).info("Deleting VNF with {} identifier", VNF_ID);
- verify(logger).info("The VNF with {} identifier has been deleted", VNF_ID);
+ verify(vnfApi).vnfsVnfInstanceIdDelete(VNF_ID, NOKIA_LCM_API_VERSION);
VOID_OBSERVABLE.assertCalled();
}
diff --git a/nokiav2/driver/src/test/resources/.gitignore b/nokiav2/driver/src/test/resources/.gitignore
index 03941911..236ba464 100644
--- a/nokiav2/driver/src/test/resources/.gitignore
+++ b/nokiav2/driver/src/test/resources/.gitignore
@@ -1 +1 @@
-application-real.properties
+application-real*.properties
diff --git a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.full.modified.vnfd.yaml b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.full.modified.vnfd.yaml
index ba65e4f2..f9fe6a25 100644
--- a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.full.modified.vnfd.yaml
+++ b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.full.modified.vnfd.yaml
@@ -9,6 +9,7 @@ topology_template:
extensions:
existingAttribute: {default: value}
onapCsarId: {default: kuku}
+ externalVnfmId: {default: kuku}
vimId: {default: kuku}
interfaces:
Basic:
diff --git a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.minimal.modified.vnfd.yaml b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.minimal.modified.vnfd.yaml
index ed242473..256aa9ee 100644
--- a/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.minimal.modified.vnfd.yaml
+++ b/nokiav2/driver/src/test/resources/unittests/packageconverter/cbam.minimal.modified.vnfd.yaml
@@ -34,4 +34,5 @@ topology_template:
modifiable_attributes:
extensions:
onapCsarId: {default: kuku}
+ externalVnfmId: {default: kuku}
vimId: {default: kuku}
diff --git a/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.yaml b/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.yaml
index 51842a87..49446544 100644
--- a/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.yaml
+++ b/nokiav2/driver/src/test/resources/unittests/packageconverter/nodes.vnfd.onap.yaml
@@ -18,7 +18,7 @@ topology_template:
virtual_compute:
properties:
virtual_memory:
- virtual_mem_size: 8192 MB
+ virtual_mem_size: 8192
virtual_cpu:
num_virtual_cpu: 4
requirements:
@@ -33,13 +33,13 @@ topology_template:
properties:
id: myStorage1
type_of_storage: volume
- size_of_storage: 1G
+ size_of_storage: 1
myStorage2:
type: tosca.nodes.nfv.VDU.VirtualStorage
properties:
id: myStorage2
type_of_storage: volume
- size_of_storage: 2G
+ size_of_storage: 2
myNetwork1:
type: tosca.nodes.nfv.VnfVirtualLinkDesc
properties:
diff --git a/nokiav2/generatedapis/pom.xml b/nokiav2/generatedapis/pom.xml
index b34a6a88..1e842c8b 100644
--- a/nokiav2/generatedapis/pom.xml
+++ b/nokiav2/generatedapis/pom.xml
@@ -187,6 +187,8 @@ Release AAI
<configOptions>
<generateSupportingFiles>false</generateSupportingFiles>
<sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
</configOptions>
</configuration>
</execution>
@@ -205,6 +207,8 @@ Release AAI
<configOptions>
<generateSupportingFiles>false</generateSupportingFiles>
<sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
</configOptions>
</configuration>
</execution>
@@ -223,6 +227,8 @@ Release AAI
<configOptions>
<generateSupportingFiles>false</generateSupportingFiles>
<sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
</configOptions>
</configuration>
</execution>
@@ -242,6 +248,8 @@ Release AAI
<configOptions>
<generateSupportingFiles>false</generateSupportingFiles>
<sourceFolder>src/gen/java/main</sourceFolder>
+ <withXml>true</withXml>
+ <useRxJava2>true</useRxJava2>
</configOptions>
</configuration>
</execution>
diff --git a/nokiav2/generatedapis/src/main/resources/vfc.vnfdriver.swagger.json b/nokiav2/generatedapis/src/main/resources/vfc.vnfdriver.swagger.json
index c9c5fa6d..ceed598c 100644
--- a/nokiav2/generatedapis/src/main/resources/vfc.vnfdriver.swagger.json
+++ b/nokiav2/generatedapis/src/main/resources/vfc.vnfdriver.swagger.json
@@ -697,7 +697,12 @@
"type": "string"
},
"vimId": {
- "type": "string"
+ "type": "string",
+ "description": "The identifier of the VIM"
+ },
+ "vimid": {
+ "type": "string",
+ "description": "Same as vimId (backward incompatible API change https://jira.onap.org/browse/VFC-681)"
},
"interfaceInfo": {
"type": "object",
@@ -733,6 +738,23 @@
}
}
},
+ "accessinfo": {
+ "type": "object",
+ "properties": {
+ "tenant": {
+ "type": "string",
+ "description": "Tenant Name of tenant"
+ },
+ "username": {
+ "type": "string",
+ "description": "Username for login"
+ },
+ "password": {
+ "type": "string",
+ "description": "Password of login user"
+ }
+ }
+ },
"interfaceEndpoint": {
"type": "string",
"description": "Information about the interface endpoint. It is a URL"