summaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-trans/src/test/resources
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2020-04-23 13:18:48 -0500
committerjhh <jorge.hernandez-herrero@att.com>2020-04-23 15:48:55 -0500
commite8401780120dc035b074d932b89445cfce228634 (patch)
tree36acfa1d5f6e1a522940fd3da2648b8d6f6ee450 /controlloop/common/feature-controlloop-trans/src/test/resources
parent3dde9f0b68fae53c14f8fe89e58022381f1f17e0 (diff)
transaction tracking improvements with telemetry
Issue-ID: POLICY-2456 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I75b7e8e787d567cf120d7ae7d65d1bff12e8e24e Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'controlloop/common/feature-controlloop-trans/src/test/resources')
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/resources/logback.xml148
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-active.json21
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-final-success.json32
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-operation.json22
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-permit.json22
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart-success.json33
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart.json22
7 files changed, 300 insertions, 0 deletions
diff --git a/controlloop/common/feature-controlloop-trans/src/test/resources/logback.xml b/controlloop/common/feature-controlloop-trans/src/test/resources/logback.xml
new file mode 100644
index 000000000..6a25769e3
--- /dev/null
+++ b/controlloop/common/feature-controlloop-trans/src/test/resources/logback.xml
@@ -0,0 +1,148 @@
+<!--
+ ============LICENSE_START=======================================================
+ policy-management
+ ================================================================================
+ Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ 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.
+ ============LICENSE_END=========================================================
+ -->
+
+<configuration scan="true" scanPeriod="30 seconds" debug="false">
+
+ <property name="logDir" value="target/test-classes" />
+
+ <property name="errorLog" value="error" />
+ <property name="debugLog" value="debug" />
+ <property name="networkLog" value="network" />
+
+ <property name="metricLog" value="metric" />
+ <property name="transactionLog" value="audit" />
+
+ <property name="debugPattern"
+ value="[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%level|%logger{0}|%thread] %msg%n" />
+ <property name="errorPattern" value="${debugPattern}" />
+ <property name="networkPattern" value="[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}|%t]%m%n" />
+ <property name="abstractNetworkPattern"
+ value="[%d{yyyy-MM-dd'T'HH:mm:ss.SSS+00:00, UTC}] [%X{networkEventType:-NULL}|%X{networkProtocol:-NULL}|%X{networkTopic:-NULL}|%X{requestID:-NULL}]%n" />
+
+ <property name="metricPattern"
+ value="%X{RequestID}|%X{InvocationID}|%X{ServiceName}|%X{PartnerName}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{ElapsedTime}|%X{ServiceInstanceID}|%X{VirtualServerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{Severity}|%X{TargetEntity}|%X{TargetServiceName}|%X{Server}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{ClientIPAddress}|%X{ProcessKey}|%X{RemoteHost}||%X{TargetVirtualEntity}|%level|%thread| %msg%n" />
+ <property name="transactionPattern" value="${metricPattern}" />
+
+ <appender name="ErrorOut" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDir}/${errorLog}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logDir}/${errorLog}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>50MB</maxFileSize>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>10GB</totalSizeCap>
+ </rollingPolicy>
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>WARN</level>
+ </filter>
+ <encoder>
+ <pattern>${errorPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="AsyncErrorOut" class="ch.qos.logback.classic.AsyncAppender">
+ <appender-ref ref="ErrorOut" />
+ </appender>
+
+ <appender name="DebugOut" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDir}/${debugLog}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logDir}/${debugLog}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>50MB</maxFileSize>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>10GB</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${debugPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="AsyncDebugOut" class="ch.qos.logback.classic.AsyncAppender">
+ <appender-ref ref="DebugOut" />
+ </appender>
+
+ <appender name="NetworkOut" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDir}/${networkLog}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logDir}/${networkLog}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>50MB</maxFileSize>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>10GB</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${networkPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="AsyncNetworkOut" class="ch.qos.logback.classic.AsyncAppender">
+ <appender-ref ref="NetworkOut" />
+ </appender>
+
+ <appender name="MetricOut" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDir}/${metricLog}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logDir}/${metricLog}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>50MB</maxFileSize>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>10GB</totalSizeCap>
+ </rollingPolicy>
+ <filter class="org.onap.policy.drools.utils.logging.LoggerMarkerFilter$MetricLoggerMarkerFilter" />
+ <encoder>
+ <pattern>${metricPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="AsyncMetricOut" class="ch.qos.logback.classic.AsyncAppender">
+ <appender-ref ref="MetricOut" />
+ </appender>
+
+ <appender name="TransactionOut" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDir}/${transactionLog}.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${logDir}/${transactionLog}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>50MB</maxFileSize>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>10GB</totalSizeCap>
+ </rollingPolicy>
+ <filter class="org.onap.policy.drools.utils.logging.LoggerMarkerFilter$TransactionLoggerMarkerFilter" />
+ <encoder>
+ <pattern>${transactionPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="AsyncTransactionOut" class="ch.qos.logback.classic.AsyncAppender">
+ <appender-ref ref="TransactionOut" />
+ </appender>
+
+ <logger name="network" level="INFO" additivity="false">
+ <appender-ref ref="AsyncNetworkOut" />
+ </logger>
+
+ <logger name="org.eclipse.jetty.server.RequestLog" level="info" additivity="false">
+ <appender-ref ref="AsyncNetworkOut" />
+ </logger>
+
+ <root level="INFO">
+ <appender-ref ref="AsyncDebugOut" />
+ <appender-ref ref="AsyncErrorOut" />
+ <appender-ref ref="AsyncMetricOut" />
+ <appender-ref ref="AsyncTransactionOut" />
+ </root>
+
+</configuration>
diff --git a/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-active.json b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-active.json
new file mode 100644
index 000000000..9430327c3
--- /dev/null
+++ b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-active.json
@@ -0,0 +1,21 @@
+{
+ "AAI": {
+ "vserver.prov-status": "ACTIVE",
+ "vserver.is-closed-loop-disabled": "false",
+ "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+ },
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "requestId": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+ "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+ "targetType": "VNF",
+ "target": "generic-vnf.vnf-id",
+ "from": "policy",
+ "policyScope": "onap.policies.controlloop.operational.common.Drools:1.0.0",
+ "policyName": "operational.restart.EVENT",
+ "policyVersion": "1.0.0",
+ "notification": "ACTIVE",
+ "notificationTime": "2020-04-20 19:12:17.223175+00:00",
+ "history": []
+}
diff --git a/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-final-success.json b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-final-success.json
new file mode 100644
index 000000000..e1f98de28
--- /dev/null
+++ b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-final-success.json
@@ -0,0 +1,32 @@
+{
+ "AAI": {
+ "vserver.prov-status": "ACTIVE",
+ "vserver.is-closed-loop-disabled": "false",
+ "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+ },
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "requestId": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+ "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+ "targetType": "VNF",
+ "target": "generic-vnf.vnf-id",
+ "from": "policy",
+ "policyScope": "onap.policies.controlloop.operational.common.Drools:1.0.0",
+ "policyName": "operational.restart.EVENT.MANAGER.FINAL",
+ "policyVersion": "1.0.0",
+ "notification": "FINAL: SUCCESS",
+ "notificationTime": "2020-04-20 19:12:17.684718+00:00",
+ "history": [
+ {
+ "actor": "APPC",
+ "operation": "Restart",
+ "target": "Target [type=VM, resourceId=null]",
+ "start": 1587409937614,
+ "end": 1587409937679,
+ "subRequestId": "38ce5fcb-f16a-4cfc-abc6-8d8b78e2f959",
+ "outcome": "Success",
+ "message": "Restart Successful"
+ }
+ ]
+}
diff --git a/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-operation.json b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-operation.json
new file mode 100644
index 000000000..567af4893
--- /dev/null
+++ b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-operation.json
@@ -0,0 +1,22 @@
+{
+ "AAI": {
+ "vserver.prov-status": "ACTIVE",
+ "vserver.is-closed-loop-disabled": "false",
+ "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+ },
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "requestId": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+ "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+ "targetType": "VNF",
+ "target": "generic-vnf.vnf-id",
+ "from": "policy",
+ "policyScope": "onap.policies.controlloop.operational.common.Drools:1.0.0",
+ "policyName": "operational.restart.EVENT.MANAGER.PROCESSING",
+ "policyVersion": "1.0.0",
+ "notification": "OPERATION",
+ "message": "Sending guard query for APPC Restart",
+ "notificationTime": "2020-04-20 19:12:17.244277+00:00",
+ "history": []
+}
diff --git a/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-permit.json b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-permit.json
new file mode 100644
index 000000000..d8c28be61
--- /dev/null
+++ b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-permit.json
@@ -0,0 +1,22 @@
+{
+ "AAI": {
+ "vserver.prov-status": "ACTIVE",
+ "vserver.is-closed-loop-disabled": "false",
+ "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+ },
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "requestId": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+ "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+ "targetType": "VNF",
+ "target": "generic-vnf.vnf-id",
+ "from": "policy",
+ "policyScope": "onap.policies.controlloop.operational.common.Drools:1.0.0",
+ "policyName": "operational.restart.EVENT.MANAGER.PROCESSING",
+ "policyVersion": "1.0.0",
+ "notification": "OPERATION",
+ "message": "Guard result for APPC Restart is Permit",
+ "notificationTime": "2020-04-20 19:12:17.608770+00:00",
+ "history": []
+}
diff --git a/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart-success.json b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart-success.json
new file mode 100644
index 000000000..80686452d
--- /dev/null
+++ b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart-success.json
@@ -0,0 +1,33 @@
+{
+ "AAI": {
+ "vserver.prov-status": "ACTIVE",
+ "vserver.is-closed-loop-disabled": "false",
+ "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+ },
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "requestId": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+ "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+ "targetType": "VNF",
+ "target": "generic-vnf.vnf-id",
+ "from": "policy",
+ "policyScope": "onap.policies.controlloop.operational.common.Drools:1.0.0",
+ "policyName": "operational.restart.EVENT.MANAGER.PROCESSING",
+ "policyVersion": "1.0.0",
+ "notification": "OPERATION: SUCCESS",
+ "message": "actor=APPC,operation=Restart,target=Target [type=VM, resourceId=null],start=2020-04-20T19:12:17.614106Z,end=2020-04-20T19:12:17.679500Z,subRequestId=38ce5fcb-f16a-4cfc-abc6-8d8b78e2f959,outcome=Success,message=Restart Successful",
+ "notificationTime": "2020-04-20 19:12:17.680716+00:00",
+ "history": [
+ {
+ "actor": "APPC",
+ "operation": "Restart",
+ "target": "Target [type=VM, resourceId=null]",
+ "start": 1587409937614,
+ "end": 1587409937679,
+ "subRequestId": "38ce5fcb-f16a-4cfc-abc6-8d8b78e2f959",
+ "outcome": "Success",
+ "message": "Restart Successful"
+ }
+ ]
+}
diff --git a/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart.json b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart.json
new file mode 100644
index 000000000..1825a02be
--- /dev/null
+++ b/controlloop/common/feature-controlloop-trans/src/test/resources/policy-cl-mgt-restart.json
@@ -0,0 +1,22 @@
+{
+ "AAI": {
+ "vserver.prov-status": "ACTIVE",
+ "vserver.is-closed-loop-disabled": "false",
+ "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
+ },
+ "closedLoopAlarmStart": 1463679805324,
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "requestId": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+ "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
+ "targetType": "VNF",
+ "target": "generic-vnf.vnf-id",
+ "from": "policy",
+ "policyScope": "onap.policies.controlloop.operational.common.Drools:1.0.0",
+ "policyName": "operational.restart.EVENT.MANAGER.PROCESSING",
+ "policyVersion": "1.0.0",
+ "notification": "OPERATION",
+ "message": "actor=APPC,operation=Restart,target=Target [type=VM, resourceId=null],subRequestId=38ce5fcb-f16a-4cfc-abc6-8d8b78e2f959",
+ "notificationTime": "2020-04-20 19:12:17.614625+00:00",
+ "history": []
+}