aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java15
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java20
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_VOLTE.yaml23
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_vCPE.yaml23
4 files changed, 64 insertions, 17 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java
index 87eb5170f..8f3928cdd 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PIPEngineGetHistory.java
@@ -179,21 +179,6 @@ public class PIPEngineGetHistory extends StdConfigurableEngine{
-
- private void addStringAttribute(StdMutablePIPResponse stdPIPResponse, Identifier category, Identifier attributeId, String value) {
- if (value != null) {
- AttributeValue<String> attributeValue = null;
- try {
- attributeValue = DataTypes.DT_STRING.createAttributeValue(value);
- } catch (Exception ex) {
- //this.logger.error("Failed to convert " + value + " to an AttributeValue<String>", ex);
- }
- if (attributeValue != null) {
- stdPIPResponse.addAttribute(new StdMutableAttribute(category, attributeId, attributeValue, this.getIssuer(), false));
- }
- }
- }
-
private PIPResponse getAttribute(PIPRequest pipRequest, PIPFinder pipFinder) {
PIPResponse pipResponse = null;
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
index 555b69282..b0d15463d 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
@@ -53,8 +53,24 @@ public class ControlLoopPolicyTest {
}
@Test
- public void testvService2() {
- this.test("src/test/resources/v2.0.0/policy_vService.yaml");
+ public void testvDNS() {
+ this.test("src/test/resources/v2.0.0/policy_ONAP_demo_vDNS.yaml");
+ }
+
+ @Test
+ public void testvFirewall() {
+ // Chenfei to fix this.
+// this.test("src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml");
+ }
+
+ @Test
+ public void testvCPE() {
+ this.test("src/test/resources/v2.0.0/policy_ONAP_UseCase_vCPE.yaml");
+ }
+
+ @Test
+ public void testVOLTE() {
+ this.test("src/test/resources/v2.0.0/policy_ONAP_UseCase_VOLTE.yaml");
}
public void test(String testFile) {
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_VOLTE.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_VOLTE.yaml
new file mode 100644
index 000000000..0e65d44fd
--- /dev/null
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_VOLTE.yaml
@@ -0,0 +1,23 @@
+controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b
+
+ trigger_policy: unique-policy-id-1-restart
+ timeout: 3600
+
+policies:
+ - id: unique-policy-id-1-restart
+ name: Restart the VM
+ description:
+ actor: VFC
+ recipe: Restart
+ target:
+ type: VM
+ retry: 3
+ timeout: 1200
+ success: final_success
+ failure: final_failure
+ failure_timeout: final_failure_timeout
+ failure_retries: final_failure_retries
+ failure_exception: final_failure_exception
+ failure_guard: final_failure_guard
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_vCPE.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_vCPE.yaml
new file mode 100644
index 000000000..803140669
--- /dev/null
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_UseCase_vCPE.yaml
@@ -0,0 +1,23 @@
+controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
+
+ trigger_policy: unique-policy-id-1-restart
+ timeout: 3600
+
+policies:
+ - id: unique-policy-id-1-restart
+ name: Restart the VM
+ description:
+ actor: APPC
+ recipe: Restart
+ target:
+ type: VM
+ retry: 3
+ timeout: 1200
+ success: final_success
+ failure: final_failure
+ failure_timeout: final_failure_timeout
+ failure_retries: final_failure_retries
+ failure_exception: final_failure_exception
+ failure_guard: final_failure_guard