false true true @1b3rt 31nst31n 9696 http 6 size 2000 = max number of VNF instances wait 500 = Sleep time for each request vCPEControlLoop ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e = vCPE Control loop name vDNSControlLoop ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 = vDNS Control loop name vFWControlLoop ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a = vFW Controll loop name VOLTEControlLoop ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b = VOLTE Control loop name threads 2 = threadsTimeOutInMs 5000 = controller amsterdam = session amsterdam = stoptest false -1 ${threads} 1 false policy/pdp/engine/controllers/${controller}/drools/facts/${session}/ GET true false true false {"org.onap.policy.controlloop.Params":4} Assertion.response_data false 16 ${threads} ${threadsTimeOutInMs} Run vCPE Sucess flow Run vCPE Sucess flow java true import java.util.ArrayList; import java.util.List; final List vCPECache = new ArrayList(); vars.putObject("vCPECache", vCPECache); This sampler intializes cache to store generate requestID for vCPE success flow 1 ${size} 1 vnfID vCPE_Infrastructure_vGMUX_demo_app-00 false This counter generate unique vnf-id true import java.util.List; import java.util.UUID; final List vCPECache = vars.getObject("vCPECache"); final String uuid = UUID.randomUUID().toString(); vars.put("requestID",uuid); vCPECache.add(uuid); log.debug("[vCPE] requestID " + uuid); java this sampler generates unique requestId using UUID and adds it to local cache true false { "closedLoopControlName": "${vCPEControlLoop}", "closedLoopAlarmStart": 1463679805324, "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", "closedLoopEventStatus": "ONSET", "requestID": "${requestID}", "target_type": "VNF", "target": "generic-vnf.vnf-id", "AAI": { "vserver.is-closed-loop-disabled": "false", "generic-vnf.vnf-id": "${vnfID}" }, "from": "DCAE", "version": "1.0.2" } = policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events PUT true false true false 200 Assertion.response_code false 8 Response code true false { "body": { "output": { "common-header": { "timestamp": "2017-08-25T21:06:23.037Z", "api-ver": "5.00", "originator-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", "request-id": "${requestID}", "sub-request-id": "1", "flags": {} }, "status": { "code": 400, "message": "Restart Successful" } } }, "version": "2.0", "rpc-name": "restart", "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-1", "type": "response" } = policy/pdp/engine/topics/sources/ueb/APPC-LCM-WRITE/events PUT true false true false 200 Assertion.response_code false 16 ${wait} true false { "closedLoopControlName": "${vCPEControlLoop}", "closedLoopAlarmStart": 1463679805324, "closedLoopAlarmEnd": 1463699805324, "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", "closedLoopEventStatus": "ABATED", "requestID": "${requestID}", "target_type": "VNF", "target": "generic-vnf.vnf-id", "AAI": { "generic-vnf.is-closed-loop-disabled": "false", "generic-vnf.vnf-id": "${vnfID}" }, "from": "DCAE", "version": "1.0.2" } = policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events PUT true false true false 200 Assertion.response_code false 16 ${wait} policy/pdp/engine/topics/sinks/noop/POLICY-CL-MGT GET true false true false ${wait} ${threads} ${threadsTimeOutInMs} result $ java true import net.minidev.json.parser.JSONParser; import net.minidev.json.JSONObject; import net.minidev.json.JSONArray; final Map records = new HashMap(); final JSONParser p = new JSONParser(JSONParser.MODE_PERMISSIVE); final String result = vars.get("result"); final JSONObject jsonObj = (JSONObject) p.parse(result); if (jsonObj != null) { final JSONArray events = (JSONArray) jsonObj.get("recentEvents"); if (events != null) { for (int j = 0; j < events.size(); j++) { final String event = (String) events.get(j); if (event != null ) { final JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); final JSONObject eventObj = (JSONObject) parser.parse(event); final String controlLoopName = vars.get("vCPEControlLoop"); if (eventObj.get("closedLoopControlName").equals(controlLoopName)) { final String requestId = eventObj.get("requestId"); final String notification = eventObj.get("notification"); records.put(requestId, notification); } } } } } boolean failure = false; final String expectedNotification = "FINAL: SUCCESS"; final List cache = vars.getObject("vCPECache"); for (int i = 0; i < cache.size(); i++) { final String requestId = cache.get(i); final String notification = records.get(requestId); if (!(notification != null && expectedNotification.equals(notification))) { log.error("[vCPE] Assertion failed for requestId: " + requestId +" Expected notification: " + expectedNotification + " But found: " + notification); failure = true; } } if (failure || cache.isEmpty()) { final String error = "[vCPE] Unable to find notification with " + expectedNotification + " in topic 'POLICY-CL-MGT'"; AssertionResult.setFailureMessage(error); AssertionResult.setFailure(true); log.error(error); log.info("[vCPE] vCPECache: " + cache); log.info("[vCPE] Success Records found: " + records); log.info("[vCPE] " + result); } else { AssertionResult.setFailure(false); } this assertion handler parse sink event response and checks notification result for each request made Run vCPE failure flow Run vCPE failure flow java true import java.util.ArrayList; import java.util.List; List vCPEFailureCache = new ArrayList(); vars.putObject("vCPEFailureCache", vCPEFailureCache); 1 ${size} 1 vnfID vCPE_Infrastructure_vGMUX_demo_app-00 false true import java.util.List; import java.util.UUID; final List vCPEFailureCache = vars.getObject("vCPEFailureCache"); final String uuid = UUID.randomUUID().toString(); vars.put("requestID",uuid); vCPEFailureCache.add(uuid); log.debug("[vCPE Failure] requestID "+ uuid); java true false { "closedLoopControlName": "${vCPEControlLoop}", "closedLoopAlarmStart": 1463679805324, "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", "closedLoopEventStatus": "ONSET", "requestID": "${requestID}", "target_type": "VNF", "target": "generic-vnf.vnf-id", "AAI": { "vserver.is-closed-loop-disabled": "false", "generic-vnf.vnf-id": "${vnfID}" }, "from": "DCAE", "version": "1.0.2" } = policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events PUT true false true false 200 Assertion.response_code false 8 Response code true false { "body": { "output": { "common-header": { "timestamp": "2017-08-25T21:06:23.037Z", "api-ver": "5.00", "originator-id": "664be3d2-6c12-4f4b-a3e7-c349acced200", "request-id": "${requestID}", "sub-request-id": "1", "flags": {} }, "status": { "code": 500, "message": "Restart Failed" } } }, "version": "2.0", "rpc-name": "restart", "correlation-id": "664be3d2-6c12-4f4b-a3e7-c349acced200-1", "type": "response" } = policy/pdp/engine/topics/sources/ueb/APPC-LCM-WRITE/events PUT true false true false 200 Assertion.response_code false 16 ${wait} policy/pdp/engine/topics/sinks/noop/POLICY-CL-MGT GET true false true false ${wait} ${threads} ${threadsTimeOutInMs} result $ java true import net.minidev.json.parser.JSONParser; import net.minidev.json.JSONObject; import net.minidev.json.JSONArray; final Map records = new HashMap(); final JSONParser p = new JSONParser(JSONParser.MODE_PERMISSIVE); final String result = vars.get("result"); final JSONObject jsonObj = (JSONObject) p.parse(result); if (jsonObj != null) { final JSONArray events = (JSONArray) jsonObj.get("recentEvents"); if (events != null) { for (int j = 0; j < events.size(); j++) { final String event = (String) events.get(j); if (event != null ) { final JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); final JSONObject eventObj = (JSONObject) parser.parse(event); final String controlLoopName = vars.get("vCPEControlLoop"); if (eventObj.get("closedLoopControlName").equals(controlLoopName)) { final String requestId = eventObj.get("requestId"); final String notification = eventObj.get("notification"); records.put(requestId, notification); } } } } } boolean failure = false; final String expectedNotification = "FINAL: FAILURE"; final List cache = vars.getObject("vCPEFailureCache"); for (int i = 0; i < cache.size(); i++) { final String requestId = cache.get(i); final String notification = records.get(requestId); if (!(notification != null && expectedNotification.equals(notification))) { log.error("[vCPE Failue] Assertion failed for requestId: " + requestId + " Expected notification: " + expectedNotification + " But found: " + notification); failure = true; } } if (failure || cache.isEmpty()) { final String error = "[vCPE] Unable to find notification with " + expectedNotification + " in topic 'POLICY-CL-MGT'"; AssertionResult.setFailureMessage(error); AssertionResult.setFailure(true); log.error(error); log.info("[vCPE Failue] vCPECache: " + cache); log.info("[vCPE Failue] Success Records found: " + records); log.info("[vCPE Failue] " + result); } else { AssertionResult.setFailure(false); } java true import java.util.ArrayList; import java.util.List; final List vDNSCache = new ArrayList(); vars.putObject("vDNSCache", vDNSCache); 1 ${size} 1 vserver-name dnsvserver-name-0 false true import java.util.List; import java.util.UUID; final List vDNSCache = vars.getObject("vDNSCache"); final String uuid = UUID.randomUUID().toString(); vars.put("requestID", uuid); vDNSCache.add(uuid); log.debug("[vDNS] requestID "+ uuid); java true false { "closedLoopControlName": "${vDNSControlLoop}", "closedLoopAlarmStart": 1484677482204798, "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", "closedLoopEventStatus": "ONSET", "requestID": "${requestID}", "target_type": "VNF", "target": "vserver.vserver-name", "AAI": { "vserver.is-closed-loop-disabled": "false", "vserver.vserver-name": "${vserver-name}" }, "from": "DCAE", "version": "1.0.2" } = policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events PUT true false true false 200 Assertion.response_code false 8 Response code policy/pdp/engine/topics/sinks/noop/POLICY-CL-MGT GET true false true false ${wait} ${threads} ${threadsTimeOutInMs} result $ java true import net.minidev.json.parser.JSONParser; import net.minidev.json.JSONObject; import net.minidev.json.JSONArray; final Map records = new HashMap(); final JSONParser p = new JSONParser(JSONParser.MODE_PERMISSIVE); final String result = vars.get("result"); final JSONObject jsonObj = (JSONObject) p.parse(result); if (jsonObj != null) { final JSONArray events = (JSONArray) jsonObj.get("recentEvents"); if (events != null) { for (int j = 0; j < events.size(); j++) { final String event = (String) events.get(j); if (event != null ) { final JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); final JSONObject eventObj = (JSONObject) parser.parse(event); final String controlLoopName = vars.get("vDNSControlLoop"); if (eventObj.get("closedLoopControlName").equals(controlLoopName)) { final String requestId = eventObj.get("requestId"); final String notification = eventObj.get("notification"); records.put(requestId, notification); } } } } } boolean failure = false; final String expectedNotification = "FINAL: SUCCESS"; final List cache = vars.getObject("vDNSCache"); for (int i = 0; i < cache.size(); i++) { final String requestId = cache.get(i); final String notification = records.get(requestId); if (!(notification != null && expectedNotification.equals(notification))) { log.error("[vDNS] Assertion failed for requestId: " + requestId +" Expected notification: " + expectedNotification + " But found: " + notification); failure = true; } } if (failure || cache.isEmpty()) { final String error = "[vDNS] Unable to find notification with " + expectedNotification + " in topic 'POLICY-CL-MGT'"; AssertionResult.setFailureMessage(error); AssertionResult.setFailure(true); log.error(error); log.info("[vDNS] vDNSCache: " + cache); log.info("[vDNS] Success Records found: " + records); log.info("[vDNS] " + result); } else { AssertionResult.setFailure(false); } java true import java.util.ArrayList; import java.util.List; final List vFWCache = new ArrayList(); vars.putObject("vFWCache", vFWCache); 1 ${size} 1 vnf-id fwvnfid-0 false true import java.util.List; import java.util.UUID; final List vFWCache = vars.getObject("vFWCache"); final String uuid = UUID.randomUUID().toString(); vars.put("requestID", uuid); vFWCache.add(uuid); log.debug("[vFW] requestID "+ uuid); java true false { "closedLoopControlName": "${vFWControlLoop}", "closedLoopAlarmStart": 1463679805324, "closedLoopEventClient": "microservice.stringmatcher", "closedLoopEventStatus": "ONSET", "requestID": "${requestID}", "target_type": "VNF", "target": "generic-vnf.vnf-id", "AAI": { "generic-vnf.is-closed-loop-disabled": "false", "generic-vnf.vnf-id": "${vnf-id}" }, "from": "DCAE", "version": "1.0.2" } = policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events PUT true false true false 200 Assertion.response_code false 8 Response code true false { "CommonHeader": { "TimeStamp": 1506051879001, "APIver": "1.01", "RequestID": "${requestID}", "SubRequestID": "1", "RequestTrack": [], "Flags": [] }, "Status": { "Code": 400, "Value": "SUCCESS" }, "Payload": { "generic-vnf.vnf-id": "${vnf-id}", "pg-streams": { "pg-stream": [ { "id": "fw_udp1", "is-enabled": "true" }, { "id": "fw_udp2", "is-enabled": "true" }, { "id": "fw_udp3", "is-enabled": "true" }, { "id": "fw_udp4", "is-enabled": "true" }, { "id": "fw_udp5", "is-enabled": "true" } ] } } } = policy/pdp/engine/topics/sources/ueb/APPC-CL/events PUT true false true false ${wait} 200 Assertion.response_code false 16 policy/pdp/engine/topics/sinks/noop/POLICY-CL-MGT GET true false true false ${wait} ${threads} ${threadsTimeOutInMs} result $ java true import net.minidev.json.parser.JSONParser; import net.minidev.json.JSONObject; import net.minidev.json.JSONArray; final Map records = new HashMap(); final JSONParser p = new JSONParser(JSONParser.MODE_PERMISSIVE); final String result = vars.get("result"); final JSONObject jsonObj = (JSONObject) p.parse(result); if (jsonObj != null) { final JSONArray events = (JSONArray) jsonObj.get("recentEvents"); if (events != null) { for (int j = 0; j < events.size(); j++) { final String event = (String) events.get(j); if (event != null ) { final JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); final JSONObject eventObj = (JSONObject) parser.parse(event); final String controlLoopName = vars.get("vFWControlLoop"); if (eventObj.get("closedLoopControlName").equals(controlLoopName)) { final String requestId = eventObj.get("requestId"); final String notification = eventObj.get("notification"); records.put(requestId, notification); } } } } } boolean failure = false; final String expectedNotification = "FINAL: SUCCESS"; final List cache = vars.getObject("vFWCache"); for (int i = 0; i < cache.size(); i++) { final String requestId = cache.get(i); final String notification = records.get(requestId); if (!(notification != null && expectedNotification.equals(notification))) { log.error("[vFW] Assertion failed for requestId: " + requestId +" Expected notification: " + expectedNotification + " But found: " + notification); failure = true; } } if (failure || cache.isEmpty()) { final String error = "[vFW] Unable to find notification with " + expectedNotification + " in topic 'POLICY-CL-MGT'"; AssertionResult.setFailureMessage(error); AssertionResult.setFailure(true); log.error(error); log.info("[vFW] vFWCache: " + cache); log.info("[vFW] Success Records found: " + records); log.info("[vFW] " + result); } else { AssertionResult.setFailure(false); } java true import java.util.ArrayList; import java.util.List; final List vFWFailueCache = new ArrayList(); vars.putObject("vFWFailueCache", vFWFailueCache); 1 ${size} 1 vnf-id fwvnfid-0 false true import java.util.List; import java.util.UUID; final List vFWFailueCache = vars.getObject("vFWFailueCache"); final String uuid = UUID.randomUUID().toString(); vars.put("requestID", uuid); vFWFailueCache.add(uuid); log.debug("[vFW FAILURE] requestID "+ uuid); java true false { "closedLoopControlName": "${vFWControlLoop}", "closedLoopAlarmStart": 1463679805324, "closedLoopEventClient": "microservice.stringmatcher", "closedLoopEventStatus": "ONSET", "requestID": "${requestID}", "target_type": "VNF", "target": "generic-vnf.vnf-id", "AAI": { "generic-vnf.is-closed-loop-disabled": "false", "generic-vnf.vnf-id": "${vnf-id}" }, "from": "DCAE", "version": "1.0.2" } = policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events PUT true false true false 200 Assertion.response_code false 8 Response code true false { "CommonHeader": { "TimeStamp": 1506051879001, "APIver": "1.01", "RequestID": "${requestID}", "SubRequestID": "1", "RequestTrack": [], "Flags": [] }, "Status": { "Code": 500, "Value": "FAILED" }, "Payload": { "generic-vnf.vnf-id": "${vnf-id}", "pg-streams": { "pg-stream": [ { "id": "fw_udp1", "is-enabled": "true" }, { "id": "fw_udp2", "is-enabled": "true" }, { "id": "fw_udp3", "is-enabled": "true" }, { "id": "fw_udp4", "is-enabled": "true" }, { "id": "fw_udp5", "is-enabled": "true" } ] } } } = policy/pdp/engine/topics/sources/ueb/APPC-CL/events PUT true false true false ${wait} 200 Assertion.response_code false 16 policy/pdp/engine/topics/sinks/noop/POLICY-CL-MGT GET true false true false ${wait} ${threads} ${threadsTimeOutInMs} result $ java true import net.minidev.json.parser.JSONParser; import net.minidev.json.JSONObject; import net.minidev.json.JSONArray; final Map records = new HashMap(); final JSONParser p = new JSONParser(JSONParser.MODE_PERMISSIVE); final String result = vars.get("result"); final JSONObject jsonObj = (JSONObject) p.parse(result); if (jsonObj != null) { final JSONArray events = (JSONArray) jsonObj.get("recentEvents"); if (events != null) { for (int j = 0; j < events.size(); j++) { final String event = (String) events.get(j); if (event != null ) { final JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); final JSONObject eventObj = (JSONObject) parser.parse(event); final String controlLoopName = vars.get("vFWControlLoop"); if (eventObj.get("closedLoopControlName").equals(controlLoopName)) { final String requestId = eventObj.get("requestId"); final String notification = eventObj.get("notification"); records.put(requestId, notification); } } } } } boolean failure = false; final String expectedNotification = "FINAL: FAILURE"; final List cache = vars.getObject("vFWFailueCache"); for (int i = 0; i < cache.size(); i++) { final String requestId = cache.get(i); final String notification = records.get(requestId); if (!(notification != null && expectedNotification.equals(notification))) { log.error("[vFW] Assertion failed for requestId: " + requestId +" Expected notification: " + expectedNotification + " But found: " + notification); failure = true; } } if (failure || cache.isEmpty()) { final String error = "[vFW] Unable to find notification with " + expectedNotification + " in topic 'POLICY-CL-MGT'"; AssertionResult.setFailureMessage(error); AssertionResult.setFailure(true); log.error(error); log.info("[vFW] vFWCache: " + cache); log.info("[vFW] Success Records found: " + records); log.info("[vFW] " + result); } else { AssertionResult.setFailure(false); } java true import java.util.ArrayList; import java.util.List; final List vVOLTECache = new ArrayList(); vars.putObject("vVOLTECache", vVOLTECache); true import java.util.List; import java.util.UUID; final List vVOLTECache = vars.getObject("vVOLTECache"); final String uuid = UUID.randomUUID().toString(); vars.put("requestID",uuid); vVOLTECache.add(uuid); log.debug("[VOLTE] requestID "+ uuid); java 1 ${size} 1 service-instance-id volte-service-instance-id-0 false 1 ${size} 1 vserver-name dnsvserver-name-0 false true false { "closedLoopControlName":"${VOLTEControlLoop}", "closedLoopAlarmStart":1484677482204798, "closedLoopEventClient":"DCAE.HolmesInstance", "closedLoopEventStatus":"ONSET", "requestID":"${requestID}", "target_type":"VM", "target":"vserver.vserver-name", "AAI":{ "vserver.is-closed-loop-disabled":"false", "vserver.vserver-name":"${vserver-name}", "service-instance.service-instance-id":"vserver-name-${service-instance-id}", "generic-vnf.vnf-id":"vnf-id-${service-instance-id}", "generic-vnf.vnf-name":"vnf-name-${service-instance-id}" }, "from":"DCAE", "version":"1.0.2" } = policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events PUT true false true false 200 Assertion.response_code false 8 Response code policy/pdp/engine/topics/sinks/noop/POLICY-CL-MGT GET true false true false ${wait} ${threads} ${threadsTimeOutInMs} result $ java true import net.minidev.json.parser.JSONParser; import net.minidev.json.JSONObject; import net.minidev.json.JSONArray; final Map records = new HashMap(); final JSONParser p = new JSONParser(JSONParser.MODE_PERMISSIVE); final String result = vars.get("result"); final JSONObject jsonObj = (JSONObject) p.parse(result); if (jsonObj != null) { final JSONArray events = (JSONArray) jsonObj.get("recentEvents"); if (events != null) { for (int j = 0; j < events.size(); j++) { final String event = (String) events.get(j); if (event != null ) { final JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE); final JSONObject eventObj = (JSONObject) parser.parse(event); final String controlLoopName = vars.get("VOLTEControlLoop"); if (eventObj.get("closedLoopControlName").equals(controlLoopName)) { final String requestId = eventObj.get("requestId"); final String notification = eventObj.get("notification"); records.put(requestId, notification); } } } } } boolean failure = false; final String expectedNotification = "FINAL: SUCCESS"; final List cache = vars.getObject("vVOLTECache"); for (int i = 0; i < cache.size(); i++) { final String requestId = cache.get(i); final String notification = records.get(requestId); if (!(notification != null && expectedNotification.equals(notification))) { log.error("[VOLTE] Assertion failed for requestId: " + requestId +" Expected notification: " + expectedNotification + " But found: " + notification); failure = true; } } if (failure || cache.isEmpty()) { final String error = "[VOLTE] Unable to find notification with " + expectedNotification + " in topic 'POLICY-CL-MGT'"; AssertionResult.setFailureMessage(error); AssertionResult.setFailure(true); log.error(error); log.info("[VOLTE] vVOLTECache: " + cache); log.info("[VOLTE] Success Records found: " + records); log.info("[VOLTE] " + result); } else { AssertionResult.setFailure(false); } policy/pdp/engine/controllers/${controller}/drools/facts/${session}/ GET true false true false {"org.onap.policy.controlloop.Params":4} Assertion.response_data false 16 false saveConfig true true true true true true true false true true false false false true false false false true 0 true true true true true false saveConfig true true true true true true true false true true false false false true false false false true 0 true true true true true false saveConfig true true true true true true true false true true false false false true false false false true 0 true true true true true