summaryrefslogtreecommitdiffstats
path: root/applications/guard/src/test/resources
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-04-12 00:42:26 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-12 00:42:26 +0000
commita5b035d9bb633cf5d520a62c451250db4b018a13 (patch)
tree3a119bf41705b360689465bdddc7c8c9f4bf69c9 /applications/guard/src/test/resources
parent578c96027a8ba1bde8b50b45d4b846daf61ecfd5 (diff)
parentfca3dd7b4bdc33b579750004c9d3bc163d20a2a7 (diff)
Merge "Add Control Loop Coordination policy."
Diffstat (limited to 'applications/guard/src/test/resources')
-rw-r--r--applications/guard/src/test/resources/META-INF/persistence.xml8
-rw-r--r--applications/guard/src/test/resources/requests/coordination.cl.1.node.1.json15
-rw-r--r--applications/guard/src/test/resources/requests/coordination.cl.1.node.2.json15
-rw-r--r--applications/guard/src/test/resources/requests/coordination.cl.2.node.1.json15
-rw-r--r--applications/guard/src/test/resources/requests/coordination.cl.2.node.2.json16
-rw-r--r--applications/guard/src/test/resources/requests/guard.vfCount.1.json16
-rw-r--r--applications/guard/src/test/resources/requests/guard.vfCount.3.json16
-rw-r--r--applications/guard/src/test/resources/requests/guard.vfCount.6.json16
-rw-r--r--applications/guard/src/test/resources/test.policy.guard.coordination.firstBlocksSecond.tosca.yaml14
-rw-r--r--applications/guard/src/test/resources/xacml.properties29
10 files changed, 141 insertions, 19 deletions
diff --git a/applications/guard/src/test/resources/META-INF/persistence.xml b/applications/guard/src/test/resources/META-INF/persistence.xml
index de399c48..8d1e08ad 100644
--- a/applications/guard/src/test/resources/META-INF/persistence.xml
+++ b/applications/guard/src/test/resources/META-INF/persistence.xml
@@ -8,9 +8,9 @@
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.
@@ -23,10 +23,11 @@
<persistence-unit name="OperationsHistoryPUTest" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <class>org.onap.policy.pdp.xacml.application.common.OnapOperationsHistoryDbao</class>
+ <class>org.onap.policy.pdp.xacml.application.common.operationshistory.Dbao</class>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.logging.level" value="FINE" />
+ <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:testdb;DATABASE_TO_UPPER=FALSE" />
<property name="javax.persistence.jdbc.user" value="policy" />
@@ -38,4 +39,3 @@
</persistence-unit>
</persistence>
- \ No newline at end of file
diff --git a/applications/guard/src/test/resources/requests/coordination.cl.1.node.1.json b/applications/guard/src/test/resources/requests/coordination.cl.1.node.1.json
new file mode 100644
index 00000000..dd461005
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/coordination.cl.1.node.1.json
@@ -0,0 +1,15 @@
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-47",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "SDNR",
+ "recipe": "Tilt",
+ "clname": "cl1",
+ "target": "node1"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/requests/coordination.cl.1.node.2.json b/applications/guard/src/test/resources/requests/coordination.cl.1.node.2.json
new file mode 100644
index 00000000..dbd3a53a
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/coordination.cl.1.node.2.json
@@ -0,0 +1,15 @@
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-4712",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "SDNR",
+ "recipe": "Tilt",
+ "clname": "cl1",
+ "target": "node2"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/requests/coordination.cl.2.node.1.json b/applications/guard/src/test/resources/requests/coordination.cl.2.node.1.json
new file mode 100644
index 00000000..edccc45b
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/coordination.cl.2.node.1.json
@@ -0,0 +1,15 @@
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-6877",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "SDNR",
+ "recipe": "Tilt",
+ "clname": "cl2",
+ "target": "node1"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/requests/coordination.cl.2.node.2.json b/applications/guard/src/test/resources/requests/coordination.cl.2.node.2.json
new file mode 100644
index 00000000..c1401f22
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/coordination.cl.2.node.2.json
@@ -0,0 +1,16 @@
+
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-6837",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "SDNR",
+ "recipe": "Tilt",
+ "clname": "cl2",
+ "target": "node2"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/requests/guard.vfCount.1.json b/applications/guard/src/test/resources/requests/guard.vfCount.1.json
new file mode 100644
index 00000000..ef1b5f65
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/guard.vfCount.1.json
@@ -0,0 +1,16 @@
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-1",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "SO",
+ "recipe": "VF Module Create",
+ "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "target": "vLoadBalancer-00",
+ "vfCount": "1"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/requests/guard.vfCount.3.json b/applications/guard/src/test/resources/requests/guard.vfCount.3.json
new file mode 100644
index 00000000..9faa55d6
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/guard.vfCount.3.json
@@ -0,0 +1,16 @@
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-3",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "SO",
+ "recipe": "VF Module Create",
+ "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "target": "vLoadBalancer-00",
+ "vfCount": "3"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/requests/guard.vfCount.6.json b/applications/guard/src/test/resources/requests/guard.vfCount.6.json
new file mode 100644
index 00000000..e00d67ae
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/guard.vfCount.6.json
@@ -0,0 +1,16 @@
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-2",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "SO",
+ "recipe": "VF Module Create",
+ "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "target": "vLoadBalancer-00",
+ "vfCount" : "6"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/test.policy.guard.coordination.firstBlocksSecond.tosca.yaml b/applications/guard/src/test/resources/test.policy.guard.coordination.firstBlocksSecond.tosca.yaml
new file mode 100644
index 00000000..649820b0
--- /dev/null
+++ b/applications/guard/src/test/resources/test.policy.guard.coordination.firstBlocksSecond.tosca.yaml
@@ -0,0 +1,14 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ guard.coordination.firstBlocksSecond.test:
+ type: onap.policies.controlloop.guard.coordination.FirstBlocksSecond
+ version: 1.0.0
+ metadata:
+ policy-id : guard.coordination.firstBlocksSecond.test
+ policy-version: 1
+ properties:
+ controlLoop:
+ - cl1
+ - cl2
diff --git a/applications/guard/src/test/resources/xacml.properties b/applications/guard/src/test/resources/xacml.properties
index 25dee375..534c538c 100644
--- a/applications/guard/src/test/resources/xacml.properties
+++ b/applications/guard/src/test/resources/xacml.properties
@@ -24,23 +24,22 @@ xacml.att.policyFinderFactory=org.onap.policy.pdp.xacml.application.common.OnapP
#
xacml.att.policyFinderFactory.combineRootPolicies=urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:deny-overrides
-xacml.pip.engines=historydb
-
#
-# PIP Engine Definition
+# PIP Engine Definitions
#
-historydb.classname=org.onap.policy.pdp.xacml.application.common.OnapOperationsHistoryPipEngine
-historydb.issuer=urn:org:onap:xacml:guard:historydb
-historydb.name=operationHistoryDB
-historydb.description=Returns operation counts based on time window
+count-recent-operations.classname=org.onap.policy.pdp.xacml.application.common.operationshistory.CountRecentOperationsPip
+count-recent-operations.issuer=urn:org:onap:xacml:guard:count-recent-operations
+count-recent-operations.name=CountRecentOperations
+count-recent-operations.description=Returns operation counts based on time window
+count-recent-operations.persistenceunit=OperationsHistoryPUTest
-#
-# Database persistence for PIP
-#
-historydb.persistenceunit=OperationsHistoryPUTest
+get-operation-outcome.classname=org.onap.policy.pdp.xacml.application.common.operationshistory.GetOperationOutcomePip
+get-operation-outcome.issuer=urn:org:onap:xacml:guard:get-operation-outcome
+get-operation-outcome.name=GetOperationOutcome
+get-operation-outcome.description=Returns operation outcome
+get-operation-outcome.persistenceunit=OperationsHistoryPUTest
-# Policies to load
#
-#xacml.rootPolicies=guard
-#guard.file=src/main/resources/RootGuardPolicy.xml
-
+# Make pips available to finder
+#
+xacml.pip.engines=count-recent-operations,get-operation-outcome \ No newline at end of file