aboutsummaryrefslogtreecommitdiffstats
path: root/applications/guard/src/test/resources
diff options
context:
space:
mode:
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