diff --git a/csm/CsmServiceJMeterTests.jmx b/csm/CsmServiceJMeterTests.jmx new file mode 100644 index 00000000000..542a07dd758 --- /dev/null +++ b/csm/CsmServiceJMeterTests.jmx @@ -0,0 +1,474 @@ + + + + + A collection of JMeter components to generate traffic for different test cases of the csm-service. + +How to use this script: +1. Choose an environment by enabling exactly one of the respective components. ( naming -> "env:<ENVIRONMENT-NAME> (<domain>)" ) +2. Choose which types of messages to send by enabling one or more of the message components. ( naming -> "cmd:<COMMAND>" ) +3. OPTIONAL: Some tests require limiting the throughput to ensure that the correct counters are displayed / calculated. In order to do this activate the "Limit throughput to 50 Tx/s" component. + false + false + + + + DefaultCsmServicePort + 6813 + = + + + DefaultResponseTimeLimit + 5000 + = + + + DefaultThreadCount + 10 + = + + + DefaultTransactionLimit + 3000.0 + = + + + IncreasedTransactionLimit + 4800.0 + = + + + DefaultTcpImpl + BinaryTCPClientSimpleImpl + = + + + DefaultConnectTimeLimit + 1000 + = + + + + + + + + 127.0.0.1 + false + ${DefaultCsmServicePort} + false + ${DefaultResponseTimeLimit} + + false + ${DefaultTcpImpl} + Configures the traffic to go to a locally running instance of csm-service. + ${DefaultConnectTimeLimit} + + + + hsmcli1office + false + ${DefaultCsmServicePort} + false + ${DefaultResponseTimeLimit} + + ${DefaultTcpImpl} + Configures the traffic to go to the dev environment running on hsmcli1office. + ${DefaultConnectTimeLimit} + + + + Limits the transaction rate to 50 per second. + +This allows us to ensure that csm-service calculates this rate correctly. + ${DefaultTransactionLimit} + 3 + + + + Limits the transaction rate to 80 per second. + +This allows us to ensure smooth operation during expected load. + ${IncreasedTransactionLimit} + 3 + + + + continue + + false + -1 + + ${DefaultThreadCount} + 1 + false + + + false + Sends CSM_PING messages to the selected environment. + true + + + + Sends a default ping message to the csm-service. + + false + + false + + 0f0843534d5f50494e470000000000 + false + + + + + + + 250000000000 + 56455253494f4e00000008 + + The response of the ping request should meet the following requirements: + +- starts with 250000000000, indicates success +- contains 56455253494f4e00000008, which translates to "VERSION size 8 = x" (no actual version check, as it can change) + The return status of the ping response does not indicate success. + Assertion.response_data + false + 2 + + + + + + continue + + false + -1 + + ${DefaultThreadCount} + 1 + false + + + false + Sends CSM_VALIDATE_TAN messages to the selected environment. + true + + + + Sends a default validate tan message to the csm-service. + + false + + false + + 171043534d5f56414c49444154455f54414e09000000a500010354414e000000040299791f010207434152445f4e52000000080000000055206168020208353950414e5f494400000002050003010c4150505f4558505f444154450000000315123104020756455253494f4e000000010105030a53544f5245445f4154430000000200670602044d4f4445000000010007020a444154415f494e5055540000000100080204444154410000000f16740f623237353533323039303731 + false + + + + + + + 2d0000000000 + 535441545553000000010001 + 415443000000020084 + + The response of the validate tan request should meet the following requirements: + +- should start with 2d0000000000, this indicates the operation was successful +- should contain 535441545553000000010001, this translates to "STATUS = 0" (eg. tan is valid) +- should contain 415443000000020084, this translates to "ATC = 132" (eg. end of message) + The return status of the validate tan response does not indicate success. + Assertion.response_data + false + 2 + + + + + Sends a default validate tan message to the csm-service. + + false + + false + + 171043534d5f56414c49444154455f54414e09000000b600010354414e000000040354799f010207434152445f4e5200000008d0576876fa16bb11020208353950414e5f494400000002080003010c4150505f4558505f444154450000000316123104020756455253494f4e000000010205030a53544f5245445f4154430000000200010602044d4f4445000000010007020a444154415f494e50555400000001010802044441544100000020ae248879fe52db2543e53cf445d3d828ce0bf5c560593d97278a59762dd0c2c9 + false + + + + + + + 2d0000000000 + 535441545553000000010101 + 415443000000020002 + + The response of the validate tan request should meet the following requirements: + +- should start with 2d0000000000, this indicates the operation was successful +- should contain 535441545553000000010101, this translates to "STATUS = 1" (eg. tan is invalid) +- should contain 415443000000020002, this translates to "ATC = 2" (eg. end of message) + The return status of the validate tan response does not indicate success. + Assertion.response_data + false + 2 + + + + + Sends a default validate tan message to the csm-service. + + false + + false + + 171043534d5f56414c49444154455f54414e09000000b600010354414e000000040368298f010207434152445f4e520000000877d430b29cff1fd1020208353950414e5f494400000002080003010c4150505f4558505f44415445000000031012318a020756455253494f4e000000010005030a53544f5245445f4154430000000200040602044d4f4445000000010007020a444154415f494e505554000000010108020444415441000000207f67e7edbc5c484e4ec3f2f1c38a6f459db6fda69b9ced2f3a5449d07a6bb9a0 + false + + + + + + + 2d0200000000 + 43534d5f56414c49444154455f54414e0000000000 + + The response of the validate tan request should meet the following requirements: + +- should start with 2d0200000000, this indicates the operation was unsuccessful +- should contain 43534d5f56414c49444154455f54414e0000000000, this indicates an empty CSM_VALIDATE_TAN response + The return status of the validate tan response does not indicate success. + Assertion.response_data + false + 2 + + + + + + continue + + false + -1 + + ${DefaultThreadCount} + 1 + false + + + false + Sends ONL_VALIDATE_TAN messages to the selected environment. This does not send a MAC in the request. + true + + + + Sends a default online validate tan message without mac to the csm-service. + + false + + false + + 17104f4e4c5f56414c49444154455f54414e03000000f75002064b45595f49440000000303000151020952414e444f4d5f4e52000000100708090a0b0c0d0e0f1011121314151652020b434f4d4d414e445f524551000000b5171043534d5f56414c49444154455f54414e090000009e00010354414e000000040323692f010207434152445f4e52000000080000000055228272020208353950414e5f494400000002030003010c4150505f4558505f444154450000000317123104020756455253494f4e000000010005030a53544f5245445f4154430000000200030602044d4f4445000000010007020a444154415f494e5055540000000100080204444154410000000854321f6138303132 + false + + + + + + + 2d0000000000 + 535441545553000000010001 + 472d0000000000 + 415443000000020004 + + The response of the validate tan request should meet the following requirements: + +- should start with 2d0000000000, this indicates the operation was successful +- should contain 472d0000000000, this indicates the inner operation was successful +- should contain 535441545553000000010001, this translates to "STATUS = 0" (eg. tan is valid) +- should contain 415443000000020004, this translates to "ATC = 4" (eg. end of message) + The return status of the online validate tan response does not indicate success. + Assertion.response_data + false + 2 + + + + + + continue + + false + -1 + + ${DefaultThreadCount} + 1 + false + + + false + Sends ONL_VALIDATE_TAN messages to the selected environment. This does send a MAC in the request. + true + + + + Sends a default online validate tan message with mac to the csm-service. + + false + + false + + 17104f4e4c5f56414c49444154455f54414e04000001035002064b45595f49440000000306000151020952414e444f4d5f4e52000000102576ea7e70e09faa1fac7fb24bf581a952020b434f4d4d414e445f524551000000b3171043534d5f56414c49444154455f54414e090000009c00010354414e000000041487891f010207434152445f4e52000000080000000055276781020208353950414e5f494400000002080003010c4150505f4558505f444154450000000321123104020756455253494f4e000000010005030a53544f5245445f4154430000000200850602044d4f4445000000010107020a444154415f494e5055540000000100080204444154410000000699887f0124795302034d4143000000043e08c552 + false + + + + + + + 2d0000000000 + 535441545553000000010001 + 472d0000000000 + 4d414300000004 + + The response of the validate tan request should meet the following requirements: + +- should start with 2d0000000000, this indicates the operation was successful +- should contain 472d0000000000, this indicates the inner operation was successful +- should contain 535441545553000000010001, this translates to "STATUS = 0" (eg. tan is valid) +- should contain 4d414300000004, this is the parameter name MAC (4d 41 43) and mac size (00 00 00 04) / because MAC is random, this is the closest check to ensure the full response was received + The return status of the online validate tan response does not indicate success. + Assertion.response_data + false + 2 + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + Overall view of the results. + +WARNING: Stopping the test usually leads to a few errors, as their respective assertions fail on abort. + + + + + true + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + Show the messages that returned non-success. + +Usually some errors will appear here once the test run is stopped. Keep that in mind when error rate is relevant to your tests. This is caused by the response assertion failing on aborted messages. + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + Graph to show response times over time. + + 1000 + Response time in 1 second steps + 1 + 4 + + + + + diff --git a/csm/CsmServiceJMeterTests.properties b/csm/CsmServiceJMeterTests.properties new file mode 100644 index 00000000000..eae5cded87f --- /dev/null +++ b/csm/CsmServiceJMeterTests.properties @@ -0,0 +1,75 @@ +# Sample user.properties file +# +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You 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. + +#--------------------------------------------------------------------------- +# Classpath configuration +#--------------------------------------------------------------------------- +# +# List of paths (separated by ;) to search for additional JMeter plugin classes, +# for example new GUI elements and samplers. +# A path item can either be a jar file or a directory. +# Any jar file in such a directory will be automatically included, +# jar files in sub directories are ignored. +# The given value is in addition to any jars found in the lib/ext directory. +# Do not use this for utility ir plugin dependecy jars. +#search_paths=/app1/lib;/app2/lib + +# List of paths that JMeter will search for utility and plugin dependency classes. +# Use your platform path separator to separate multiple paths. +# A path item can either be a jar file or a directory. +# Any jar file in such a directory will be automatically included, +# jar files in sub directories are ignored. +# The given value is in addition to any jars found in the lib directory. +# All entries will be added to the class path of the system class loader +# and also to the path of the JMeter internal loader. +# Paths with spaces may cause problems for the JVM +#user.classpath=../classes;../lib;../app1/jar1.jar;../app2/jar2.jar + +# List of paths (separated by ;) that JMeter will search for utility +# and plugin dependency classes. +# A path item can either be a jar file or a directory. +# Any jar file in such a directory will be automatically included, +# jar files in sub directories are ignored. +# The given value is in addition to any jars found in the lib directory +# or given by the user.classpath property. +# All entries will be added to the path of the JMeter internal loader only. +# For plugin dependencies using plugin_dependency_paths should be preferred over +# user.classpath. +#plugin_dependency_paths=../dependencies/lib;../app1/jar1.jar;../app2/jar2.jar + +#--------------------------------------------------------------------------- +# Logging configuration +#--------------------------------------------------------------------------- +#log_level.jorphan.reflect=DEBUG +# Warning: enabling the next debug line causes javax.net.ssl.SSLException: Received fatal alert: unexpected_message +# for certain sites when used with the default HTTP Sampler +#log_level.jmeter.util.HttpSSLProtocolSocketFactory=DEBUG +#log_level.jmeter.util.JsseSSLManager=DEBUG + +# Enable Proxy request debug +#log_level.jmeter.protocol.http.proxy.HttpRequestHdr=DEBUG + + + +#The eomByte is really tricky. +#It gets compared with and is also assigned to a Java byte type. +#A Java byte type is signed and has a range from -128 to 127. +#Although it is a binary type, the eomByte must be given as a decimal number between -128 and 127. +#If you want an eomByte of 0xFF, then you have to use -128. +#If you want an eomByte of 0x84, which is 132, you have to use -124. +tcp.BinaryTCPClient.eomByte=4 +tcp.BinaryTCPClient.eomBytePositionFromEnd=5 \ No newline at end of file diff --git a/csm/CsmServiceJMeterTests.ps1 b/csm/CsmServiceJMeterTests.ps1 new file mode 100644 index 00000000000..09fa09bc770 --- /dev/null +++ b/csm/CsmServiceJMeterTests.ps1 @@ -0,0 +1,32 @@ +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + +param( + [string]$JMeterExe = "$PSScriptRoot\apache-jmeter-5.6.3\bin\jmeter.bat" +) + +# Validate JMeter executable +if (-not (Test-Path -Path $JMeterExe -PathType Leaf)) { + Write-Error "JMeter executable not found at '$JMeterExe'" + exit 1 +} + +#$PSScriptRoot is the path of the current script +$arguments = @() +$arguments += "--addprop $PSScriptRoot\CsmServiceJMeterTests.properties" +$arguments += "--testfile $PSScriptRoot\CsmServiceJMeterTests.jmx" + +Start-Process -FilePath $JMeterExe -ArgumentList $arguments -NoNewWindow \ No newline at end of file diff --git a/csm/CsmServiceJMeterTests.sh b/csm/CsmServiceJMeterTests.sh new file mode 100644 index 00000000000..3fd28d4de92 --- /dev/null +++ b/csm/CsmServiceJMeterTests.sh @@ -0,0 +1,29 @@ +#! /bin/bash + +# Copyright 2015 the original author or authors. +# Licensed under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0) + +# Set the script root directory (directory of this script) +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Path to JMeter executable: use first argument if provided, otherwise fall back to default +JMETER_BIN="${1:-/home/johannes/dev/jmeter/bin/jmeter.sh}" + +# Validate JMeter executable +if [[ ! -f "$JMETER_BIN" ]]; then + echo "Error: JMeter executable not found at '$JMETER_BIN'" >&2 + exit 1 +fi + +if [[ ! -x "$JMETER_BIN" ]]; then + echo "Error: JMeter executable at '$JMETER_BIN' is not executable" >&2 + exit 1 +fi + +# Arguments +ARGUMENTS=() +ARGUMENTS+=("--addprop" "$SCRIPT_DIR/CsmServiceJMeterTests.properties") +ARGUMENTS+=("--testfile" "$SCRIPT_DIR/CsmServiceJMeterTests.jmx") + +# Execute JMeter +"$JMETER_BIN" "${ARGUMENTS[@]}" \ No newline at end of file