Fix incorrect policy with time-in-range 61/85261/5
authorPamela Dragosh <pdragosh@research.att.com>
Sat, 13 Apr 2019 15:42:55 +0000 (11:42 -0400)
committerPamela Dragosh <pdragosh@research.att.com>
Mon, 15 Apr 2019 11:59:36 +0000 (07:59 -0400)
Changed policies to use Z vs -05:00 for timezone since
we cannot guarantee the timezone the VM's run in. The
test should be generalized.

Fixed a sonar issue in the test I was using to debug this.

Issue-ID: POLICY-1639
Change-Id: If3e52d199527a8a7e11c5fa994beb8fb886c93a6
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java
applications/guard/src/test/resources/vDNS.policy.guard.blacklist.output.tosca.yaml
applications/guard/src/test/resources/vDNS.policy.guard.frequency.output.tosca.yaml
applications/guard/src/test/resources/vDNS.policy.guard.minmax.output.tosca.yaml

index 7f5a1ce..c4ae5dd 100644 (file)
@@ -360,6 +360,7 @@ public class GuardPdpApplicationTest {
         assertThat(decision.getKey().getStatus()).isEqualTo("Deny");
     }
 
+    @SuppressWarnings("unchecked")
     @Test
     public void test6Blacklist() throws CoderException, XacmlApplicationException {
         LOGGER.info("**************** Running test4 ****************");
index 94471fb..7d3a54e 100644 (file)
@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0_0
 topology_template:
   policies:
     -
-      guard.blacklist.scaleout:
+      guard.frequency.scaleout:
         type: onap.policies.controlloop.guard.Blacklist
         version: 1.0.0
         metadata:
@@ -14,5 +14,5 @@ topology_template:
           targets: vLoadBalancer-01
           clname: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
           limit: 2
-          guardActiveStart: 00:00:00-05:00
-          guardActiveEnd: 23:59:59-05:00
+          guardActiveStart: 00:00:00Z
+          guardActiveEnd: 23:59:59Z
index fd414e1..506a44e 100644 (file)
@@ -16,5 +16,5 @@ topology_template:
           limit: 2
           timeWindow: 10
           timeUnits: minute
-          guardActiveStart: 00:00:00-05:00
-          guardActiveEnd: 23:59:59-05:00
+          guardActiveStart: 00:00:00Z
+          guardActiveEnd: 23:59:59Z
index 88d2186..ff2a423 100644 (file)
@@ -15,5 +15,5 @@ topology_template:
           clname: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
           min: 2
           max: 5
-          guardActiveStart: 00:00:00-05:00
-          guardActiveEnd: 23:59:59-05:00
+          guardActiveStart: 00:00:00Z
+          guardActiveEnd: 23:59:59Z