aboutsummaryrefslogtreecommitdiffstats
path: root/applications/guard/src/test/resources
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2021-02-17 15:48:01 -0600
committerPamela Dragosh <pdragosh@research.att.com>2021-02-18 10:28:38 -0600
commit5920c029d3818a22f591c6aa1ffff4e34b6df234 (patch)
treeefaec005974d050c78a48b13a34d4e8916098a77 /applications/guard/src/test/resources
parent8cea7022f62f1dba805564acd3f71525cdf95e23 (diff)
Utilize time extensions
Switched to using the new Time Extensions released in XACML from github v3.0. Added more thorough tests for it as well as the flexibility of specifying the current time etc. More syntax checking on the inputs from the policy. Issue-ID: POLICY-2810 Change-Id: I1b4ec885c706e37949e5dabe14c63b0d7456cd4f Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/guard/src/test/resources')
-rw-r--r--applications/guard/src/test/resources/requests/guard.timeinrange.json15
-rw-r--r--applications/guard/src/test/resources/test-bad-policies.yaml42
-rw-r--r--applications/guard/src/test/resources/test-policies.yaml4
-rw-r--r--applications/guard/src/test/resources/test-time-in-range.yaml19
4 files changed, 78 insertions, 2 deletions
diff --git a/applications/guard/src/test/resources/requests/guard.timeinrange.json b/applications/guard/src/test/resources/requests/guard.timeinrange.json
new file mode 100644
index 00000000..709796c2
--- /dev/null
+++ b/applications/guard/src/test/resources/requests/guard.timeinrange.json
@@ -0,0 +1,15 @@
+{
+ "ONAPName": "Policy",
+ "ONAPComponent": "drools-pdp",
+ "ONAPInstance": "usecase-template",
+ "requestId": "unique-request-id-1",
+ "action": "guard",
+ "resource": {
+ "guard": {
+ "actor": "ACTOR",
+ "operation": "OPERATION",
+ "clname": "LOOP",
+ "target": "vnf1"
+ }
+ }
+}
diff --git a/applications/guard/src/test/resources/test-bad-policies.yaml b/applications/guard/src/test/resources/test-bad-policies.yaml
index eb39aded..bdc8ba78 100644
--- a/applications/guard/src/test/resources/test-bad-policies.yaml
+++ b/applications/guard/src/test/resources/test-bad-policies.yaml
@@ -14,6 +14,48 @@ topology_template:
properties:
limit: 5
timeWindow: i am a bad value
+ - frequency-badtimerange_start:
+ type: onap.policies.controlloop.guard.common.FrequencyLimiter
+ type_version: 1.0.0
+ version: 1.0.0
+ properties:
+ actor: APPC
+ operation: Restart
+ timeRange:
+ startTime: 08:00:00Z
+ end_time: 23:59:59Z
+ id: loop-3
+ timeWindow: 8
+ timeUnits: hour
+ limit: 0
+ - frequency-badtimerange_end:
+ type: onap.policies.controlloop.guard.common.FrequencyLimiter
+ type_version: 1.0.0
+ version: 1.0.0
+ properties:
+ actor: APPC
+ operation: Restart
+ timeRange:
+ start_time: 08:00:00Z
+ endTime: 23:59:59Z
+ id: loop-3
+ timeWindow: 8
+ timeUnits: hour
+ limit: 0
+ - frequency-badtimerange_value:
+ type: onap.policies.controlloop.guard.common.FrequencyLimiter
+ type_version: 1.0.0
+ version: 1.0.0
+ properties:
+ actor: APPC
+ operation: Restart
+ timeRange:
+ start_time: 99:99:99
+ end_time: 23:59:59Z
+ id: loop-3
+ timeWindow: 8
+ timeUnits: hour
+ limit: 0
- minmax-notarget:
type: onap.policies.controlloop.guard.common.MinMax
type_version: 1.0.0
diff --git a/applications/guard/src/test/resources/test-policies.yaml b/applications/guard/src/test/resources/test-policies.yaml
index e33f116a..c92006e3 100644
--- a/applications/guard/src/test/resources/test-policies.yaml
+++ b/applications/guard/src/test/resources/test-policies.yaml
@@ -49,8 +49,8 @@ topology_template:
actor: APPC
operation: Restart
timeRange:
- start_time: T00:00:00Z
- end_time: T08:00:00Z
+ start_time: 08:00:00Z
+ end_time: 23:59:59Z
id: loop-3
timeWindow: 8
timeUnits: hour
diff --git a/applications/guard/src/test/resources/test-time-in-range.yaml b/applications/guard/src/test/resources/test-time-in-range.yaml
new file mode 100644
index 00000000..f9463fc1
--- /dev/null
+++ b/applications/guard/src/test/resources/test-time-in-range.yaml
@@ -0,0 +1,19 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+topology_template:
+ policies:
+ -
+ guard.frequency.inrange:
+ type: onap.policies.controlloop.guard.common.FrequencyLimiter
+ type_version: 1.0.0
+ version: 1.0.0
+ name: guard.frequency.inrange
+ properties:
+ actor: ACTOR
+ operation: OPERATION
+ id: LOOP
+ timeWindow: 10
+ timeUnits: minute
+ limit: 10
+ timeRange:
+ start_time: 08:00:00+05:00
+ end_time: 23:59:59+05:00