aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/policy_interface.robot
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-04-29 16:20:21 -0500
committerBrian Freeman <bf1936@att.com>2019-04-29 16:20:31 -0500
commite14d257db3c028af381ca277e6559d01262524af (patch)
tree9e15ce744f14daedf2db440ab3a3f8d5784efaea /robot/resources/policy_interface.robot
parent4ecc3a7ddb44cb3b64b140f9cf0ab27af3a96aef (diff)
Update for Dublin Policy API
Add newline for downloaded CSAR Log in sdc interface Add templates and Keywords for new Policy API for testing Issue-ID: POLICY-1685 Change-Id: Ib85d3be4004dda04ae6c8d95d48763222547528e Signed-off-by: Brian Freeman <bf1936@att.com>
Diffstat (limited to 'robot/resources/policy_interface.robot')
-rw-r--r--robot/resources/policy_interface.robot33
1 files changed, 33 insertions, 0 deletions
diff --git a/robot/resources/policy_interface.robot b/robot/resources/policy_interface.robot
index 6f48e4fc..8bbbb62a 100644
--- a/robot/resources/policy_interface.robot
+++ b/robot/resources/policy_interface.robot
@@ -52,6 +52,16 @@ Run Policy Put Request
${resp}= Put Request policy ${data_path} data=${data} headers=${headers}
Log Received response from policy ${resp.text}
[Return] ${resp}
+
+Run Policy Post Request
+ [Documentation] Runs Policy Post request
+ [Arguments] ${data_path} ${data}
+ Log Creating session ${POLICY_ENDPOINT}
+ ${session}= Create Session policy ${POLICY_ENDPOINT}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
+ ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
+ Log Received response from policy ${resp.text}
+ [Return] ${resp}
Run Policy Delete Request
[Documentation] Runs Policy Delete request
@@ -129,3 +139,26 @@ Validate the vFWCL Policy
Should Be Equal As Strings ${resp.status_code} 200
${resp}= Run Drools Get Request /policy/pdp/engine/controllers/amsterdam/drools/facts/closedloop-amsterdam/org.onap.policy.controlloop.Params
Should Be Equal As Strings ${resp.status_code} 200
+
+
+Create vFirewall Monitoring Policy
+ ${dict}= Create Dictionary
+ ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_monitoring_input_tosca.template ${dict}
+ ${resp}= Run Policy Post Request /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies ${data}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+
+Create vFirewall Operational Policy
+ [Arguments] ${resource_id}
+ ${dict}= Create Dictionary RESOURCE_ID=${resource_id}
+ ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_policy_operational_input.template ${dict}
+ ${resp}= Run Policy Post Request /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies ${data}
+ Should Be Equal As Strings ${resp.status_code} 200
+
+
+Push vFirewall Policies To PDP Group
+ ${dict}= Create Dictionary
+ ${data}= Fill JSON Template File ${POLICY_TEMPLATES}/vFirewall_push.template ${dict}
+ ${resp}= Run Policy Post Request /policy/pap/v1/pdps/policies ${data}
+ Should Be Equal As Strings ${resp.status_code} 200
+