diff options
author | Brian Freeman <bf1936@att.com> | 2019-04-29 16:20:21 -0500 |
---|---|---|
committer | Brian Freeman <bf1936@att.com> | 2019-04-29 16:20:31 -0500 |
commit | e14d257db3c028af381ca277e6559d01262524af (patch) | |
tree | 9e15ce744f14daedf2db440ab3a3f8d5784efaea /robot/resources | |
parent | 4ecc3a7ddb44cb3b64b140f9cf0ab27af3a96aef (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')
-rw-r--r-- | robot/resources/asdc_interface.robot | 2 | ||||
-rw-r--r-- | robot/resources/policy_interface.robot | 33 |
2 files changed, 34 insertions, 1 deletions
diff --git a/robot/resources/asdc_interface.robot b/robot/resources/asdc_interface.robot index cbaba4ac..1160c316 100644 --- a/robot/resources/asdc_interface.robot +++ b/robot/resources/asdc_interface.robot @@ -260,7 +260,7 @@ Download CSAR ${base64Obj}= Set Variable ${resp.json()['base64Contents']} ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64 Create Binary File ${save_directory}/${csar_file_name} ${binObj} - Log To Console Downloaded:${csar_file_name} + Log To Console ${\n}Downloaded:${csar_file_name} [Return] 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 + |