aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2019-10-22 20:47:12 -0400
committerBrinda Santh <bs2796@att.com>2019-10-22 20:47:12 -0400
commita5ceb2485df10aa4987c64975d7200ff090c5890 (patch)
tree15b22424eccfd78996d717873a6a1517e2820a4e /ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap
parent910fa69e65b3d151ef2bdbbf90fdcc31cfa01008 (diff)
Py executor grpc TLS server authentication.
Issue-ID: CCSDK-1854 Signed-off-by: Brinda Santh <bs2796@att.com> Change-Id: I72b3deb7976e7d3e44478c497a46b9b4ac428623
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap')
-rw-r--r--ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcServerTest.kt10
-rw-r--r--ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBluePrintProcessingServer.kt4
2 files changed, 9 insertions, 5 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcServerTest.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcServerTest.kt
index a08425048..8154d3747 100644
--- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcServerTest.kt
+++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcServerTest.kt
@@ -27,6 +27,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcClientProperties
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TLSAuthGrpcServerProperties
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader
+import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput
import java.util.*
@@ -38,15 +39,15 @@ class BluePrintGrpcServerTest {
private val tlsAuthGrpcServerProperties = TLSAuthGrpcServerProperties().apply {
port = 50052
type = GRPCLibConstants.TYPE_TLS_AUTH
- certChain = "src/test/resources/tls-manual/my-public-key-cert.pem"
- privateKey = "src/test/resources/tls-manual/my-private-key.pem"
+ certChain = "src/test/resources/tls-manual/py-executor-chain.pem"
+ privateKey = "src/test/resources/tls-manual/py-executor-key.pem"
}
private val tlsAuthGrpcClientProperties = TLSAuthGrpcClientProperties().apply {
host = "localhost"
port = 50052
type = GRPCLibConstants.TYPE_TLS_AUTH
- trustCertCollection = "src/test/resources/tls-manual/my-public-key-cert.pem"
+ trustCertCollection = "src/test/resources/tls-manual/py-executor-chain.pem"
}
@Test
@@ -72,6 +73,9 @@ class BluePrintGrpcServerTest {
launch {
resChannel.consumeEach {
log.info("Received Response")
+ if (it.status.eventType == EventType.EVENT_COMPONENT_EXECUTED) {
+ resChannel.cancel()
+ }
}
}
val request = getRequest("12345")
diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBluePrintProcessingServer.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBluePrintProcessingServer.kt
index c6991af9b..d5bc70c48 100644
--- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBluePrintProcessingServer.kt
+++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/MockTLSBluePrintProcessingServer.kt
@@ -36,8 +36,8 @@ fun main() {
val tlsAuthGrpcServerProperties = TLSAuthGrpcServerProperties().apply {
port = 50052
type = GRPCLibConstants.TYPE_TLS_AUTH
- certChain = "src/test/resources/tls-manual/my-public-key-cert.pem"
- privateKey = "src/test/resources/tls-manual/my-private-key.pem"
+ certChain = "src/test/resources/tls-manual/py-executor-chain.pem"
+ privateKey = "src/test/resources/tls-manual/py-executor-key.pem"
}
val server = TLSAuthGrpcServerService(tlsAuthGrpcServerProperties).serverBuilder()
.intercept(GrpcServerLoggingInterceptor())