summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/test
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-05-21 11:58:01 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-05-31 10:42:51 -0400
commit626b8f2399043c35d3bcb86e1d1c6142e2e0e327 (patch)
treea9424dbee46dda2fdcec0cfd79a7aac626253f60 /adapters/mso-openstack-adapters/src/test
parentce6b469e96aa662a134881188627252b084937ad (diff)
fix keypair conflict issue in openstack adapter
Fix wiremock stubs to return proper data and url Fix copyright header issue on unit test file Fix keypair issue, clean up unit tests and logging Fix issues found in unit testing, update data Fix broken Unit tests that used invalid data Continue Refactor to support keypair failure scenario Update logic for when to auto delete a stuck keypair Change-Id: Ice5256cf0381a3b46d1c442907c0f321a1c0d006 Issue-ID: SO-1897 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters/mso-openstack-adapters/src/test')
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java30
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/CreateNetwork.xml2
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack.json30
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_Created_VfModule.json30
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json2
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_VnfBaseStackId.json3
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/logback-test.xml14
7 files changed, 49 insertions, 62 deletions
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java
index 4dcb7c8710..add1918748 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java
@@ -20,18 +20,6 @@
package org.onap.so.adapters.network;
-import org.apache.http.HttpStatus;
-import org.junit.Test;
-import org.onap.so.adapters.vnf.BaseRestTestUtils;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.util.UriComponentsBuilder;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
import static org.junit.Assert.assertEquals;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteNeutronNetwork;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteStack_200;
@@ -52,6 +40,18 @@ import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStack;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenstackGet;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenstackPost;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.http.HttpStatus;
+import org.junit.Test;
+import org.onap.so.adapters.vnf.BaseRestTestUtils;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.util.UriComponentsBuilder;
public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
@@ -142,12 +142,12 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackResponseAccess(wireMockServer, wireMockPort);
- mockOpenStackGetStack_404(wireMockServer, "dvspg-VCE_VPE-mtjnj40avbc");
+ mockOpenStackGetStack_404(wireMockServer, "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId");
mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack.json");
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
- "dvspg-VCE_VPE-mtjnj40avbc/stackId");
+ "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId");
String uri = "/services/NetworkAdapter";
headers.set("X-ECOMP-RequestID", "123456789456127");
@@ -163,7 +163,7 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils {
mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack.json");
mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json",
- "dvspg-VCE_VPE-mtjnj40avbc");
+ "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId");
String uri = "/services/NetworkAdapter";
headers.set("X-ECOMP-RequestID", "123456789456127");
diff --git a/adapters/mso-openstack-adapters/src/test/resources/CreateNetwork.xml b/adapters/mso-openstack-adapters/src/test/resources/CreateNetwork.xml
index b9fc419a65..5ee33ab3dc 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/CreateNetwork.xml
+++ b/adapters/mso-openstack-adapters/src/test/resources/CreateNetwork.xml
@@ -4,7 +4,7 @@
<cloudSiteId>mtn13</cloudSiteId>
<tenantId>bef254252c5d44e6bcec65c180180ab5</tenantId>
<networkType>CONTRAIL30_GNDIRECT</networkType>
- <networkName>dvspg-VCE_VPE-mtjnj40avbc</networkName>
+ <networkName>DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001</networkName>
<physicalNetworkName>dvs-mtjnj-01</physicalNetworkName>
<vlans>3014</vlans>
<failIfExists>false</failIfExists>
diff --git a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack.json b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack.json
index af63ca7de4..be50d09ef6 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack.json
+++ b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack.json
@@ -1,17 +1,15 @@
{
- "stack": {
- "description": null,
- "links": null,
- "stackStatusReason": null,
- "stackName": null,
- "updatedTime": null,
- "creationTime": null,
- "stackStatus": "NOT_FOUND",
- "id": "stackId",
- "files": null,
- "outputs": null,
- "parameters": {
-
- }
- }
-} \ No newline at end of file
+ "stack": {
+ "creationTime": null,
+ "description": null,
+ "files": null,
+ "id": "stackId",
+ "links": null,
+ "outputs": null,
+ "parameters": {},
+ "stack_name": "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001",
+ "stack_status": "CREATE_IN_PROGRESS",
+ "stack_status_reason": null,
+ "updatedTime": null
+ }
+}
diff --git a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_Created_VfModule.json b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_Created_VfModule.json
index 29893ccb7b..e49d407766 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_Created_VfModule.json
+++ b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_Created_VfModule.json
@@ -1,17 +1,15 @@
{
- "stack": {
- "description": null,
- "links": null,
- "stack_status_reason": null,
- "stack_name": "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001",
- "updated_time": null,
- "creation_time": null,
- "stack_status": "CREATE_COMPLETE",
- "id": "stackId",
- "files": null,
- "outputs": null,
- "parameters": {
-
- }
- }
-} \ No newline at end of file
+ "stack": {
+ "creationTime": null,
+ "description": null,
+ "files": null,
+ "id": "stackId",
+ "links": null,
+ "outputs": null,
+ "parameters": {},
+ "stack_name": "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001",
+ "stack_status": "CREATE_COMPLETE",
+ "stack_status_reason": "Create Completed",
+ "updatedTime": null
+ }
+}
diff --git a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json
index 8612258eee..bad85f37c8 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json
+++ b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_Stack_DeleteComplete.json
@@ -3,7 +3,7 @@
"description": null,
"links": null,
"stackStatusReason": null,
- "stackName": null,
+ "stackName": "stackName",
"updatedTime": null,
"creationTime": null,
"stack_status": "DELETE_COMPLETE",
diff --git a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_VnfBaseStackId.json b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_VnfBaseStackId.json
index f4a3c520ba..70c78a6047 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_VnfBaseStackId.json
+++ b/adapters/mso-openstack-adapters/src/test/resources/__files/OpenstackResponse_VnfBaseStackId.json
@@ -7,6 +7,7 @@
"rel" : "self"
}
],
- "stack_name": "vnfBaseStack"
+ "stack_name": "vnfBaseStack",
+ "stack_status": "CREATE_COMPLETE"
}
} \ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/test/resources/logback-test.xml b/adapters/mso-openstack-adapters/src/test/resources/logback-test.xml
index 5d6eee746f..8bfa6d83c3 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/logback-test.xml
+++ b/adapters/mso-openstack-adapters/src/test/resources/logback-test.xml
@@ -29,25 +29,15 @@
</appender>
- <logger name="com.att.eelf.audit" level="INFO" additivity="false">
- <appender-ref ref="STDOUT" />
- </logger>
-
- <logger name="com.att.eelf.metrics" level="INFO" additivity="false">
- <appender-ref ref="STDOUT" />
- </logger>
- <logger name="com.att.eelf.error" level="WARN" additivity="false">
+ <logger name="com.woorea.openstack" level="${so.log.level:-DEBUG}" additivity="false">
<appender-ref ref="STDOUT" />
</logger>
<logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false">
<appender-ref ref="STDOUT" />
</logger>
-
- <logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false">
- <appender-ref ref="STDOUT" />
- </logger>
+
<root level="WARN">
<appender-ref ref="STDOUT" />