From 1f1903bb4aaac2fc9799c7adaa4c61333bb019f8 Mon Sep 17 00:00:00 2001 From: jhh Date: Fri, 4 Nov 2022 11:53:50 -0500 Subject: Support A1 PMS Actor for SON use case Issue-ID: POLICY-4444 Signed-off-by: jhh Change-Id: I1811b79513616aab813b6d97823d6c1d2bbbee47 Signed-off-by: jhh (cherry picked from commit 4b5cbc8b1bc57316dd1cad554fad98235d361053) --- .../controlloop/common/rules/test/BaseTest.java | 24 ++++++++++++++-------- .../resources/vsonh/v5G.son.A1.sdnr.success.json | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'controlloop/common/rules-test') diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java index 2b81fda7d..d2fe57f8f 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java @@ -72,6 +72,8 @@ public abstract class BaseTest { protected static final String APPC_CL_TOPIC = "APPC-CL"; protected static final String SDNR_CL_TOPIC = "SDNR-CL"; protected static final String SDNR_CL_RSP_TOPIC = "SDNR-CL-RSP"; + protected static final String A1P_CL_TOPIC = "A1-P"; + protected static final String A1P_CL_RSP_TOPIC = "A1-P-RSP"; /* * Constants for each test case. @@ -129,7 +131,7 @@ public abstract class BaseTest { private static final String V5G_SON_A1_TOSCA_POLICY = "policies/v5gSonA1.policy.operational.input.tosca.json"; private static final String V5G_SON_A1_ONSET = "vsonh/v5G.son.A1.onset.json"; private static final String V5G_SON_A1_SDNR_SUCCESS = "vsonh/v5G.son.A1.sdnr.success.json"; - private static final String MODIFY_A1_POLICY_OPERATION = "ModifyA1Policy"; + private static final String PUT_A1_POLICY_OPERATION = "PutA1Policy"; /* * Coders used to decode requests and responses. */ @@ -367,7 +369,8 @@ public abstract class BaseTest { */ @Test public void testVpciSunnyDayCompliant() { - sdnrSunnyDay(VPCI_TOSCA_COMPLIANT_POLICY, VPCI_ONSET, VPCI_SDNR_SUCCESS, SDNR_MODIFY_CONFIG_OP); + sdnrSunnyDay(VPCI_TOSCA_COMPLIANT_POLICY, VPCI_ONSET, VPCI_SDNR_SUCCESS, + SDNR_MODIFY_CONFIG_OP, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC); } // VSONH @@ -377,7 +380,8 @@ public abstract class BaseTest { */ @Test public void testVsonhSunnyDayCompliant() { - sdnrSunnyDay(VSONH_TOSCA_COMPLIANT_POLICY, VSONH_ONSET, VSONH_SDNR_SUCCESS, SNDR_MODIFY_CONFIG_ANR_OP); + sdnrSunnyDay(VSONH_TOSCA_COMPLIANT_POLICY, VSONH_ONSET, VSONH_SDNR_SUCCESS, + SNDR_MODIFY_CONFIG_ANR_OP, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC); } /** @@ -385,7 +389,8 @@ public abstract class BaseTest { */ @Test public void test5gSonO1SunnyDayCompliant() { - sdnrSunnyDay(V5G_SON_O1_TOSCA_POLICY, V5G_SON_O1_ONSET, V5G_SON_O1_SDNR_SUCCESS, MODIFY_O1_CONFIG_OPERATION); + sdnrSunnyDay(V5G_SON_O1_TOSCA_POLICY, V5G_SON_O1_ONSET, V5G_SON_O1_SDNR_SUCCESS, + MODIFY_O1_CONFIG_OPERATION, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC); } /** @@ -393,7 +398,8 @@ public abstract class BaseTest { */ @Test public void test5gSonA1SunnyDayCompliant() { - sdnrSunnyDay(V5G_SON_A1_TOSCA_POLICY, V5G_SON_A1_ONSET, V5G_SON_A1_SDNR_SUCCESS, MODIFY_A1_POLICY_OPERATION); + sdnrSunnyDay(V5G_SON_A1_TOSCA_POLICY, V5G_SON_A1_ONSET, V5G_SON_A1_SDNR_SUCCESS, + PUT_A1_POLICY_OPERATION, A1P_CL_TOPIC, A1P_CL_RSP_TOPIC); } /** @@ -572,9 +578,11 @@ public abstract class BaseTest { * @param onsetFile file containing the ONSET to be injected * @param operation expected SDNR operation request */ - protected void sdnrSunnyDay(String policyFile, String onsetFile, String successFile, String operation) { + protected void sdnrSunnyDay(String policyFile, String onsetFile, + String successFile, String operation, + String requestTopic, String responseTopic) { policyClMgt = createNoficationTopicListener(); - sdnrClSink = topics.createListener(SDNR_CL_TOPIC, PciMessage.class, SDNR_CODER); + sdnrClSink = topics.createListener(requestTopic, PciMessage.class, SDNR_CODER); policy = checkPolicy(policyFile); @@ -592,7 +600,7 @@ public abstract class BaseTest { /* * Inject response. */ - topics.inject(SDNR_CL_RSP_TOPIC, successFile, pcireq.getBody().getInput().getCommonHeader().getSubRequestId()); + topics.inject(responseTopic, successFile, pcireq.getBody().getInput().getCommonHeader().getSubRequestId()); /* --- Operation Completed --- */ diff --git a/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json b/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json index 12cfbc626..186241f5a 100644 --- a/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json +++ b/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json @@ -17,7 +17,7 @@ } }, "version": "1.0", - "rpc-name": "ModifyA1Policy", + "rpc-name": "puta1policy", "correlation-id": "82feb01e-4f3e-40e2-b8df-683adabae893", "type": "response" } -- cgit 1.2.3-korg