From fbe4bb98345727d190cefcfb3ec54ad9075fba9d Mon Sep 17 00:00:00 2001 From: "RamaPrasad Amaranarayana (ra5425)" Date: Wed, 19 Sep 2018 17:40:40 -0400 Subject: Change Management Schedule Optimization Adding Robot Test Scripts for Change Management Schedule Optimization Change-Id: Id5edf9d3fb3c2390791362692c8b25f7607045c6 Issue-ID: OPTFRA-352 Signed-off-by: RamaPrasad Amaranarayana (ra5425) --- .../test_templates/change_management_ete.robot | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 cmso-robot/robot/resources/test_templates/change_management_ete.robot (limited to 'cmso-robot/robot/resources/test_templates/change_management_ete.robot') diff --git a/cmso-robot/robot/resources/test_templates/change_management_ete.robot b/cmso-robot/robot/resources/test_templates/change_management_ete.robot new file mode 100644 index 0000000..74dfdc2 --- /dev/null +++ b/cmso-robot/robot/resources/test_templates/change_management_ete.robot @@ -0,0 +1,84 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID +Library Collections +Library SSHLibrary + +Resource ../scheduler_common.robot +Resource ../json_templater.robot +Resource ../scheduler_requests/create_schedule.robot +Resource ../scheduler_requests/approval_requests.robot + +*** Variables **** +${TEMPLATES} robot/assets/templates + +*** Keywords *** +Change Management Template + [Arguments] ${request_file} ${workflow} ${minutesFromNow}=1 + ${template_folder}= Catenate ${TEMPLATES}/changemanagement + ${uuid}= Generate UUID + ${resp}= Create Schedule ${uuid} ${request_file} ${template_folder} workflow=${workflow} minutesFromNow=${minutesFromNow} + Should Be Equal as Strings ${resp.status_code} 202 + Validate Acknowledgment Response Headers ${resp} + Wait Until Keyword Succeeds 600s 30s Wait For Pending Approval ${uuid} + Send Tier2 Approval ${uuid} jf9860 Accepted + ${resp}= Get Change Management auth schedules/${uuid} + Wait Until Keyword Succeeds 120s 30s Wait For All VNFs Reach Status Completed ${uuid} + Wait Until Keyword Succeeds 120s 30s Wait for Schedule to Complete Completed ${uuid} + ${reps}= Delete Change Management auth schedules/${uuid} + +Change Management Immediate Template + [Arguments] ${request_file} ${workflow} + ${template_folder}= Catenate ${TEMPLATES}/changemanagement + ${uuid}= Generate UUID + ${resp}= Create Schedule ${uuid} ${request_file} ${template_folder} workflow=${workflow} + Should Be Equal as Strings ${resp.status_code} 202 + Validate Acknowledgment Response Headers ${resp} + Wait Until Keyword Succeeds 120s 30s Wait For All VNFs Reach Status Completed ${uuid} + Wait Until Keyword Succeeds 120s 30s Wait for Schedule to Complete Completed ${uuid} + ${reps}= Delete Change Management auth schedules/${uuid} + +Wait For All VNFs Reach Status + [Arguments] ${status} ${uuid} + ${resp}= Get Change Management auth schedules/scheduleDetails?request.scheduleId=${uuid} + : for ${vnf} in @{resp.json()} + \ Dictionary Should Contain Item ${vnf} status Completed + +Wait for Schedule to Complete + [Arguments] ${status} ${uuid} + ${resp}= Get Change Management auth schedules/${uuid} + Dictionary Should Contain Item ${resp.json()} status Completed + +Create and Approve + [Arguments] ${request_file} ${workflow} ${minutesFromNow}=5 + ${template_folder}= Catenate ${TEMPLATES}/changemanagement + ${uuid}= Generate UUID + ${resp}= Create Schedule ${uuid} ${request_file} ${template_folder} workflow=${workflow} minutesFromNow=${minutesFromNow} + Should Be Equal as Strings ${resp.status_code} 202 + Validate Acknowledgment Response Headers ${resp} + Wait Until Keyword Succeeds 300s 5s Wait For Pending Approval ${uuid} + Send Tier2 Approval ${uuid} jf9860 Accepted + +Change Management Cancel Template + [Arguments] ${request_file} ${workflow} ${minutesFromNow}=5 + ${template_folder}= Catenate ${TEMPLATES}/changemanagement + ${uuid}= Generate UUID + ${resp}= Create Schedule ${uuid} ${request_file} ${template_folder} workflow=${workflow} minutesFromNow=${minutesFromNow} + Should Be Equal as Strings ${resp.status_code} 202 + Validate Acknowledgment Response Headers ${resp} + Wait Until Keyword Succeeds 600s 5s Wait For Pending Approval ${uuid} + Send Tier2 Approval ${uuid} jf9860 Accepted + ${resp}= Delete Change Management auth schedules/${uuid} + Should Be Equal as Strings ${resp.status_code} 204 + Log ${resp.headers} + +Validate Acknowledgment Response Headers + [Arguments] ${Response} + Log ${Response.headers} + ${act_headers_keys} = Get Dictionary Keys ${Response.headers} + Dictionary Should Contain Key ${Response.headers} X-LatestVersion + Dictionary Should Contain Key ${Response.headers} X-MinorVersion + Dictionary Should Contain Key ${Response.headers} X-PatchVersion + \ No newline at end of file -- cgit 1.2.3-korg