From 249699f8fb908359213697055b66637c9baeda99 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Tue, 8 Aug 2017 03:14:52 -0700 Subject: Rework of the unit tests (mainly IT) Rework of the unit tests (mainly IT) + new example files and test resource config Change-Id: I4970b3710c7decdc8a3265a86115097d4394ad80 Issue-Id: CLAMP-1 Signed-off-by: Determe, Sebastien (sd378r) --- src/test/resources/clds/clds-reference.properties | 41 +- src/test/resources/example/modelBpmnProp.json | 42 +- .../resources/example/modelBpmnPropForPolicy.json | 26 + src/test/resources/example/modelProp.json | 1114 ++++++++++++++------ src/test/resources/example/modelPropForPolicy.json | 404 +++++++ src/test/resources/example/templatePropForTca.json | 10 + src/test/resources/expected/stringmatch.json | 1 + src/test/resources/expected/tca.json | 93 ++ 8 files changed, 1367 insertions(+), 364 deletions(-) create mode 100644 src/test/resources/example/modelBpmnPropForPolicy.json create mode 100644 src/test/resources/example/modelPropForPolicy.json create mode 100644 src/test/resources/example/templatePropForTca.json create mode 100644 src/test/resources/expected/stringmatch.json create mode 100644 src/test/resources/expected/tca.json (limited to 'src/test/resources') diff --git a/src/test/resources/clds/clds-reference.properties b/src/test/resources/clds/clds-reference.properties index 64879895..7cedc130 100644 --- a/src/test/resources/clds/clds-reference.properties +++ b/src/test/resources/clds/clds-reference.properties @@ -37,10 +37,10 @@ tca.signature.template={"nfNamingCode":"ENBE","target":"common_id","targetType": dcae.template={"properties":{"service_name":"","service_ids":[],"vnf_ids":[],"location_ids":[]},"template":{"string_matching":{"dcae":{"inputTopic":"","outputTopic":"","closedLoopControlName":"","closedLoopEventClient":"configuration.dcae.microservice.stringmatcher.xml","policyName":"","policyScope":"service=vSCP;resource=F5;type=configuration","policyVersion":"v0.0.1","serviceConfigurations":{}}}}} dcae.decode.service_ids={"vUSP":["vUSP - vCTS"],"Trinity":["ASBGv TLS VNF","ASBGv No TLS","ASBGv (NO TLS) VNF","ASBGv TLS","NSBGv VNF","NSBGv"],"vSCP":["AKRON_vSCP_F5_FW-SVC/vSCP_F5_FW 1","ALLEN_vSCP_F5_FW-SVC/vSCP_F5_FW 1"],"vProbes":["vProbes - FW"]} # -# ASDC request blueprint properties +# SDC request blueprint properties # -asdc.template={} -asdc.decode.service_ids={} +sdc.template={} +sdc.decode.service_ids={} # # # General Policy request properties @@ -73,25 +73,34 @@ sm.rulegroup.vSCP=false # op.policyDescription=from clds # default -op.templateName=ClosedLoopvUSP +op.templateName=ClosedLoopGuardvUSP op.operationTopic=APPC-CL op.notificationTopic=POLICY-CL-MGT op.controller=1610-vUSP # by service: vSCP op.templateName.vSCP=ClosedLoopTemplate op.controller.vSCP=1607-f5fw -# -# Asdc service properties -asdc.catalog.url=http://127.0.0.1:8080/sdc/v1/catalog/ -asdc.hostUrl=http://127.0.0.1:8080 -asdc.serviceUrl=http://127.0.0.1:8080/sdc/v1/catalog/services -asdc.serviceUsername=test -asdc.servicePassword=123456 -asdc.artifactLabel=blueprintclampcockpit -asdc.asdcX-ECOMP-InstanceID=CLAMP -asdc.artifactType=DCAE_INVENTORY_BLUEPRINT -asdc.locationArtifactLabel=LocationClampCockpit -asdc.locationArtifactType=DCAE_INVENTORY_JSON +op.eNodeB.templateName=CLeNodeB +op.eNodeB.operationTopic=com.onap.sdnr.RanCLRequest-v00 +op.eNodeB.notificationTopic=com.onap-policy.IST-ENODEB-CL +op.eNodeB.controller=ClosedLoop-eNodeB +op.eNodeB.recipe={"eNodeBRecipes":[{"Actor":"AOTS","Recipe":"checkENodeBTicketHours","ParentPolicy":"","PPConditions":"","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkEquipmentStatus","ParentPolicy":"checkENodeBTicketHours","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkEimStatus","ParentPolicy":"checkEquipmentStatus","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkMaintenanceWindow","ParentPolicy":"checkEimStatus","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"SDNR","Recipe":"Reset","ParentPolicy":"checkMaintenanceWindow","PPConditions":"Success","Retry":"","TimeLimit":""}]} +op.eNodeB.timeWindow=35 +op.eNodeB.limit=2 +op.eNodeB.period=10s +# +# sdc service properties +sdc.catalog.url=http://127.0.0.1:8080/sdc/v1/catalog/ +sdc.hostUrl=http://127.0.0.1:8080 +sdc.serviceUrl=http://127.0.0.1:8080/sdc/v1/catalog/services +sdc.serviceUsername=test +sdc.servicePassword=123456 +sdc.artifactLabel=blueprintclampcockpit +sdc.sdcX-InstanceID=CLAMP +sdc.artifactType=DCAE_INVENTORY_BLUEPRINT +sdc.locationArtifactLabel=LocationClampCockpit +sdc.locationArtifactType=DCAE_INVENTORY_JSON +sdc.InstanceID=X-ONAP-InstanceID # # # diff --git a/src/test/resources/example/modelBpmnProp.json b/src/test/resources/example/modelBpmnProp.json index 140a5679..26fd884d 100644 --- a/src/test/resources/example/modelBpmnProp.json +++ b/src/test/resources/example/modelBpmnProp.json @@ -1 +1,41 @@ -{"collector":[{"id":"Collector_", "from":"StartEvent_1"}],"stringMatch":[{"id":"StringMatch_", "from":"Collector_"}],"policy":[{"id":"Policy_", "from":"StringMatch_"}],"tca":[{"id":"TCA_", "from":""}]} \ No newline at end of file +{ + "collector": + [ + { + "id": "Collector_", + "from": "StartEvent_1" + } + ], + + "stringMatch": + [ + { + "id": "StringMatch_", + "from": "Collector_" + } + ], + + "policy": + [ + { + "id": "Policy_", + "from": "StringMatch_" + } + ], + + "tca": + [ + { + "id": "TCA_", + "from": "" + } + ], + + "customType": + [ + { + "id": "CustomType_", + "from": "" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/example/modelBpmnPropForPolicy.json b/src/test/resources/example/modelBpmnPropForPolicy.json new file mode 100644 index 00000000..243f7e80 --- /dev/null +++ b/src/test/resources/example/modelBpmnPropForPolicy.json @@ -0,0 +1,26 @@ +{ + "collector": + [ + + ], + "stringMatch": + [ + + ], + + "policy": + [ + { + "id": "Policy_", + "from": "StartEvent_1" + } + ], + + "tca": + [ + { + "id": "TCA_", + "from": "" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/example/modelProp.json b/src/test/resources/example/modelProp.json index 831bf2d7..8b8e984f 100644 --- a/src/test/resources/example/modelProp.json +++ b/src/test/resources/example/modelProp.json @@ -1,369 +1,789 @@ { - "Collector_":[ - { - "name":"topicPublishes", - "value":"DCAE-COLLECTOR-UCSNMP" - } - ], - "global":[ - { - "name":"service", - "value":[ - "df6fcd2b-1932-429e-bb13-0cd0d32113cb" - ] - }, - { - "name":"vf", - "value":[ - "4b49acee-cf70-4b20-b956-a4fe0c1a8239" - ] - }, - { - "name":"location", - "value":[ - "SNDGCA64", - "ALPRGAED" - ] - } - ], - "StringMatch_":[ + "Collector_": [ - { - "name":"topicPublishes", - "value":"DCAE-CL-EVENT" - } + { + "name": "topicPublishes", + "value": "DCAE-COLLECTOR-UCSNMP" + } ], - { - "serviceConfigurations":[ - [ - { - "name":"aaiMatchingFields", - "value":[ - "Identiy" - ] - }, - { - "name":"aaiSendFields", - "value":[ - "VMID" - ] - }, - { - "name":"groupNumber", - "value":[ - "1" - ] - }, - { - "name":"timeWindow", - "value":[ - "1" + + "global": + [ + { + "name": "service", + "value": + [ + "0f983e18-4603-4bb4-a98c-e29691fb16a1" ] - }, - { - "name":"ageLimit", - "value":[ - "1600" + }, + + { + "name": "vf", + "value": + [ + "6c7aaec2-59eb-41d9-8681-b7f976ab668d" ] - }, - { - "name":"createClosedLoopEventId", - "value":[ - "Initial" + }, + + { + "name": "actionSet", + "value": + [ + "enbRecipe" ] - }, - { - "name":"outputEventName", - "value":[ - "OnSet" + }, + + { + "name": "location", + "value": + [ + "SNDGCA64" ] - }, - { - "stringSet":[ - { - "name":"alarmCondition", - "value":[ - "Reports a transient alarm condition when an outgoing Ro message send fails" - ] - }, - { - "name":"eventSeverity", - "value":[ - "WARNING" - ] - }, - { - "name":"eventSourceType", - "value":[ - "f5BigIP" + } + ], + + "HighlandPark_": + [ + [ + { + "name": "topicPublishes", + "value": "DCAE-HIGHLANDPARK-EVENT-OUTPUT-VOIP" + } + ], + + { + "serviceConfigurations": + [ + [ + { + "name": "alarmCondition", + "value": + [ + "Reports a transient alarm condition when an incoming ACR message is in conflict with former ACR in one diameter session" + ] + }, + + { + "name": "eventSourceType", + "value": + [ + "f5BigIP" + ] + }, + + { + "name": "eventSeverity", + "value": + [ + "NORMAL" + ] + } + ], + + [ + { + "name": "alarmCondition", + "value": + [ + "Reports a transient alarm condition when an incoming ACR message is in conflict with former ACR in one diameter session" + ] + }, + + { + "name": "eventSourceType", + "value": + [ + "f5BigIP" + ] + }, + + { + "name": "eventSeverity", + "value": + [ + "NORMAL" + ] + } ] - } ] - } + } + ], + + "StringMatch_": + { + "Group1": + [ + { + "name": "rgname", + "value": "1493749598520" + }, + + { + "name": "rgfriendlyname", + "value": "Group1" + }, + + { + "name": "policyName", + "value": "Policy1" + }, + + { + "name": "policyId", + "value": "1" + }, + + { + "serviceConfigurations": + [ + [ + { + "name": "aaiMatchingFields", + "value": + [ + "complex.city", + "vserver.vserver-name" + ] + }, + + { + "name": "aaiSendFields", + "value": + [ + "complex.city", + "vserver.vserver-name" + ] + }, + + { + "name": "timeWindow", + "value": + [ + "100" + ] + }, + + { + "name": "ageLimit", + "value": + [ + "100" + ] + }, + + { + "name": "createClosedLoopEventId", + "value": + [ + "Initial" + ] + }, + + { + "name": "outputEventName", + "value": + [ + "ONSET" + ] + }, + + { + "stringSet": + [ + { + "name": "alarmCondition", + "value": + [ + "Reports a transient alarm condition when an outgoing Ro message send fails" + ] + }, + + { + "name": "eventSeverity", + "value": + [ + "WARNING" + ] + }, + + { + "name": "eventSourceType", + "value": + [ + "f5BigIP" + ] + } + ] + } + ] + ] + } ], + + "Group2": [ - { - "name":"aaiMatchingFields", - "value":[ - "VMID" - ] - }, - { - "name":"aaiSendFields", - "value":[ - "Identiy" - ] - }, - { - "name":"groupNumber", - "value":[ - "1" - ] - }, - { - "name":"timeWindow", - "value":[ - "0" - ] - }, - { - "name":"ageLimit", - "value":[ - "1600" - ] - }, - { - "name":"createClosedLoopEventId", - "value":[ - "Close" - ] - }, - { - "name":"outputEventName", - "value":[ - "Abatement" - ] - }, - { - "stringSet":[ - { - "name":"alarmCondition", - "value":[ - "Reports a transient alarm condition when an outgoing GTP' message send fails" + { + "name": "rgname", + "value": "1493749665149" + }, + + { + "name": "rgfriendlyname", + "value": "Group2" + }, + + { + "name": "policyName", + "value": "Policy2" + }, + + { + "name": "policyId", + "value": "2" + }, + + { + "serviceConfigurations": + [ + [ + { + "name": "aaiMatchingFields", + "value": + [ + "cloud-region.identity-url", + "vserver.vserver-name" + ] + }, + + { + "name": "aaiSendFields", + "value": + [ + "cloud-region.identity-url", + "vserver.vserver-name" + ] + }, + + { + "name": "timeWindow", + "value": + [ + "1000" + ] + }, + + { + "name": "ageLimit", + "value": + [ + "1000" + ] + }, + + { + "name": "createClosedLoopEventId", + "value": + [ + "Initial" + ] + }, + + { + "name": "outputEventName", + "value": + [ + "ONSET" + ] + }, + + { + "stringSet": + [ + { + "name": "alarmCondition", + "value": + [ + "LSS_asdaCommunicationFailure" + ] + }, + + { + "name": "eventSeverity", + "value": + [ + "WARNING" + ] + }, + + { + "name": "eventSourceType", + "value": + [ + "f5BigIP" + ] + } + ] + } + ], + + [ + { + "name": "aaiMatchingFields", + "value": + [ + "generic-vnf.vnf-name", + "vserver.vserver-name" + ] + }, + + { + "name": "aaiSendFields", + "value": + [ + "generic-vnf.vnf-name", + "vserver.vserver-name" + ] + }, + + { + "name": "timeWindow", + "value": + [ + "3000" + ] + }, + + { + "name": "ageLimit", + "value": + [ + "3000" + ] + }, + + { + "name": "createClosedLoopEventId", + "value": + [ + "Initial" + ] + }, + + { + "name": "outputEventName", + "value": + [ + "ABATED" + ] + }, + + { + "stringSet": + [ + { + "name": "alarmCondition", + "value": + [ + "LSS_asdaCommunicationFailure" + ] + }, + + { + "name": "eventSeverity", + "value": + [ + "MAJOR" + ] + }, + + { + "name": "eventSourceType", + "value": + [ + "f5BigIP" + ] + } + ] + } + ] ] - }, - { - "name":"eventSeverity", - "value":[ - "NORMAL" + } + ] + }, + + "Policy_": + { + "Policy1": + [ + { + "name": "pname", + "value": "Policy1" + }, + + { + "name": "pid", + "value": "1" + }, + + { + "name": "timeout", + "value": "500" + }, + + { + "policyConfigurations": + [ + [ + { + "name": "recipe", + "value": + [ + "restart" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "" + ] + } + ], + + [ + { + "name": "recipe", + "value": + [ + "rebuild" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "ItE5xKT" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicyConditions", + "value": + [ + "Failure_Retries", + "Failure_Timeout", + "Failure_Exception", + "Failure" + ] + } + ] ] - }, - { - "name":"eventSourceType", - "value":[ - "f5BigIP" + } + ], + + "Policy2": + [ + { + "name": "pname", + "value": "Policy2" + }, + + { + "name": "pid", + "value": "2" + }, + + { + "name": "timeout", + "value": "500" + }, + + { + "policyConfigurations": + [ + [ + { + "name": "recipe", + "value": + [ + "restart" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "" + ] + } + ], + + [ + { + "name": "recipe", + "value": + [ + "rebuild" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "ItE5xKT" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicyConditions", + "value": + [ + "Failure_Retries", + "Failure_Timeout", + "Failure_Exception", + "Failure" + ] + } + ] ] - } - ] - } + } ] - ] - } - ], - "Policy_":[ - [ - { - "name":"timeout", - "value":"500" - } - ], + }, + + "TCA_": { - "policyConfigurations":[ + "Narra": [ - { - "name":"recipe", - "value":[ - "restart" - ] - }, - { - "name":"maxRetries", - "value":[ - "3" - ] - }, - { - "name":"retryTimeLimit", - "value":[ - "180" - ] - }, - { - "name":"_id", - "value":[ - "n9bQ4t6" - ] - }, - { - "name":"parentPolicy", - "value":[ - "" - ] - } + { + "name": "tname", + "value": "Narra" + }, + + { + "name": "tuuid", + "value": "886be8da-14fe-tca1-d04b-d13b55d58df9" + }, + + { + "name": "tnfc", + "value": "ENBE" + }, + + { + "name": "tcaEnab", + "value": "on" + }, + + { + "name": "tcaPol", + "value": "Policy1" + }, + + { + "name": "tcaPolId", + "value": "1" + }, + + { + "name": "tcaInt", + "value": "2" + }, + + { + "name": "tcaSev", + "value": "Warning" + }, + + { + "name": "tcaVio", + "value": "3" + }, + + { + "serviceConfigurations": + [ + [ + "PMRRCCONNESTABFAILCELLLATENCY", + "LESS", + "4", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value" + ], + + [ + "PMRAATTCBRA", + "GREATER", + "30", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value" + ] + ] + } ], + + "Srini": [ - { - "name":"recipe", - "value":[ - "rebuild" - ] - }, - { - "name":"maxRetries", - "value":[ - "3" - ] - }, - { - "name":"retryTimeLimit", - "value":[ - "180" - ] - }, - { - "name":"_id", - "value":[ - "ItE5xKT" - ] - }, - { - "name":"parentPolicy", - "value":[ - "n9bQ4t6" - ] - }, - { - "name":"parentPolicyConditions", - "value":[ - "Failure_Retries", - "Failure_Timeout", - "Failure_Exception", - "Failure" - ] - } + { + "name": "tname", + "value": "Srini" + }, + + { + "name": "tuuid", + "value": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d" + }, + + { + "name": "tnfc", + "value": "ENBE" + }, + + { + "name": "tcaEnab", + "value": "on" + }, + + { + "name": "tcaPol", + "value": "Policy2" + }, + + { + "name": "tcaPolId", + "value": "2" + }, + + { + "name": "tcaInt", + "value": "10" + }, + + { + "name": "tcaSev", + "value": "Critical" + }, + + { + "name": "tcaVio", + "value": "5" + }, + + { + "serviceConfigurations": + [ + [ + "PMRRCCONNESTABFAILCELLLATENCY", + "EQUAL", + "3", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value" + ], + + [ + "PMRAATTCBRA", + "GREATER", + "30", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value" + ] + ] + } ] - ] } - ], - - "TCA_":{ - "Narra":[ - { - "name": "tname", - "value": "Narra" - }, - { - "name": "tuuid", - "value": "886be8da-14fe-tca1-d04b-d13b55d58df9" - }, - { - "name": "tnfc", - "value": "ENBE" - }, - { - "name": "tcaEnab", - "value": "on" - }, - { - "name": "tcaPol", - "value": "Policy1" - }, - { - "name": "tcaPolId", - "value": "1" - }, - { - "name": "tcaInt", - "value": "2" - }, - { - "name": "tcaSev", - "value": "Warning" - }, - { - "name": "tcaVio", - "value": "3" - }, - { - "serviceConfigurations":[ - [ - "PMRRCCONNESTABFAILCELLLATENCY", - "LESS", - "4", - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value" - ], - [ - "PMRAATTCBRA", - "GREATER", - "30", - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value" - ] - ] - } - ], - "Srini":[ - { - "name": "tname", - "value": "Srini" - }, - { - "name": "tuuid", - "value": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d" - }, - { - "name": "tnfc", - "value": "ENBE" - }, - { - "name": "tcaEnab", - "value": "on" - }, - { - "name": "tcaPol", - "value": "Policy2" - }, - { - "name": "tcaPolId", - "value": "2" - }, - { - "name": "tcaInt", - "value": "10" - }, - { - "name": "tcaSev", - "value": "Critical" - }, - { - "name": "tcaVio", - "value": "5" - }, - { - "serviceConfigurations":[ - [ - "PMRRCCONNESTABFAILCELLLATENCY", - "EQUAL", - "3", - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value" - ], - [ - "PMRAATTCBRA", - "GREATER", - "30", - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value" - ] - ] - } - ] - } } \ No newline at end of file diff --git a/src/test/resources/example/modelPropForPolicy.json b/src/test/resources/example/modelPropForPolicy.json new file mode 100644 index 00000000..6923e1a6 --- /dev/null +++ b/src/test/resources/example/modelPropForPolicy.json @@ -0,0 +1,404 @@ +{ + "global": + [ + { + "name": "service", + "value": + [ + "0f983e18-4603-4bb4-a98c-e29691fb16a1" + ] + }, + + { + "name": "vf", + "value": + [ + "6c7aaec2-59eb-41d9-8681-b7f976ab668d" + ] + }, + + { + "name": "location", + "value": + [ + "SNDGCA64" + ] + } + ], + + "Policy_": + { + "Policy1": + [ + { + "name": "pname", + "value": "Policy1" + }, + + { + "name": "pid", + "value": "1" + }, + + { + "name": "timeout", + "value": "500" + }, + + { + "policyConfigurations": + [ + [ + { + "name": "recipe", + "value": + [ + "restart" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "" + ] + } + ], + + [ + { + "name": "recipe", + "value": + [ + "rebuild" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "ItE5xKT" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicyConditions", + "value": + [ + "Failure_Retries", + "Failure_Timeout", + "Failure_Exception", + "Failure" + ] + } + ] + ] + } + ], + + "Policy2": + [ + { + "name": "pname", + "value": "Policy2" + }, + + { + "name": "pid", + "value": "2" + }, + + { + "name": "timeout", + "value": "500" + }, + + { + "policyConfigurations": + [ + [ + { + "name": "recipe", + "value": + [ + "restart" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "" + ] + } + ], + + [ + { + "name": "recipe", + "value": + [ + "rebuild" + ] + }, + + { + "name": "maxRetries", + "value": + [ + "3" + ] + }, + + { + "name": "retryTimeLimit", + "value": + [ + "180" + ] + }, + + { + "name": "_id", + "value": + [ + "ItE5xKT" + ] + }, + + { + "name": "parentPolicy", + "value": + [ + "n9bQ4t6" + ] + }, + + { + "name": "parentPolicyConditions", + "value": + [ + "Failure_Retries", + "Failure_Timeout", + "Failure_Exception", + "Failure" + ] + } + ] + ] + } + ] + }, + + "TCA_": + { + "Narra": + [ + { + "name": "tname", + "value": "Narra" + }, + + { + "name": "tuuid", + "value": "886be8da-14fe-tca1-d04b-d13b55d58df9" + }, + + { + "name": "tnfc", + "value": "ENBE" + }, + + { + "name": "tcaEnab", + "value": "on" + }, + + { + "name": "tcaPol", + "value": "Policy1" + }, + + { + "name": "tcaPolId", + "value": "1" + }, + + { + "name": "tcaInt", + "value": "2" + }, + + { + "name": "tcaSev", + "value": "Warning" + }, + + { + "name": "tcaVio", + "value": "3" + }, + + { + "serviceConfigurations": + [ + [ + "PMRRCCONNESTABFAILCELLLATENCY", + "LESS", + "4", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value" + ], + + [ + "PMRAATTCBRA", + "GREATER", + "30", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value" + ] + ] + } + ], + + "Srini": + [ + { + "name": "tname", + "value": "Srini" + }, + + { + "name": "tuuid", + "value": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d" + }, + + { + "name": "tnfc", + "value": "ENBE" + }, + + { + "name": "tcaEnab", + "value": "on" + }, + + { + "name": "tcaPol", + "value": "Policy2" + }, + + { + "name": "tcaPolId", + "value": "2" + }, + + { + "name": "tcaInt", + "value": "10" + }, + + { + "name": "tcaSev", + "value": "Critical" + }, + + { + "name": "tcaVio", + "value": "5" + }, + + { + "serviceConfigurations": + [ + [ + "PMRRCCONNESTABFAILCELLLATENCY", + "EQUAL", + "3", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value" + ], + + [ + "PMRAATTCBRA", + "GREATER", + "30", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value" + ] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/test/resources/example/templatePropForTca.json b/src/test/resources/example/templatePropForTca.json new file mode 100644 index 00000000..9f1ce1da --- /dev/null +++ b/src/test/resources/example/templatePropForTca.json @@ -0,0 +1,10 @@ +{ + "global": [ + { + "name": "service", + "value": [ + "tosca_definitions_version: cloudify_dsl_1_2\r\n\r\nimports:\r\n- http://www.getcloudify.org/spec/cloudify/3.3.1/types.yaml\r\n- http://135.207.127.211/1607_prod/type_files/cdap_app.yaml\r\n\r\nnode_templates:\r\n MTCA:\r\n type: dcae.nodes.cdap_app\r\n properties:\r\n service_name: \"cdap-mtca-central\"\r\n deployment_JSON: |-\r\n {\r\n \"clusterService\": {\"$ref\": \"/services/vm-cdap-cluster-central/instances/rdm2c\"},\r\n \"namespace\": \"MTCA\",\r\n \"appNames\": [ \"cdap-mtca\" ],\r\n \"flowNames\": [ \"cdap-mtca.TCAVESCollectorFlow\" ],\r\n \"workerNames\": [\"cdap-mtca.TCADMaaPMRSubscriberWorker\", \"cdap-mtca.TCADMaaPMRPublisherWorker\"],\r\n \"serviceNames\" : [],\r\n \"apps\": {\r\n \"cdap-mtca\": {\r\n \"jarFile\": \"/opt/app/cdap-apps/dcae-analytics-mtca-1.0.0.jar\",\r\n \"artifactName\": \"dcae-analytics-mtca\",\r\n \"version\": \"1.0.0\",\r\n \"appConfigFileContent\": \"{config:{ \\\"appName\\\":\\\"cdap-mtca\\\", \\\"appDescription\\\":\\\"DCAE Analytics Threshold Crossing Alert Application\\\", \\\"tcaSubscriberOutputStreamName\\\":\\\"TCASubscriberOutputStream\\\", \\\"thresholdCalculatorFlowletInstances\\\":2, \\\"tcaVESMessageStatusTableName\\\":\\\"TCAVESMessageStatusTable\\\", \\\"tcaVESMessageStatusTableTTLSeconds\\\":864000, \\\"tcaVESAlertsTableName\\\":\\\"TCAVESAlertsTable\\\", \\\"tcaVESAlertsTableTTLSeconds\\\":1728000 }}\"\r\n }\r\n },\r\n \r\n \"configuration\": {\r\n \"$class\": \"com.att.ecomp.dcae.clamp.common.MThresholdCrossingConfiguration\",\r\n \"subscriberContentType\": \"\",\r\n \"subscriberConsumerId\": \"c12\",\r\n \"subscriberConsumerGroup\": \"OpenDCAE-c12\",\r\n \"subscriberTimeoutMS\": \"-1\",\r\n \"subscriberMessageLimit\": \"-1\",\r\n \"subscriberPollingInterval\": \"20000\",\r\n \"publisherContentType\": \"application/json\",\r\n \"publisherMaxBatchSize\": \"10\",\r\n \"publisherMaxRecoveryQueueSize\": \"100000\",\r\n \"publisherPollingInterval\": \"20000\",\r\n \"publisherAlertWindowingTime\": \"86400\",\r\n \"policyName\": \"policy.dcae.configuration\",\r\n \"policyScope\": \"pnf=eNodeB;type=configuration\",\r\n \"policyVersion\": \"1.0.0\",\r\n \"domain\" : \"measurementsForVfScaling\",\r\n \r\n \"signatures\" : {\r\n \t }\r\n\r\n }\r\n }\r\n" + ] + } + ] +} \ No newline at end of file diff --git a/src/test/resources/expected/stringmatch.json b/src/test/resources/expected/stringmatch.json new file mode 100644 index 00000000..52e6d01a --- /dev/null +++ b/src/test/resources/expected/stringmatch.json @@ -0,0 +1 @@ +{"service":"StringMatchingConfiguration","location":"Edge","uuid":"TestUUID","policyName":"example_model06.ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_StringMatch_","description":"from clds","configName":"com.att.d2.policy.StringMatchingConfiguration","templateVersion":"1604","priority":"4","version":"1610","policyScope":"resource=F5,service=vSCP,type=configuration,closedLoopControlName=vSCP_F5_Firewall_d925ed73-8231-4d02-9545-db4e101f88f8","content":{"serviceConfigurations":{"Item1":{"rulegroup":"1493749598520","closedLoopControlName":"ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_1","aaiMatchingFields":["complex.city","vserver.vserver-name"],"aaiSendFields":["complex.city","vserver.vserver-name"],"stringSet":["eventSeverity","WARNING","alarmCondition","Reports a transient alarm condition when an outgoing Ro message send fails"],"timeWindow":"100","ageLimit":"100","createClosedLoopEventId":"Initial","outputEventName":"ONSET"},"Item2":{"rulegroup":"1493749665149","closedLoopControlName":"ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_2","aaiMatchingFields":["cloud-region.identity-url","vserver.vserver-name"],"aaiSendFields":["cloud-region.identity-url","vserver.vserver-name"],"stringSet":["eventSeverity","WARNING","alarmCondition","Reports a transient alarm condition when an outgoing Ro message send fails"],"timeWindow":"1000","ageLimit":"1000","createClosedLoopEventId":"Initial","outputEventName":"ONSET"},"Item3":{"rulegroup":"1493749665149","closedLoopControlName":"ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_2","aaiMatchingFields":["generic-vnf.vnf-name","vserver.vserver-name"],"aaiSendFields":["generic-vnf.vnf-name","vserver.vserver-name"],"stringSet":["eventSeverity","WARNING","alarmCondition","Reports a transient alarm condition when an outgoing Ro message send fails"],"timeWindow":"3000","ageLimit":"3000","createClosedLoopEventId":"Initial","outputEventName":"ABATED"}}}} \ No newline at end of file diff --git a/src/test/resources/expected/tca.json b/src/test/resources/expected/tca.json new file mode 100644 index 00000000..2fd16bde --- /dev/null +++ b/src/test/resources/expected/tca.json @@ -0,0 +1,93 @@ +{ + "service": "MThresholdCrossingConfiguration", + "location": "Edge", + "uuid": "TestUUID", + "policyName": "example_model06.ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_TCA_", + "description": "from clds", + "configName": "MThresholdCrossingConfiguration", + "templateVersion": "5.2.0.1", + "priority": "4", + "version": "5.2.0.1", + "policyScope": "resource=F5,service=vSCP,type=configuration,closedLoopControlName=vSCP_F5_Firewall_d925ed73-8231-4d02-9545-db4e101f88f8", + "content": + { + "$class": "com.att.ecomp.dcae.clamp.common.MThresholdCrossingConfiguration", + "domain": "measurementsForVfScaling", + "policyScope": "pnf=eNodeB;type=configuration", + "policyName": "policy.dcae.configuration", + "policyVersion": "1.0.0", + "subscriberContentType": "application/json", + "subscriberConsumerId": "c13", + "subscriberConsumerGroup": "OpenDCAE-c13", + "subscriberTimeoutMS": "-1", + "subscriberMessageLimit": "-1", + "subscriberPollingInterval": "20000", + "publisherContentType": "application/json", + "publisherMaxBatchSize": "10", + "publisherMaxRecoveryQueueSize": "100000", + "publisherPollingInterval": "20000", + "publisherAlertWindowingTime": "86400", + "signatures": + [ + { + "nfNamingCode": "ENBE", + "target": "common_id", + "targetType": "eNodeB", + "useCaseName": "Narra", + "signatureName": "Narra_886be8da-14fe-tca1-d04b-d13b55d58df9", + "signatureUuid": "886be8da-14fe-tca1-d04b-d13b55d58df9", + "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_1", + "severity": "Warning", + "version": "1.0.2", + "maxInterval": 2, + "minMessageViolations": 3, + "thresholds": + [ + { + "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value", + "thresholdName": "PMRRCCONNESTABFAILCELLLATENCY", + "thresholdValue": 4, + "direction": "LESS" + }, + + { + "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value", + "thresholdName": "PMRAATTCBRA", + "thresholdValue": 30, + "direction": "GREATER" + } + ] + }, + + { + "nfNamingCode": "ENBE", + "target": "common_id", + "targetType": "eNodeB", + "useCaseName": "Srini", + "signatureName": "Srini_8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d", + "signatureUuid": "8b5ba88d-f4b4-tf0e-50b1-78a5a7dd412d", + "closedLoopControlName": "ClosedLoop_FRWL_SIG_fad4dcae_e498_11e6_852e_0050568c4ccf_2", + "severity": "Critical", + "version": "1.0.2", + "maxInterval": 10, + "minMessageViolations": 5, + "thresholds": + [ + { + "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRRCCONNESTABFAILCELLLATENCY')].Value", + "thresholdName": "PMRRCCONNESTABFAILCELLLATENCY", + "thresholdValue": 3, + "direction": "EQUAL" + }, + + { + "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[?(@.Name == 'PMRAATTCBRA')].Value", + "thresholdName": "PMRAATTCBRA", + "thresholdValue": 30, + "direction": "GREATER" + } + ] + } + ] + } +} \ No newline at end of file -- cgit 1.2.3-korg