diff options
author | Brian Freeman <bf1936@att.com> | 2020-12-08 09:14:37 -0500 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2020-12-09 12:52:23 +0000 |
commit | 9e783f3febc31ba69676a2220db397c6146ed128 (patch) | |
tree | 9dc76e88abdd924ecfee37c64ec29ca7a6656464 /robot/resources | |
parent | 488ea3963d0efa395b096aa0828ff0bb13e6dc98 (diff) |
Fixes for tcagen2 and repush vFWCL policies
Issue-ID: INT-1803
Change-Id: Ica53cee26bd19b663bb49ecfc4750fe3cfe32e8c
Signed-off-by: Brian Freeman <bf1936@att.com>
(cherry picked from commit 64c82051fae901cfd7f0cbd42061bbe38a18c3f4)
Diffstat (limited to 'robot/resources')
-rw-r--r-- | robot/resources/demo_preload.robot | 3 | ||||
-rw-r--r-- | robot/resources/policy_interface.robot | 50 |
2 files changed, 50 insertions, 3 deletions
diff --git a/robot/resources/demo_preload.robot b/robot/resources/demo_preload.robot index 8a18b4e7..3083cc44 100644 --- a/robot/resources/demo_preload.robot +++ b/robot/resources/demo_preload.robot @@ -241,10 +241,9 @@ Instantiate Demo VNF \ ${generic_vnf}= Get From Dictionary ${generic_vnfs} ${vf_module} \ ${model_invariant_id}= Set Variable If '${vf_module_label}' in '${vf_module}' ${generic_vnf['model-invariant-id']} ${model_invariant_id} Log ModelInvariantID=${model_invariant_id} - ${status} ${value}= Run Keyword And Ignore Error Update vVFWCL Policy ${model_invariant_id} + ${status} ${value}= Run Keyword And Ignore Error Update vFWCL Operational and Monitoring Policies ${model_invariant_id} ${status} ${value}= Run Keyword And Ignore Error APPC Mount Point ${vf_module_name} - Save For Delete [Documentation] Create a variable file to be loaded for save for delete [Arguments] ${tenant_id} ${tenant_name} ${vvg_server_id} ${customer_name} ${service_instance_id} ${stack_name} ${catalog_service_id} ${catalog_resource_ids} diff --git a/robot/resources/policy_interface.robot b/robot/resources/policy_interface.robot index 21d61b61..b8ecf45f 100644 --- a/robot/resources/policy_interface.robot +++ b/robot/resources/policy_interface.robot @@ -47,6 +47,17 @@ Run Policy Pap Get Request Log Received response from Policy Pap ${resp.text} [Return] ${resp} +Run Policy Api Get Request + [Documentation] Runs Policy Api Get request + [Arguments] ${data_path} + ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} + ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} + Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request policy ${data_path} headers=${headers} + Log Received response from policy API ${resp.text} + [Return] ${resp} + Run Policy Api Post Request [Documentation] Runs Policy Api Post request [Arguments] ${data_path} ${data} @@ -96,7 +107,10 @@ Update vVFWCL Policy Validate the vFWCL Policy ${resp}= Run Policy Pap Get Request /policy/pap/v1/pdps - Log Received response from policy ${resp.text} + Log Received response from policy PAP ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= Run Policy Api Get Request /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2 + Log Received response from policy API policytypes ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 Create vFirewall Monitoring Policy @@ -117,6 +131,17 @@ Create vFirewall Operational Policy Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['version']} +Update vFWCL Operational and Monitoring Policies + [Documentation] Undeploy, Delete and Create Operational and Monitoring policies for vFWCL + [Arguments] ${model_invariant_id} + Run Keyword And Ignore Error Run Undeploy vFW Monitoring Policy + Run Keyword And Ignore Error Run Undeploy vFW Operational Policy + # Need to wait a little for undeploy + Validate the vFWCL Policy + Run Keyword and Ignore Error Run Delete vFW Monitoring Policy + Run Keyword And Ignore Error Run Delete vFW Operational Policy + Update vVFWCL Policy ${model_invariant_id} + Push vFirewall Policies To PDP Group [Arguments] ${op_policy_version} ${dict}= Create Dictionary OP_POLICY_VERSION=${op_policy_version} @@ -174,6 +199,29 @@ Run Undeploy Policy Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 +Run Undeploy vFW Monitoring Policy + [Documentation] Runs Policy PAP Undeploy vFW Monitoring Policy from PDP Groups + #[Arguments] ${policy_name} + ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} + ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} + Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.vfirewall.tca headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + + +Run Delete vFW Monitoring Policy + [Documentation] Runs Policy API Undeploy a Monitoring Policy + #[Arguments] ${policy_name} + ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD} + ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth} + Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.vfirewall.tca/versions/1.0.0 headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + Run Delete Policy Request [Documentation] Runs Policy Delete request |