From 041017a10245054de9d32e9dceefdafef3e694ac Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 20 Mar 2020 17:17:00 -0400 Subject: Remove vLB from drools-apps Added a test for legacy policy to vDNS. Issue-ID: POLICY-2434 Signed-off-by: Jim Hahn Change-Id: I92fc7813067d3e98562e5d1c7f0da7afe5aac96d --- .../common/rules/test/BaseRuleTest.java | 43 +++++++------------ .../src/main/resources/vdns/tosca-legacy-vdns.json | 9 ++++ .../main/resources/vlb/tosca-compliant-vlb.json | 48 ---------------------- .../src/main/resources/vlb/tosca-vlb.json | 9 ---- .../src/main/resources/vlb/vlb.onset.json | 16 -------- .../common/rules/test/BaseRuleTestTest.java | 15 +++---- 6 files changed, 29 insertions(+), 111 deletions(-) create mode 100644 controlloop/common/rules-test/src/main/resources/vdns/tosca-legacy-vdns.json delete mode 100644 controlloop/common/rules-test/src/main/resources/vlb/tosca-compliant-vlb.json delete mode 100644 controlloop/common/rules-test/src/main/resources/vlb/tosca-vlb.json delete mode 100644 controlloop/common/rules-test/src/main/resources/vlb/vlb.onset.json diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java index f8b033ca0..c582ecebe 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTest.java @@ -46,6 +46,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; */ public abstract class BaseRuleTest { private static final String APPC_RESTART_OP = "restart"; + private static final String APPC_MODIFY_CONFIG_OP = "ModifyConfig"; /* * Canonical Topic Names. @@ -82,6 +83,7 @@ public abstract class BaseRuleTest { private static final String VCPE_APPC_SUCCESS = "vcpe/vcpe.appc.success.json"; // VDNS + private static final String VDNS_TOSCA_LEGACY_POLICY = "vdns/tosca-legacy-vdns.json"; private static final String VDNS_TOSCA_COMPLIANT_POLICY = "vdns/tosca-compliant-vdns.json"; private static final String VDNS_ONSET = "vdns/vdns.onset.json"; @@ -93,11 +95,6 @@ public abstract class BaseRuleTest { private static final String VFW_APPC_SUCCESS = "vfw/vfw.appc.success.json"; private static final String VFW_APPC_FAILURE = "vfw/vfw.appc.failure.json"; - // VLB - private static final String VLB_TOSCA_LEGACY_POLICY = "vlb/tosca-vlb.json"; - private static final String VLB_TOSCA_COMPLIANT_POLICY = "vlb/tosca-compliant-vlb.json"; - private static final String VLB_ONSET = "vlb/vlb.onset.json"; - /* * Coders used to decode requests and responses. */ @@ -298,6 +295,14 @@ public abstract class BaseRuleTest { // VDNS + /** + * Sunny Day with Legacy Tosca Policy. + */ + @Test + public void testVdnsSunnyDayLegacy() { + httpSunnyDay(VDNS_TOSCA_LEGACY_POLICY, VDNS_ONSET); + } + /** * Sunny Day with Tosca Compliant Policy. */ @@ -313,7 +318,7 @@ public abstract class BaseRuleTest { */ @Test public void testVfwSunnyDayLegacy() { - appcLegacySunnyDay(VFW_TOSCA_LEGACY_POLICY, VFW_ONSET, "ModifyConfig"); + appcLegacySunnyDay(VFW_TOSCA_LEGACY_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP); } /** @@ -321,7 +326,7 @@ public abstract class BaseRuleTest { */ @Test public void testVfwSunnyDayCompliant() { - appcLegacySunnyDay(VFW_TOSCA_COMPLIANT_POLICY, VFW_ONSET, "ModifyConfig"); + appcLegacySunnyDay(VFW_TOSCA_COMPLIANT_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP); } /** @@ -329,7 +334,7 @@ public abstract class BaseRuleTest { */ @Test public void testVfwRainyDayLegacyFailure() { - appcLegacyRainyDay(VFW_TOSCA_LEGACY_POLICY, VFW_ONSET, "ModifyConfig"); + appcLegacyRainyDay(VFW_TOSCA_LEGACY_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP); } /** @@ -337,7 +342,7 @@ public abstract class BaseRuleTest { */ @Test public void testVfwRainyDayOverallTimeout() { - appcLegacyRainyDayNoResponse(VFW_TOSCA_COMPLIANT_TIME_OUT_POLICY, VFW_ONSET, "ModifyConfig"); + appcLegacyRainyDayNoResponse(VFW_TOSCA_COMPLIANT_TIME_OUT_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP); } /** @@ -345,25 +350,7 @@ public abstract class BaseRuleTest { */ @Test public void testVfwRainyDayCompliantTimeout() { - appcLegacyRainyDayNoResponse(VFW_TOSCA_COMPLIANT_POLICY, VFW_ONSET, "ModifyConfig"); - } - - // VLB - - /** - * Sunny Day with Legacy Tosca Policy. - */ - @Test - public void testVlbSunnyDayLegacy() { - httpSunnyDay(VLB_TOSCA_LEGACY_POLICY, VLB_ONSET); - } - - /** - * Sunny Day with Tosca Compliant Policy. - */ - @Test - public void testVlbSunnyDayCompliant() { - httpSunnyDay(VLB_TOSCA_COMPLIANT_POLICY, VLB_ONSET); + appcLegacyRainyDayNoResponse(VFW_TOSCA_COMPLIANT_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP); } /** diff --git a/controlloop/common/rules-test/src/main/resources/vdns/tosca-legacy-vdns.json b/controlloop/common/rules-test/src/main/resources/vdns/tosca-legacy-vdns.json new file mode 100644 index 000000000..e43ae09b0 --- /dev/null +++ b/controlloop/common/rules-test/src/main/resources/vdns/tosca-legacy-vdns.json @@ -0,0 +1,9 @@ +{ + "type": "onap.policies.controlloop.Operational", + "type_version": "1.0.0", + "properties": { + "content": "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A%20%20services%3A%0A%20%20%20%20-%20serviceName%3A%20d4738992-6497-4dca-9db9%0A%20%20%20%20%20%20serviceInvariantUUID%3A%20dc112d6e-7e73-4777-9c6f-1a7fb5fd1b6f%0A%20%20%20%20%20%20serviceUUID%3A%202eea06c6-e1d3-4c3a-b9c4-478c506eeedf%0A%20%20trigger_policy%3A%20unique-policy-id-1-scale-up%0A%20%20timeout%3A%2060%0A%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20name%3A%20Create%20a%20new%20VF%20Module%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20SO%0A%20%20%20%20recipe%3A%20VF%20Module%20Create%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VFMODULE%0A%20%20%20%20%20%20modelInvariantId%3A%20e6130d03-56f1-4b0a-9a1d-e1b2ebc30e0e%0A%20%20%20%20%20%20modelVersionId%3A%2094b18b1d-cc91-4f43-911a-e6348665f292%0A%20%20%20%20%20%20modelName%3A%20VfwclVfwsnkBbefb8ce2bde..base_vfw..module-0%0A%20%20%20%20%20%20modelVersion%3A%201%0A%20%20%20%20%20%20modelCustomizationId%3A%2047958575-138f-452a-8c8d-d89b595f8164%0A%20%20%20%20payload%3A%0A%20%20%20%20%20%20requestParameters%3A%20%27%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D%27%0A%20%20%20%20%20%20configurationParameters%3A%20%27%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D%27%0A%20%20%20%20retry%3A%200%0A%20%20%20%20timeout%3A%2030%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard%0A" + }, + "name": "vdns", + "version": "1.0.0" +} diff --git a/controlloop/common/rules-test/src/main/resources/vlb/tosca-compliant-vlb.json b/controlloop/common/rules-test/src/main/resources/vlb/tosca-compliant-vlb.json deleted file mode 100644 index 8a3b64a0a..000000000 --- a/controlloop/common/rules-test/src/main/resources/vlb/tosca-compliant-vlb.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "type": "onap.policies.controlloop.operational.common.Drools", - "type_version": "1.0.0", - "name": "operational.scaleout", - "version": "1.0.0", - "metadata": { - "policy-id": "operational.scaleout" - }, - "properties": { - "controllerName": "usecases", - "id": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "timeout": 1200, - "abatement": false, - "trigger": "unique-policy-id-1-scale-up", - "operations": [ - { - "id": "unique-policy-id-1-scale-up", - "description": "Create a new VF Module", - "operation": { - "actor": "SO", - "operation": "VF Module Create", - "target": { - "targetType": "VFMODULE", - "entityIds": { - "modelInvariantId": "e6130d03-56f1-4b0a-9a1d-e1b2ebc30e0e", - "modelVersionId": "94b18b1d-cc91-4f43-911a-e6348665f292", - "modelName": "VfwclVfwsnkBbefb8ce2bde..base_vfw..module-0", - "modelVersion": 1, - "modelCustomizationId": "47958575-138f-452a-8c8d-d89b595f8164" - } - }, - "payload": { - "requestParameters": "{\"usePreload\":true,\"userParams\":[]}", - "configurationParameters": "[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[9]\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[16]\",\"enabled\":\"$.vf-module-topology.vf-module-parameters.param[23]\"}]" - } - }, - "timeout": 1200, - "retries": 0, - "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/rules-test/src/main/resources/vlb/tosca-vlb.json b/controlloop/common/rules-test/src/main/resources/vlb/tosca-vlb.json deleted file mode 100644 index c4f2b8179..000000000 --- a/controlloop/common/rules-test/src/main/resources/vlb/tosca-vlb.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "onap.policies.controlloop.Operational", - "type_version": "1.0.0", - "properties": { - "content": "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A%20%20services%3A%0A%20%20%20%20-%20serviceName%3A%20d4738992-6497-4dca-9db9%0A%20%20%20%20%20%20serviceInvariantUUID%3A%20dc112d6e-7e73-4777-9c6f-1a7fb5fd1b6f%0A%20%20%20%20%20%20serviceUUID%3A%202eea06c6-e1d3-4c3a-b9c4-478c506eeedf%0A%20%20trigger_policy%3A%20unique-policy-id-1-scale-up%0A%20%20timeout%3A%2060%0A%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20name%3A%20Create%20a%20new%20VF%20Module%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20SO%0A%20%20%20%20recipe%3A%20VF%20Module%20Create%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VFMODULE%0A%20%20%20%20%20%20modelInvariantId%3A%20e6130d03-56f1-4b0a-9a1d-e1b2ebc30e0e%0A%20%20%20%20%20%20modelVersionId%3A%2094b18b1d-cc91-4f43-911a-e6348665f292%0A%20%20%20%20%20%20modelName%3A%20VfwclVfwsnkBbefb8ce2bde..base_vfw..module-0%0A%20%20%20%20%20%20modelVersion%3A%201%0A%20%20%20%20%20%20modelCustomizationId%3A%2047958575-138f-452a-8c8d-d89b595f8164%0A%20%20%20%20payload%3A%0A%20%20%20%20%20%20requestParameters%3A%20%27%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D%27%0A%20%20%20%20%20%20configurationParameters%3A%20%27%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D%27%0A%20%20%20%20retry%3A%200%0A%20%20%20%20timeout%3A%2030%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard%0A" - }, - "name": "vlb", - "version": "1.0.0" -} diff --git a/controlloop/common/rules-test/src/main/resources/vlb/vlb.onset.json b/controlloop/common/rules-test/src/main/resources/vlb/vlb.onset.json deleted file mode 100644 index 23ad03cbb..000000000 --- a/controlloop/common/rules-test/src/main/resources/vlb/vlb.onset.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "closedLoopAlarmStart": 1484677482204798, - "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", - "closedLoopEventStatus": "ONSET", - "requestID": "e4f95e0c-a013-4530-8e59-c5c5f9e539b6", - "target_type": "VNF", - "target": "vserver.vserver-name", - "AAI": { - "vserver.is-closed-loop-disabled": "false", - "vserver.prov-status": "ACTIVE", - "vserver.vserver-name": "OzVServer" - }, - "from": "DCAE", - "version": "1.0.2" -} diff --git a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java index 7274c6bda..ed3d62738 100644 --- a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java +++ b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseRuleTestTest.java @@ -300,6 +300,11 @@ public class BaseRuleTestTest { verify(topics).inject(eq(BaseRuleTest.APPC_LCM_WRITE_TOPIC), any(), any()); } + @Test + public void testTestVdnsSunnyDayLegacy() { + checkHttpPolicy(base::testVdnsSunnyDayLegacy); + } + @Test public void testTestVdnsSunnyDayCompliant() { checkHttpPolicy(base::testVdnsSunnyDayCompliant); @@ -330,16 +335,6 @@ public class BaseRuleTestTest { checkAppcLegacyPolicyFinalFailure("ModifyConfig", base::testVfwRainyDayCompliantTimeout); } - @Test - public void testTestVlbSunnyDayLegacy() { - checkHttpPolicy(base::testVlbSunnyDayLegacy); - } - - @Test - public void testTestVlbSunnyDayCompliant() { - checkHttpPolicy(base::testVlbSunnyDayCompliant); - } - protected void checkAppcLcmPolicy(String operation, Runnable test) { enqueueAppcLcm(operation); enqueueClMgt(ControlLoopNotificationType.OPERATION_SUCCESS); -- cgit 1.2.3-korg