diff options
author | Scott Seabolt <js9808@att.com> | 2018-03-09 22:55:58 -0500 |
---|---|---|
committer | Scott Seabolt <js9808@att.com> | 2018-03-09 22:57:02 -0500 |
commit | 89e2e616734c565ed204f7b3847c1ff279f615c5 (patch) | |
tree | 930a214c77e62b00c578b6267a60ce689c0e11aa | |
parent | 439954be802b246cb0f89ee7347d167419526f9d (diff) |
Adding Stab JMeter jmx
Issue-ID: APPC-456
Change-Id: I16e7c18a503ddb8aeb2ee5d6bf126e83e49e3e9b
Signed-off-by: Scott Seabolt <js9808@att.com>
-rw-r--r-- | JMeter/APPC-LCM-Action-V1.jmx | 3131 | ||||
-rw-r--r-- | JMeter/appc-lcm-test-Stability-Test-VM2.csv | 1 | ||||
-rw-r--r-- | JMeter/appc-lcm-test-Stability-Test-VM3.csv | 1 | ||||
-rw-r--r-- | JMeter/appc-lcm-test.csv | 1 | ||||
-rw-r--r-- | JMeter/log_covert.py | 59 |
5 files changed, 3193 insertions, 0 deletions
diff --git a/JMeter/APPC-LCM-Action-V1.jmx b/JMeter/APPC-LCM-Action-V1.jmx new file mode 100644 index 0000000..8cda521 --- /dev/null +++ b/JMeter/APPC-LCM-Action-V1.jmx @@ -0,0 +1,3131 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +============LICENSE_START========================================== +ONAP : APPC +=================================================================== +Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. +=================================================================== + +Unless otherwise specified, all software contained herein is licensed +under the Apache License, Version 2.0 (the License); +you may not use this software 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. + +ECOMP is a trademark and service mark of AT&T Intellectual Property. +============LICENSE_END============================================ +--> +<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414"> + <hashTree> + <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true"> + <stringProp name="TestPlan.comments"></stringProp> + <boolProp name="TestPlan.functional_mode">false</boolProp> + <boolProp name="TestPlan.serialize_threadgroups">false</boolProp> + <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="TestPlan.user_define_classpath"></stringProp> + </TestPlan> + <hashTree> + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Stability-Test-VM1 LCM Group" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">1</stringProp> + <stringProp name="ThreadGroup.ramp_time">1</stringProp> + <longProp name="ThreadGroup.start_time">1518473958000</longProp> + <longProp name="ThreadGroup.end_time">1518473958000</longProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"></stringProp> + <stringProp name="ThreadGroup.delay"></stringProp> + </ThreadGroup> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="RequestNumber" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">request_number</stringProp> + <stringProp name="CounterConfig.format">000</stringProp> + <boolProp name="CounterConfig.per_user">false</boolProp> + </CounterConfig> + <hashTree/> + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true"> + <stringProp name="delimiter">,</stringProp> + <stringProp name="fileEncoding"></stringProp> + <stringProp name="filename">appc-lcm-test.csv</stringProp> + <boolProp name="ignoreFirstLine">false</boolProp> + <boolProp name="quotedData">false</boolProp> + <boolProp name="recycle">true</boolProp> + <stringProp name="shareMode">shareMode.all</stringProp> + <boolProp name="stopThread">true</boolProp> + <stringProp name="variableNames">dmaap_ip,dmaap_topic_post,dmaap_topic_get,vnf_id,vm_id</stringProp> + </CSVDataSet> + <hashTree/> + <ConfigTestElement guiclass="SimpleConfigGui" testclass="ConfigTestElement" testname="Simple Config Element" enabled="true"/> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>false</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="false"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">3</stringProp> + </LoopController> + <hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Restart Transaction Controller" enabled="false"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">vars.put("RESTART_ACCEPTED","WAITING"); + +StringBuilder timestamp = new StringBuilder(); +//ISO_FORMAT "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Restart HTTP Request" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "restart",
 + "correlation-id": "${request_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${__time(yyyy-MM-dd'T'hh:mm:ss.SSS)}Z",
 + "api-ver": "2.05",
 + "originator-id": "${request_id}",
 + "request-id": "${request_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Restart",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/799ea611-bb36-4e49-b043-964f20c442d5\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-READ</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor - ReqeustJSON Generator" enabled="true"> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="script">StringBuilder result = new StringBuilder(); +String newline = System.getProperty("line.separator"); +//int max = Integer.parseInt(Parameters); +//Random random = new Random(); + +//int counter = Integer.parseInt(vars.get("request-id")); + +result.append("{"); +//result.append("\"version\": \"2.01\","); +//result.append("\"rpc-name\": \"restart\","); +//result.append("\"correlation-id\": \"a20e2073-30b1-4357-893b-f5ed57b66ef0-1\","); +//result.append(newline); +//result.append("\"type\": \"request\","); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("\"body\": {"); +//result.append(newline); +//result.append("\"input\": {"); +//result.append(newline); +//result.append("\"common-header\": {"); +//result.append(newline); +//result.append("\"timestamp\": \"2018-2-12T21:25:04.244Z\","); +//result.append(newline); +//result.append("\"api-ver\": \"2.05\","); +//result.append(newline); +//result.append("\"originator-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"request-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"sub-request-id\": \"1\","); +//result.append(newline); +//result.append("\"flags\": {"); +//result.append(newline); +//result.append("\"force\": \"TRUE\","); +//result.append(newline); +//result.append("\"ttl\": 60000"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("},"); +//result.append(newline); +//result.append("\"action\": \"Restart\","); +//result.append(newline); +//result.append("\"action-identifiers\": {"); +//result.append(newline); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +result.append(newline); +result.append("}"); + +vars.put("json",result.toString());</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${RESTART_ACCEPTED}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">false</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Restart HTTP Accepted" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${request_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-WRITE/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("request_id"); + +log.info("Restart " + requestId + " acceptance response = " + jsonMessage); + +if(jsonMessage != "WAITING"){ + vars.put("RESTART_ACCEPTED",jsonMessage); +} + </stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + <RandomController guiclass="RandomControlGui" testclass="RandomController" testname="Random Controller" enabled="true"> + <intProp name="InterleaveControl.style">1</intProp> + </RandomController> + <hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Restart Transaction Controller" enabled="true"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Submit request via DMaaP" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "restart",
 + "correlation-id": "${transaction_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${reqeust_timestamp}",
 + "api-ver": "2.05",
 + "originator-id": "${transaction_id}",
 + "request-id": "${transaction_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Restart",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/799ea611-bb36-4e49-b043-964f20c442d5\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_post}</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">import java.text.SimpleDateFormat; + +String ISO_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; +SimpleDateFormat isoFormatter = new SimpleDateFormat(ISO_FORMAT); +isoFormatter.setTimeZone(TimeZone.getTimeZone("UTC")); + +Calendar currentTime = Calendar.getInstance(); + +String timeStampZuluStr = isoFormatter.format(currentTime.getTime()); +vars.put("reqeust_timestamp",timeStampZuluStr); +vars.put("action_accepted","WAITING"); +vars.put("action_completed","WAITING"); +vars.put("accepted_retry_limit","3"); +vars.put("completed_retry_limit","20"); +vars.put("transaction_id",timeStampZuluStr + "-" + ${__threadNum} + "-" + vars.get("request_number")); + +log.info(vars.get("reqeust_timestamp") + " Begin Restart transaction : " + vars.get("transaction_id"));</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">3000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SYNC(accepted/rejectd) response via DMaaP" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${transaction_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("acceptance_retry")); +int limit = Integer.parseInt(vars.get("accepted_retry_limit")); + +log.info("Restart " + requestId + " acceptance response = " + jsonMessage + " attempt = " + retries); +log.info("action_accepted=" + vars.get("action_accepted")); +log.info("action_completed=" + vars.get("action_completed")); + +if(jsonMessage != "WAITING"){ + log.info("Received accepted response of '" + jsonMessage + "' for " + requestId); + vars.put("action_accepted",jsonMessage); +}else if(retries >= limit){ + log.info("Reached maximum retries waiting for Accepted response for transaction " + requestId); + vars.put("action_accepted","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Final Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="ACCEPTED - request accepted" && "${action_completed}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">10000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="completed_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">completed_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="ASYNC(completed) response via DMaaP " enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">finished_message</stringProp> + <stringProp name="RegexExtractor.regex">"reason\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("finished_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("completed_retry")); +int limit = Integer.parseInt(vars.get("completed_retry_limit")); + +log.info("Restart " + requestId + " completed response = " + jsonMessage + " attempt = " + retries); + +if(jsonMessage != "WAITING"){ + vars.put("action_completed",jsonMessage); +}else if(retries >= limit){ + vars.put("action_completed","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Stability-Test-VM2 LCM Group" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">1</stringProp> + <stringProp name="ThreadGroup.ramp_time">1</stringProp> + <longProp name="ThreadGroup.start_time">1518473958000</longProp> + <longProp name="ThreadGroup.end_time">1518473958000</longProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"></stringProp> + <stringProp name="ThreadGroup.delay"></stringProp> + </ThreadGroup> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="RequestNumber" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">request_number</stringProp> + <stringProp name="CounterConfig.format">000</stringProp> + <boolProp name="CounterConfig.per_user">false</boolProp> + </CounterConfig> + <hashTree/> + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true"> + <stringProp name="delimiter">,</stringProp> + <stringProp name="fileEncoding"></stringProp> + <stringProp name="filename">/home/ubuntu/appc-lcm-test-Stability-Test-VM2.csv</stringProp> + <boolProp name="ignoreFirstLine">false</boolProp> + <boolProp name="quotedData">false</boolProp> + <boolProp name="recycle">true</boolProp> + <stringProp name="shareMode">shareMode.all</stringProp> + <boolProp name="stopThread">true</boolProp> + <stringProp name="variableNames">dmaap_ip,dmaap_topic_post,dmaap_topic_get,vnf_id,vm_id</stringProp> + </CSVDataSet> + <hashTree/> + <ConfigTestElement guiclass="SimpleConfigGui" testclass="ConfigTestElement" testname="Simple Config Element" enabled="true"/> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>false</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Stop Loop Controller" enabled="false"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">3</stringProp> + </LoopController> + <hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Stop Transaction Controller" enabled="false"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">vars.put("STOP_ACCEPTED","WAITING"); + +StringBuilder timestamp = new StringBuilder(); +//ISO_FORMAT "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Stop HTTP Request" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "stop",
 + "correlation-id": "${request_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${__time(yyyy-MM-dd'T'hh:mm:ss.SSS)}Z",
 + "api-ver": "2.05",
 + "originator-id": "${request_id}",
 + "request-id": "${request_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Stop",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/c0d9b8c7-9534-4a22-b464-d6aa2c930847\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-READ</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor - ReqeustJSON Generator" enabled="true"> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="script">StringBuilder result = new StringBuilder(); +String newline = System.getProperty("line.separator"); +//int max = Integer.parseInt(Parameters); +//Random random = new Random(); + +//int counter = Integer.parseInt(vars.get("request-id")); + +result.append("{"); +//result.append("\"version\": \"2.01\","); +//result.append("\"rpc-name\": \"restart\","); +//result.append("\"correlation-id\": \"a20e2073-30b1-4357-893b-f5ed57b66ef0-1\","); +//result.append(newline); +//result.append("\"type\": \"request\","); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("\"body\": {"); +//result.append(newline); +//result.append("\"input\": {"); +//result.append(newline); +//result.append("\"common-header\": {"); +//result.append(newline); +//result.append("\"timestamp\": \"2018-2-12T21:25:04.244Z\","); +//result.append(newline); +//result.append("\"api-ver\": \"2.05\","); +//result.append(newline); +//result.append("\"originator-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"request-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"sub-request-id\": \"1\","); +//result.append(newline); +//result.append("\"flags\": {"); +//result.append(newline); +//result.append("\"force\": \"TRUE\","); +//result.append(newline); +//result.append("\"ttl\": 60000"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("},"); +//result.append(newline); +//result.append("\"action\": \"Restart\","); +//result.append(newline); +//result.append("\"action-identifiers\": {"); +//result.append(newline); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +result.append(newline); +result.append("}"); + +vars.put("json",result.toString());</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${STOP_ACCEPTED}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">false</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Stop HTTP Accepted" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${request_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-WRITE/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("request_id"); + +log.info("Stop " + requestId + " acceptance response = " + jsonMessage); + +if(jsonMessage != "WAITING"){ + vars.put("STOP_ACCEPTED",jsonMessage); +} + </stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Start Loop Controller" enabled="false"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">3</stringProp> + </LoopController> + <hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Start Transaction Controller" enabled="false"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">vars.put("START_ACCEPTED","WAITING"); + +StringBuilder timestamp = new StringBuilder(); +//ISO_FORMAT "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Start HTTP Request" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "start",
 + "correlation-id": "${request_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${__time(yyyy-MM-dd'T'hh:mm:ss.SSS)}Z",
 + "api-ver": "2.05",
 + "originator-id": "${request_id}",
 + "request-id": "${request_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Start",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/c0d9b8c7-9534-4a22-b464-d6aa2c930847\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-READ</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor - ReqeustJSON Generator" enabled="true"> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="script">StringBuilder result = new StringBuilder(); +String newline = System.getProperty("line.separator"); +//int max = Integer.parseInt(Parameters); +//Random random = new Random(); + +//int counter = Integer.parseInt(vars.get("request-id")); + +result.append("{"); +//result.append("\"version\": \"2.01\","); +//result.append("\"rpc-name\": \"restart\","); +//result.append("\"correlation-id\": \"a20e2073-30b1-4357-893b-f5ed57b66ef0-1\","); +//result.append(newline); +//result.append("\"type\": \"request\","); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("\"body\": {"); +//result.append(newline); +//result.append("\"input\": {"); +//result.append(newline); +//result.append("\"common-header\": {"); +//result.append(newline); +//result.append("\"timestamp\": \"2018-2-12T21:25:04.244Z\","); +//result.append(newline); +//result.append("\"api-ver\": \"2.05\","); +//result.append(newline); +//result.append("\"originator-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"request-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"sub-request-id\": \"1\","); +//result.append(newline); +//result.append("\"flags\": {"); +//result.append(newline); +//result.append("\"force\": \"TRUE\","); +//result.append(newline); +//result.append("\"ttl\": 60000"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("},"); +//result.append(newline); +//result.append("\"action\": \"Restart\","); +//result.append(newline); +//result.append("\"action-identifiers\": {"); +//result.append(newline); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +result.append(newline); +result.append("}"); + +vars.put("json",result.toString());</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${START_ACCEPTED}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">false</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Restart HTTP Accepted" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${request_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-WRITE/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("request_id"); + +log.info("Start " + requestId + " acceptance response = " + jsonMessage); + +if(jsonMessage != "WAITING"){ + vars.put("START_ACCEPTED",jsonMessage); +} + </stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + <RandomController guiclass="RandomControlGui" testclass="RandomController" testname="Random Controller" enabled="true"> + <intProp name="InterleaveControl.style">1</intProp> + </RandomController> + <hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Stop Transaction Controller" enabled="true"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Submit request via DMaaP" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "stop",
 + "correlation-id": "${transaction_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${reqeust_timestamp}",
 + "api-ver": "2.05",
 + "originator-id": "${transaction_id}",
 + "request-id": "${transaction_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Stop",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/c0d9b8c7-9534-4a22-b464-d6aa2c930847\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_post}</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">import java.text.SimpleDateFormat; + +String ISO_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; +SimpleDateFormat isoFormatter = new SimpleDateFormat(ISO_FORMAT); +isoFormatter.setTimeZone(TimeZone.getTimeZone("UTC")); + +Calendar currentTime = Calendar.getInstance(); + +String timeStampZuluStr = isoFormatter.format(currentTime.getTime()); +vars.put("reqeust_timestamp",timeStampZuluStr); +vars.put("action_accepted","WAITING"); +vars.put("action_completed","WAITING"); +vars.put("accepted_retry_limit","3"); +vars.put("completed_retry_limit","20"); +vars.put("transaction_id",timeStampZuluStr + "-" + ${__threadNum} + "-" + vars.get("request_number")); + +log.info(vars.get("reqeust_timestamp") + " Begin Stop transaction : " + vars.get("transaction_id"));</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">3000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SYNC(accepted/rejectd) response via DMaaP" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${transaction_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("acceptance_retry")); +int limit = Integer.parseInt(vars.get("accepted_retry_limit")); + +log.info("Stop " + requestId + " acceptance response = " + jsonMessage + " attempt = " + retries); +log.info("action_accepted=" + vars.get("action_accepted")); +log.info("action_completed=" + vars.get("action_completed")); + +if(jsonMessage != "WAITING"){ + log.info("Received accepted response of '" + jsonMessage + "' for " + requestId); + vars.put("action_accepted",jsonMessage); +}else if(retries >= limit){ + log.info("Reached maximum retries waiting for Accepted response for transaction " + requestId); + vars.put("action_accepted","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Final Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="ACCEPTED - request accepted" && "${action_completed}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">10000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="completed_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">completed_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="ASYNC(completed) response via DMaaP " enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">finished_message</stringProp> + <stringProp name="RegexExtractor.regex">"reason\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("finished_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("completed_retry")); +int limit = Integer.parseInt(vars.get("completed_retry_limit")); + +log.info("Stop " + requestId + " completed response = " + jsonMessage + " attempt = " + retries); + +if(jsonMessage != "WAITING"){ + vars.put("action_completed",jsonMessage); +}else if(retries >= limit){ + vars.put("action_completed","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Start Transaction Controller" enabled="true"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Submit request via DMaaP" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "start",
 + "correlation-id": "${transaction_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${reqeust_timestamp}",
 + "api-ver": "2.05",
 + "originator-id": "${transaction_id}",
 + "request-id": "${transaction_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Start",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/c0d9b8c7-9534-4a22-b464-d6aa2c930847\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_post}</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">import java.text.SimpleDateFormat; + +String ISO_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; +SimpleDateFormat isoFormatter = new SimpleDateFormat(ISO_FORMAT); +isoFormatter.setTimeZone(TimeZone.getTimeZone("UTC")); + +Calendar currentTime = Calendar.getInstance(); + +String timeStampZuluStr = isoFormatter.format(currentTime.getTime()); +vars.put("reqeust_timestamp",timeStampZuluStr); +vars.put("action_accepted","WAITING"); +vars.put("action_completed","WAITING"); +vars.put("accepted_retry_limit","3"); +vars.put("completed_retry_limit","20"); +vars.put("transaction_id",timeStampZuluStr + "-" + ${__threadNum} + "-" + vars.get("request_number")); + +log.info(vars.get("reqeust_timestamp") + " Begin Start transaction : " + vars.get("transaction_id"));</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">3000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SYNC(accepted/rejectd) response via DMaaP" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${transaction_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("acceptance_retry")); +int limit = Integer.parseInt(vars.get("accepted_retry_limit")); + +log.info("Start " + requestId + " acceptance response = " + jsonMessage + " attempt = " + retries); +log.info("action_accepted=" + vars.get("action_accepted")); +log.info("action_completed=" + vars.get("action_completed")); + +if(jsonMessage != "WAITING"){ + log.info("Received accepted response of '" + jsonMessage + "' for " + requestId); + vars.put("action_accepted",jsonMessage); +}else if(retries >= limit){ + log.info("Reached maximum retries waiting for Accepted response for transaction " + requestId); + vars.put("action_accepted","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Final Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="ACCEPTED - request accepted" && "${action_completed}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">10000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="completed_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">completed_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="ASYNC(completed) response via DMaaP " enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">finished_message</stringProp> + <stringProp name="RegexExtractor.regex">"reason\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("finished_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("completed_retry")); +int limit = Integer.parseInt(vars.get("completed_retry_limit")); + +log.info("Start " + requestId + " completed response = " + jsonMessage + " attempt = " + retries); + +if(jsonMessage != "WAITING"){ + vars.put("action_completed",jsonMessage); +}else if(retries >= limit){ + vars.put("action_completed","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Stability-Test-VM3 LCM Group" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">1</stringProp> + <stringProp name="ThreadGroup.ramp_time">1</stringProp> + <longProp name="ThreadGroup.start_time">1518473958000</longProp> + <longProp name="ThreadGroup.end_time">1518473958000</longProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"></stringProp> + <stringProp name="ThreadGroup.delay"></stringProp> + </ThreadGroup> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="RequestNumber" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">request_number</stringProp> + <stringProp name="CounterConfig.format">000</stringProp> + <boolProp name="CounterConfig.per_user">false</boolProp> + </CounterConfig> + <hashTree/> + <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true"> + <stringProp name="delimiter">,</stringProp> + <stringProp name="fileEncoding"></stringProp> + <stringProp name="filename">/home/ubuntu/appc-lcm-test-Stability-Test-VM3.csv</stringProp> + <boolProp name="ignoreFirstLine">false</boolProp> + <boolProp name="quotedData">false</boolProp> + <boolProp name="recycle">true</boolProp> + <stringProp name="shareMode">shareMode.all</stringProp> + <boolProp name="stopThread">true</boolProp> + <stringProp name="variableNames">dmaap_ip,dmaap_topic_post,dmaap_topic_get,vnf_id,vm_id</stringProp> + </CSVDataSet> + <hashTree/> + <ConfigTestElement guiclass="SimpleConfigGui" testclass="ConfigTestElement" testname="Simple Config Element" enabled="true"/> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>false</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Rebuild Loop Controller" enabled="false"> + <boolProp name="LoopController.continue_forever">true</boolProp> + <stringProp name="LoopController.loops">3</stringProp> + </LoopController> + <hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Rebuild Transaction Controller" enabled="false"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">vars.put("REBUILD_ACCEPTED","WAITING"); + +StringBuilder timestamp = new StringBuilder(); +//ISO_FORMAT "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Rebuild HTTP Request" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "rebuild",
 + "correlation-id": "${request_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${__time(yyyy-MM-dd'T'hh:mm:ss.SSS)}Z",
 + "api-ver": "2.05",
 + "originator-id": "${request_id}",
 + "request-id": "${request_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Rebuild",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/3b3d77e0-a79d-4c10-bfac-1b3914af1a14\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-READ</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor - ReqeustJSON Generator" enabled="true"> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="script">StringBuilder result = new StringBuilder(); +String newline = System.getProperty("line.separator"); +//int max = Integer.parseInt(Parameters); +//Random random = new Random(); + +//int counter = Integer.parseInt(vars.get("request-id")); + +result.append("{"); +//result.append("\"version\": \"2.01\","); +//result.append("\"rpc-name\": \"restart\","); +//result.append("\"correlation-id\": \"a20e2073-30b1-4357-893b-f5ed57b66ef0-1\","); +//result.append(newline); +//result.append("\"type\": \"request\","); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("\"body\": {"); +//result.append(newline); +//result.append("\"input\": {"); +//result.append(newline); +//result.append("\"common-header\": {"); +//result.append(newline); +//result.append("\"timestamp\": \"2018-2-12T21:25:04.244Z\","); +//result.append(newline); +//result.append("\"api-ver\": \"2.05\","); +//result.append(newline); +//result.append("\"originator-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"request-id\": \"664be3d2-6c12-4f4b-a3e7-c349acced200\","); +//result.append(newline); +//result.append("\"sub-request-id\": \"1\","); +//result.append(newline); +//result.append("\"flags\": {"); +//result.append(newline); +//result.append("\"force\": \"TRUE\","); +//result.append(newline); +//result.append("\"ttl\": 60000"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("},"); +//result.append(newline); +//result.append("\"action\": \"Restart\","); +//result.append(newline); +//result.append("\"action-identifiers\": {"); +//result.append(newline); +//result.append("\"vnf-id\": \"APPC_Test_VM\""); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +//result.append(newline); +//result.append("}"); +result.append(newline); +result.append("}"); + +vars.put("json",result.toString());</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${REBUILD_ACCEPTED}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">false</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Restart HTTP Accepted" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${request_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">10.12.5.252</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/APPC-LCM-WRITE/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("request_id"); + +log.info("Rebuild " + requestId + " acceptance response = " + jsonMessage); + +if(jsonMessage != "WAITING"){ + vars.put("REBUILD_ACCEPTED",jsonMessage); +} + </stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + <RandomController guiclass="RandomControlGui" testclass="RandomController" testname="Random Controller" enabled="true"> + <intProp name="InterleaveControl.style">1</intProp> + </RandomController> + <hashTree> + <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="Rebuild Transaction Controller" enabled="true"> + <boolProp name="TransactionController.includeTimers">false</boolProp> + <boolProp name="TransactionController.parent">false</boolProp> + </TransactionController> + <hashTree> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Submit request via DMaaP" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "version": "2.01",
 + "rpc-name": "rebuild",
 + "correlation-id": "${transaction_id}",
 + "type": "request",
 + "body": {
 + "input": {
 + "common-header": {
 + "timestamp": "${reqeust_timestamp}",
 + "api-ver": "2.05",
 + "originator-id": "${transaction_id}",
 + "request-id": "${transaction_id}",
 + "sub-request-id": "1",
 + "flags": {
 + "force": "TRUE",
 + "ttl": 60000
 + }
 + },
 + "action": "Rebuild",
 + "action-identifiers": {
 + "vnf-id": "${vnf_id}",
 + "vserver-id": "${vm-id}"
 + },
 + "payload": "{\"vm-id\":\"http://10.12.25.2:8774/v2.1/cf142fb96ce24770946c0f7117c0aeb3/servers/3b3d77e0-a79d-4c10-bfac-1b3914af1a14\", \"identity-url\": \"http://10.12.25.2:5000/v2.0\",\"skip-hypervisor-check\":\"true\"}"
 + }
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_post}</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="BeanShell PreProcessor" enabled="true"> + <boolProp name="resetInterpreter">false</boolProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="script">import java.text.SimpleDateFormat; + +String ISO_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; +SimpleDateFormat isoFormatter = new SimpleDateFormat(ISO_FORMAT); +isoFormatter.setTimeZone(TimeZone.getTimeZone("UTC")); + +Calendar currentTime = Calendar.getInstance(); + +String timeStampZuluStr = isoFormatter.format(currentTime.getTime()); +vars.put("reqeust_timestamp",timeStampZuluStr); +vars.put("action_accepted","WAITING"); +vars.put("action_completed","WAITING"); +vars.put("accepted_retry_limit","3"); +vars.put("completed_retry_limit","20"); +vars.put("transaction_id",timeStampZuluStr + "-" + ${__threadNum} + "-" + vars.get("request_number")); + +log.info(vars.get("reqeust_timestamp") + " Begin Restart transaction : " + vars.get("transaction_id"));</stringProp> + </BeanShellPreProcessor> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Accepted Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">3000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="acceptance_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">acceptance_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SYNC(accepted/rejectd) response via DMaaP" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"> + <elementProp name="filter" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">true</boolProp> + <stringProp name="Argument.value">{"class":"Equals","field":"correlation-id","value":"${transaction_id}"}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + <boolProp name="HTTPArgument.use_equals">true</boolProp> + <stringProp name="Argument.name">filter</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="Acceptance JSON Extractor" enabled="true"> + <stringProp name="JSONPostProcessor.referenceNames">accept_message_old</stringProp> + <stringProp name="JSONPostProcessor.jsonPathExprs">$.body.output.status.message</stringProp> + <stringProp name="JSONPostProcessor.match_numbers"></stringProp> + <stringProp name="JSONPostProcessor.defaultValues">WAITING</stringProp> + </JSONPostProcessor> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">accept_message</stringProp> + <stringProp name="RegexExtractor.regex">"message\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("accept_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("acceptance_retry")); +int limit = Integer.parseInt(vars.get("accepted_retry_limit")); + +log.info("Rebuild " + requestId + " acceptance response = " + jsonMessage + " attempt = " + retries); +log.info("action_accepted=" + vars.get("action_accepted")); +log.info("action_completed=" + vars.get("action_completed")); + +if(jsonMessage != "WAITING"){ + log.info("Received accepted response of '" + jsonMessage + "' for " + requestId); + vars.put("action_accepted",jsonMessage); +}else if(retries >= limit){ + log.info("Reached maximum retries waiting for Accepted response for transaction " + requestId); + vars.put("action_accepted","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="Wait for Final Response via DMaaP" enabled="true"> + <stringProp name="WhileController.condition">${__javaScript("${action_accepted}"=="ACCEPTED - request accepted" && "${action_completed}"=="WAITING")}</stringProp> + </WhileController> + <hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">10000</stringProp> + </ConstantTimer> + <hashTree/> + <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="completed_retry" enabled="true"> + <stringProp name="CounterConfig.start">1</stringProp> + <stringProp name="CounterConfig.end"></stringProp> + <stringProp name="CounterConfig.incr">1</stringProp> + <stringProp name="CounterConfig.name">completed_retry</stringProp> + <stringProp name="CounterConfig.format"></stringProp> + <boolProp name="CounterConfig.per_user">true</boolProp> + <boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp> + </CounterConfig> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="ASYNC(completed) response via DMaaP " enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${dmaap_ip}</stringProp> + <stringProp name="HTTPSampler.port">3904</stringProp> + <stringProp name="HTTPSampler.protocol">http</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/events/${dmaap_topic_get}/appc-jmeter/${__threadNum}</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true"> + <stringProp name="RegexExtractor.useHeaders">false</stringProp> + <stringProp name="RegexExtractor.refname">finished_message</stringProp> + <stringProp name="RegexExtractor.regex">"reason\\":\\"(.*?)\\"</stringProp> + <stringProp name="RegexExtractor.template">$1$</stringProp> + <stringProp name="RegexExtractor.default">WAITING</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> + </RegexExtractor> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="Acceptance JSR223 Assertion" enabled="true"> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="script">String jsonMessage = vars.get("finished_message"); +String requestId = vars.get("transaction_id"); +int retries = Integer.parseInt(vars.get("completed_retry")); +int limit = Integer.parseInt(vars.get("completed_retry_limit")); + +log.info("Rebuild " + requestId + " completed response = " + jsonMessage + " attempt = " + retries); + +if(jsonMessage != "WAITING"){ + vars.put("action_completed",jsonMessage); +}else if(retries >= limit){ + vars.put("action_completed","TIMEOUT"); +} + +</stringProp> + <stringProp name="scriptLanguage">groovy</stringProp> + </JSR223Assertion> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename"></stringProp> + </ResultCollector> + <hashTree/> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> + </hashTree> +</jmeterTestPlan> diff --git a/JMeter/appc-lcm-test-Stability-Test-VM2.csv b/JMeter/appc-lcm-test-Stability-Test-VM2.csv new file mode 100644 index 0000000..fd573ac --- /dev/null +++ b/JMeter/appc-lcm-test-Stability-Test-VM2.csv @@ -0,0 +1 @@ +10.12.5.5,APPC-LCM-READ,APPC-LCM-WRITE,Stability-Test-VM2,c0d9b8c7-9534-4a22-b464-d6aa2c930847 diff --git a/JMeter/appc-lcm-test-Stability-Test-VM3.csv b/JMeter/appc-lcm-test-Stability-Test-VM3.csv new file mode 100644 index 0000000..ea47bcb --- /dev/null +++ b/JMeter/appc-lcm-test-Stability-Test-VM3.csv @@ -0,0 +1 @@ +10.12.5.5,APPC-LCM-READ,APPC-LCM-WRITE,Stability-Test-VM3,3b3d77e0-a79d-4c10-bfac-1b3914af1a14 diff --git a/JMeter/appc-lcm-test.csv b/JMeter/appc-lcm-test.csv new file mode 100644 index 0000000..e3f9167 --- /dev/null +++ b/JMeter/appc-lcm-test.csv @@ -0,0 +1 @@ +10.12.5.5,APPC-LCM-READ,APPC-LCM-WRITE,Stability-Test-VM1,799ea611-bb36-4e49-b043-964f20c442d5 diff --git a/JMeter/log_covert.py b/JMeter/log_covert.py new file mode 100644 index 0000000..ec8478a --- /dev/null +++ b/JMeter/log_covert.py @@ -0,0 +1,59 @@ +#! /usr/bin/env python
+
+<!--
+============LICENSE_START==========================================
+ONAP : APPC
+===================================================================
+Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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.
+
+ECOMP is a trademark and service mark of AT&T Intellectual Property.
+============LICENSE_END============================================
+-->
+
+#### Command line arguments
+import argparse
+parser = argparse.ArgumentParser(description="Convert delimited file from one delimiter to another; defaults to converting pipe-delimited to CSV.")
+parser.add_argument("--delim-input", action="store", dest="delim_in", default="|", required=False, help="Input file delimiter; pipe is default (|)", nargs='?', metavar="'|'")
+parser.add_argument("--delim-output", action="store", dest="delim_out", default=",", required=False, help="Output file delimiter; comma is default (,)", nargs='?', metavar="','")
+parser.add_argument("--remove-line-char", action="store_true", dest="remove_line_char", default=False, help="remove \\n and \\r characters in fields and replace with spaces")
+parser.add_argument("--quote-char", action="store", dest="quote_char", default='"', required=False, help="quote character; defaults to double quote (\")", nargs='?', metavar="\"")
+parser.add_argument("-i", "--input", action="store", dest="input", required=False, help="input file; if not specified, take from standard input.", nargs='?', metavar="file.csv")
+parser.add_argument("-o", "--output", action="store", dest="output", required=False, help="output file; if not specified, write to standard output", nargs='?', metavar="file.pipe")
+parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", default=False, help="increase verbosity")
+args = parser.parse_args()
+
+# Conversion for logs begins here.
+import argparse
+import csv
+import sys
+
+if args.input:
+ file_reader = file.reader(open(args.input, 'rb'), delimiter=args.dlm_in, quotechar=args.quote_char)
+else:
+ file_reader = file.reader(sys.stdin, delimiter=args.dlm_in, quotechar=args.quote_char)
+
+if args.output:
+ h_outfile = open(args.output, 'wb')
+else:
+ h_outfile = sys.stdout
+
+for row in file_reader:
+ row = args.dlm_out.join(row)
+ if args.remove_line_char:
+ row = row.replace('\n', ' ').replace('\r', ' ')
+ h_outfile.write("%s\n" % (row))
+ h_outfile.flush()
\ No newline at end of file |