summaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo/src
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/templates/template.demo/src')
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java9
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java10
-rw-r--r--controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml2
3 files changed, 10 insertions, 11 deletions
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java
index a34ee6cd1..182e39828 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java
@@ -294,7 +294,7 @@ public class VCPEControlLoopTest {
/*
* One final check to make sure the lock is released
*/
- assertFalse(PolicyGuard.isLocked(TargetType.VM, triggerSourceName, requestID));
+ assertFalse(PolicyGuard.isLocked(TargetType.VNF, triggerSourceName, requestID));
}
else {
fail("Operation Denied by Guard");
@@ -389,13 +389,12 @@ public class VCPEControlLoopTest {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.closedLoopControlName = policy.getControlLoop().getControlLoopName();
event.requestID = requestID;
- event.target = "vserver.vserver-name";
+ event.target = "generic-vnf.vnf-id";
event.closedLoopAlarmStart = Instant.now();
event.AAI = new HashMap<>();
event.AAI.put("cloud-region.identity-url", "foo");
event.AAI.put("vserver.selflink", "bar");
event.AAI.put("vserver.is-closed-loop-disabled", "false");
- event.AAI.put("vserver.vserver-name", "testGenericVnfName");
event.AAI.put("generic-vnf.vnf-id", "testGenericVnfId");
event.closedLoopEventStatus = ControlLoopEventStatus.ONSET;
kieSession.insert(event);
@@ -415,14 +414,14 @@ public class VCPEControlLoopTest {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.closedLoopControlName = policy.getControlLoop().getControlLoopName();
event.requestID = requestID;
- event.target = "vserver.vserver-name";
+ event.target = "generic-vnf.vnf-id";
event.closedLoopAlarmStart = Instant.now().minusSeconds(5);
event.closedLoopAlarmEnd = Instant.now();
event.AAI = new HashMap<>();
event.AAI.put("cloud-region.identity-url", "foo");
event.AAI.put("vserver.selflink", "bar");
event.AAI.put("vserver.is-closed-loop-disabled", "false");
- event.AAI.put("generic-vnf.vnf-name", "testGenericVnfName");
+ event.AAI.put("generic-vnf.vnf-id", "testGenericVnfId");
event.closedLoopEventStatus = ControlLoopEventStatus.ABATED;
kieSession.insert(event);
}
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java
index 25920e8b5..e2b688d5d 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java
@@ -289,7 +289,7 @@ public class VFWControlLoopTest {
/*
* One final check to make sure the lock is released
*/
- assertFalse(PolicyGuard.isLocked(TargetType.VM, triggerSourceName, requestID));
+ assertFalse(PolicyGuard.isLocked(TargetType.VNF, triggerSourceName, requestID));
}
else {
fail("Operation Denied by Guard");
@@ -384,13 +384,13 @@ public class VFWControlLoopTest {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.closedLoopControlName = policy.getControlLoop().getControlLoopName();
event.requestID = requestID;
- event.target = "vserver.vserver-name";
+ event.target = "generic-vnf.vnf-id";
event.closedLoopAlarmStart = Instant.now();
event.AAI = new HashMap<>();
event.AAI.put("cloud-region.identity-url", "foo");
event.AAI.put("vserver.selflink", "bar");
event.AAI.put("vserver.is-closed-loop-disabled", "false");
- event.AAI.put("vserver.vserver-name", "testGenericVnfName");
+ event.AAI.put("generic-vnf.vnf-id", "testGenericVnfID");
event.closedLoopEventStatus = ControlLoopEventStatus.ONSET;
kieSession.insert(event);
Thread.sleep(2000);
@@ -409,14 +409,14 @@ public class VFWControlLoopTest {
VirtualControlLoopEvent event = new VirtualControlLoopEvent();
event.closedLoopControlName = policy.getControlLoop().getControlLoopName();
event.requestID = requestID;
- event.target = "vserver.vserver-name";
+ event.target = "generic-vnf.vnf-id";
event.closedLoopAlarmStart = Instant.now().minusSeconds(5);
event.closedLoopAlarmEnd = Instant.now();
event.AAI = new HashMap<>();
event.AAI.put("cloud-region.identity-url", "foo");
event.AAI.put("vserver.selflink", "bar");
event.AAI.put("vserver.is-closed-loop-disabled", "false");
- event.AAI.put("generic-vnf.vnf-name", "testGenericVnfName");
+ event.AAI.put("generic-vnf.vnf-id", "testGenericVnfID");
event.closedLoopEventStatus = ControlLoopEventStatus.ABATED;
kieSession.insert(event);
}
diff --git a/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml b/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml
index e78b1ca33..d15c46126 100644
--- a/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml
+++ b/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml
@@ -17,7 +17,7 @@ policies:
recipe: ModifyConfig
target:
resourceID: Eace933104d443b496b8.nodes.heat.vpg
- type: VM
+ type: VNF
retry: 0
timeout: 300
success: final_success