false true false PDP_HOST ${__P(host,10.239.40.43)} = CSAR_DIR ${__P(csardir, /tmp/policy_distribution/csar)} = SCRIPT_DIR ${__BeanShell(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir();)}${__BeanShell(File.separator,)} = DURATION ${__P(duration, 30)} = rescode 0 = RETRY ${__P(retry, 10)} = RETRY_WAIT ${__P(wait, 1000)} = counter 0 = continue false -1 1 1 true ${DURATION} 1 Content-Type application/json Accept application/json ClientAuth cHl0aG9uOnRlc3Q= Authorization Basic dGVzdHBkcDphbHBoYTEyMw== Environment TEST 100000000 1 00000000 false RESID true false {"policyName": "oofCasablanca.*s3p_${RESID}.*"} = ${PDP_HOST} 8081 https /pdp/api/listConfig POST true false true false groovy true import groovy.json.JsonSlurper; def to_delete = []; if (prev.getResponseCode() == '200') { def jsonSlurper = new JsonSlurper(); to_delete = jsonSlurper.parseText(prev.getResponseDataAsString()); } vars.putObject('to_delete', to_delete); ${__groovy(vars.getObject('to_delete').size() > 0)} true false { "pdpGroup": "default", "policyComponent": "PDP", "policyType": "Optimization", "policyName": "${policyname}" } = ${PDP_HOST} 8081 https /pdp/api/deletePolicy DELETE true false true false true def to_delete = vars.getObject('to_delete'); def policyname = to_delete.pop() vars.put('policyname', policyname.toString()); vars.putObject('to_delete', to_delete); groovy true false { "deleteCondition":"ALL", "policyComponent": "PAP", "policyType": "Optimization", "policyName": "${policyname}" } = ${PDP_HOST} 8081 https /pdp/api/deletePolicy DELETE true false true false true 0 ${SCRIPT_DIR}generate.sh ${CSAR_DIR} = ${RESID} = true vars.put("rescode", "0"); vars.put('counter', '0'); groovy ${__javaScript(${counter} < ${RETRY} && "${rescode}" != "200")} true false {"policyName": "oofCasablanca.*s3p_${RESID}.*"} = ${PDP_HOST} 8081 https /pdp/api/getConfig POST true false true false true def rescode = prev.getResponseCode(); vars.put('rescode', rescode); groovy ${RETRY_WAIT} true def counter=vars.get('counter').toInteger(); def retry=vars.get('RETRY').toInteger(); def rescode = prev.getResponseCode(); if (counter >= retry && rescode !='200') { //log.info('counter: ' + counter); //log.info('retry: ' + retry); AssertionResult.setFailure(true); AssertionResult.setFailureMessage('get policy failed for resource ' + vars.get('RESID')); } groovy 1 1 counter true true