aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-ct
diff options
context:
space:
mode:
authorJakub Dudycz <jakub.dudycz@nokia.com>2018-07-18 14:33:10 +0200
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2018-08-03 07:59:03 +0200
commitf4a58fbdbcaaba92a4daae0e2807536c3da4c857 (patch)
tree8a1b7b9db9fe2d65d67661aee142bc0aba7e4ef1 /hv-collector-ct
parent0d15767178ffff59009de51d3737883aa81df2a6 (diff)
Support scenarios for continuous streaming test
Added support for below scenarios -too big payloads -invalid wire frames -invalid GPB data -unsupported domains Changed input json for xnf simulator endpoint Closes ONAP-500 Change-Id: I19e84a76cef501e274ea8152f3c33c95dddcaac9 Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com> Issue-ID: DCAEGEN2-601
Diffstat (limited to 'hv-collector-ct')
-rw-r--r--hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt13
1 files changed, 9 insertions, 4 deletions
diff --git a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt
index b793f3aa..4953d8f3 100644
--- a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt
+++ b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt
@@ -29,7 +29,9 @@ import org.onap.dcae.collectors.veshv.domain.WireFrameEncoder
import org.onap.dcae.collectors.veshv.tests.fakes.CountingSink
import org.onap.dcae.collectors.veshv.tests.fakes.basicConfiguration
import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageGenerator
-import org.onap.dcae.collectors.veshv.ves.message.generator.config.MessageParameters
+import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageParameters
+import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageType.VALID
+import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader.Domain.HVRANMEAS
import reactor.core.publisher.Flux
import reactor.math.sum
import java.security.MessageDigest
@@ -55,8 +57,10 @@ object PerformanceSpecification : Spek({
val timeout = Duration.ofMinutes((1 + (runs / 2)).toLong())
val params = MessageParameters(
- commonEventHeader = vesEvent().commonEventHeader,
+ domain = HVRANMEAS,
+ messageType = VALID,
amount = numMessages)
+
val fluxes = (1.rangeTo(runs)).map {
sut.collector.handleConnection(sut.alloc, generateDataStream(sut.alloc, params))
}
@@ -82,7 +86,8 @@ object PerformanceSpecification : Spek({
val timeout = Duration.ofSeconds(30)
val params = MessageParameters(
- commonEventHeader = vesEvent().commonEventHeader,
+ domain = HVRANMEAS,
+ messageType = VALID,
amount = numMessages)
val dataStream = generateDataStream(sut.alloc, params)
@@ -162,7 +167,7 @@ fun dropWhenIndex(predicate: (Long) -> Boolean, stream: Flux<ByteBuf>): Flux<Byt
private fun generateDataStream(alloc: ByteBufAllocator, params: MessageParameters): Flux<ByteBuf> =
WireFrameEncoder(alloc).let { encoder ->
MessageGenerator.INSTANCE
- .createMessageFlux(params)
+ .createMessageFlux(listOf(params))
.map(encoder::encode)
.transform { simulateRemoteTcp(alloc, 1000, it) }
}