diff options
author | RamaPrasad Amaranarayana (ra5425) <ra5425@att.com> | 2018-09-19 17:40:40 -0400 |
---|---|---|
committer | RamaPrasad Amaranarayana (ra5425) <ra5425@att.com> | 2018-09-19 17:40:40 -0400 |
commit | fbe4bb98345727d190cefcfb3ec54ad9075fba9d (patch) | |
tree | f2e0c091a4c132c89dafb061c81eeebfb0e9a773 /cmso-robot/robot/testsuites | |
parent | b031d50f82f8ca5b7fd0609a92c719f43a9f518d (diff) |
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) <ra5425@att.com>
Diffstat (limited to 'cmso-robot/robot/testsuites')
11 files changed, 412 insertions, 0 deletions
diff --git a/cmso-robot/robot/testsuites/ChangeManagementCancel.robot b/cmso-robot/robot/testsuites/ChangeManagementCancel.robot new file mode 100644 index 0000000..ad193f6 --- /dev/null +++ b/cmso-robot/robot/testsuites/ChangeManagementCancel.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/change_management_ete.robot + +# Test Setup +Test Template Change Management Cancel Template +# Test Teardown + +*** Test Cases *** +One VNF One Change Window OneVnfOneChangeWindow.json.template Replace minutesFromNow=20 + [Tags] ete future + +Multiple VNFs One Change Window OneGroupMultipleVNFsOneChangeWindow.json.template Replace minutesFromNow=20 + [Tags] ete future + +Multiple VNFs Two Change Windows OneGroupMultipleVNSsTwoChangeWindows.json.template Replace minutesFromNow=20 + [Tags] ete future + +One VNF One Change Window Update OneVnfOneChangeWindow.json.template Update minutesFromNow=20 + [Tags] ete future diff --git a/cmso-robot/robot/testsuites/ChangeManagementDBFailover.robot b/cmso-robot/robot/testsuites/ChangeManagementDBFailover.robot new file mode 100644 index 0000000..a951145 --- /dev/null +++ b/cmso-robot/robot/testsuites/ChangeManagementDBFailover.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/change_management.robot + +# Test Setup +Test Template Change Management DB Failover Template +# Test Teardown +*** Variable*** +${status_code_variable}= 202 +${template_folder}= robot/assets/templates/changemanagement +*** Test Cases *** +Step 2 OneVnfOneChangeWindowReplaceVNFInfra.json.template ${template_folder} e2e006 None + +Step 5 OneVnfOneChangeWindowReplaceVNFInfra.json.template ${template_folder} e2e002 e2e001 + +Step 9 OneVnfOneChangeWindowReplaceVNFInfra.json.template ${template_folder} e2e003 e2e002 + +Step 13 OneVnfOneChangeWindowReplaceVNFInfra.json.template ${template_folder} e2e004 e2e003 + + + diff --git a/cmso-robot/robot/testsuites/ChangeManagementFailure.robot b/cmso-robot/robot/testsuites/ChangeManagementFailure.robot new file mode 100644 index 0000000..5e74105 --- /dev/null +++ b/cmso-robot/robot/testsuites/ChangeManagementFailure.robot @@ -0,0 +1,57 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID +Library OperatingSystem +Resource ../resources/test_templates/change_management.robot + +# Test Setup +Test Template Change Management Failure Template +# Test Teardown +*** Variable *** +${status_code_variable}= 400 +${template_folder}= robot/assets/templates/FailureCasesChangeManagement +*** Test Cases *** +# This for loop will generate a test for each file. It has been replaced by GenerateRobot.py which generates something similar to the below cases +# This was done because all tests run by the for loop counted as a single test and could not be tagged individually +#@{Global_cm...} may show as an error but it still seems to work I guess +#One VNF One Change Window ete failure +# :FOR ${current_template_file} IN @{GLOBAL_CM_ete failure_TEMPLATES} +# \ ${current_template_file} ${status_code_variable} ${template_folder} + +One Vnf One Change Window Empty Domain OneVnfOneChangeWindowEmptyDomain.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window + +One Vnf One Change Window Empty Schedule ID OneVnfOneChangeWindowEmptyScheduleID.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window + +## Schedule name is now optional +One Vnf One Change Window Empty Schedule Name OneVnfOneChangeWindowEmptyScheduleName.json.template 202 ${template_folder} + [Tags] ete failure future single VNF single window + +One Vnf One Change Window Empty User ID OneVnfOneChangeWindowEmptyUserID.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window + +## Policies are validated by SNIRO +One Vnf One Change Window Incorrect Policy Id OneVnfOneChangeWindowIncorrectPolicyId.json.template 202 ${template_folder} + [Tags] ete failure future single VNF single window + +## 1806 allow for unknown workflows +One Vnf One Change Window Incorrect Workflow OneVnfOneChangeWindowIncorrectWorkflow.json.template 202 ${template_folder} + [Tags] ete failure future single VNF single window + +One Vnf One Change Window Negative Normal Duration In Seconds OneVnfOneChangeWindowNegativeNormalDurationInSeconds.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window + +One Vnf One Change Window No End Time OneVnfOneChangeWindowNoEndTime.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window + +One Vnf One Change Window No Node Name OneVnfOneChangeWindowNoNodeName.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window + +One Vnf One Change Window No Start Time OneVnfOneChangeWindowNoStartTime.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window + +One Vnf One Change Window Switched Time OneVnfOneChangeWindowSwitchedTime.json.template ${status_code_variable} ${template_folder} + [Tags] ete failure future single VNF single window diff --git a/cmso-robot/robot/testsuites/ChangeManagementFuture.robot b/cmso-robot/robot/testsuites/ChangeManagementFuture.robot new file mode 100644 index 0000000..5dad749 --- /dev/null +++ b/cmso-robot/robot/testsuites/ChangeManagementFuture.robot @@ -0,0 +1,24 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/change_management_ete.robot + +# Test Setup +Test Template Change Management Template +# Test Teardown + +*** Test Cases *** +One VNF One Change Window OneVnfOneChangeWindow.json.template Replace + [Tags] ete future + +Multiple VNFs One Change Window OneGroupMultipleVNFsOneChangeWindow.json.template Replace + [Tags] ete future + +Multiple VNFs Two Change Windows OneGroupMultipleVNSsTwoChangeWindows.json.template Replace + [Tags] ete future + +One VNF One Change Window Update OneVnfOneChangeWindow.json.template Update + [Tags] ete future diff --git a/cmso-robot/robot/testsuites/ChangeManagementImmediate.robot b/cmso-robot/robot/testsuites/ChangeManagementImmediate.robot new file mode 100644 index 0000000..f7e399a --- /dev/null +++ b/cmso-robot/robot/testsuites/ChangeManagementImmediate.robot @@ -0,0 +1,27 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/change_management_ete.robot + +# Test Setup +Test Template Change Management Immediate Template +# Test Teardown + +*** Test Cases *** +One Vnf Immediate Replace OneVnfImmediate.json.template Replace + [Tags] ete immediate + +One Vnf Immediate Update Config OneVnfImmediate.json.template VNF Config Update + [Tags] ete immediate + +One Vnf Immediate Update In Place OneVnfImmediate.json.template VNF Update Software In Place + [Tags] ete immediate + +One Vnf Immediate Update OneVnfImmediate.json.template Update + [Tags] ete immediate + +Multiple Vnf Immediate MultipleVnfImmediate.json.template Replace + [Tags] ete immediate diff --git a/cmso-robot/robot/testsuites/ChangeManagementImmediateFailure.robot b/cmso-robot/robot/testsuites/ChangeManagementImmediateFailure.robot new file mode 100644 index 0000000..74f1959 --- /dev/null +++ b/cmso-robot/robot/testsuites/ChangeManagementImmediateFailure.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID +Library OperatingSystem +Resource ../resources/test_templates/change_management.robot + +# Test Setup +Test Template Change Management Failure Template +# Test Teardown +*** Variable *** +${status_code_variable}= 400 +${one_vnf_template_folder}= robot/assets/templates/OneVNFImmediateFailureCases +${multiple_vnf_template_folder}= robot/assets/templates/MutipleVNFImmediateFailureCases +*** Test Cases *** +#@{Global_cm...} may show as an error but it still seems to work I guess +#One VNF Immediate Failure +# :FOR ${current_template_file} IN @{GLOBAL_CM_ONEVNF_FAILURE_TEMPLATES} +# \ ${current_template_file} ${status_code_variable} ${one_vnf_template_folder} + +#Multiple VNF Immediate Failure +# :FOR ${current_template_file} IN @{GLOBAL_CM_MULTIPLE_VNF_FAILURE_TEMPLATES} +# \ ${current_template_file} ${status_code_variable} ${multiple_vnf_template_folder} + +One Vnf Immediate Empty Domain OneVnfImmediateEmptyDomain.json.template ${status_code_variable} ${one_vnf_template_folder} + [Tags] ete failure immediate single VNF + +One Vnf Immediate Empty Schedule Id OneVnfImmediateEmptyScheduleId.json.template ${status_code_variable} ${one_vnf_template_folder} + [Tags] ete failure immediate single VNF + +## schedule name is now optional +One Vnf Immediate Empty Schedule Name OneVnfImmediateEmptyScheduleName.json.template 202 ${one_vnf_template_folder} + [Tags] ete failure immediate single VNF + +One Vnf Immediate Empty Scheduling Info OneVnfImmediateEmptySchedulingInfo.json.template ${status_code_variable} ${one_vnf_template_folder} + [Tags] ete failure immediate single VNF + +One Vnf Immediate Empty User Id OneVnfImmediateEmptyUserId.json.template ${status_code_variable} ${one_vnf_template_folder} + [Tags] ete failure immediate single VNF + +Multiple Vnf Immediate Empty Domain MultipleVnfImmediateEmptyDomain.json.template ${status_code_variable} ${multiple_vnf_template_folder} + [Tags] ete failure immediate multiple VNF + +Multiple Vnf Immediate Empty Schedule Id MultipleVnfImmediateEmptyScheduleId.json.template ${status_code_variable} ${multiple_vnf_template_folder} + [Tags] ete failure immediate multiple VNF + +Multiple Vnf Immediate Empty Additional Duration MultipleVnfImmediateEmptyAdditionalDuration.json.template ${status_code_variable} ${multiple_vnf_template_folder} + [Tags] ete failure immediate multiple VNF + +Multiple Vnf Immediate Empty User Id MultipleVnfImmediateEmptyUserId.json.template ${status_code_variable} ${multiple_vnf_template_folder} + [Tags] ete failure immediate multiple VNF
\ No newline at end of file diff --git a/cmso-robot/robot/testsuites/ChangeManagementRejection.robot b/cmso-robot/robot/testsuites/ChangeManagementRejection.robot new file mode 100644 index 0000000..ea63ac8 --- /dev/null +++ b/cmso-robot/robot/testsuites/ChangeManagementRejection.robot @@ -0,0 +1,18 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/change_management.robot + +# Test Setup +Test Template Change Management Rejection Template +# Test Teardown +*** Variable*** +${status_code_variable}= 202 +${template_folder}= robot/assets/templates/changemanagement +*** Test Cases *** +Change Management Rejection OneVnfOneChangeWindowReplaceVNFInfra.json.template ${template_folder} + [Tags] ete rejection + diff --git a/cmso-robot/robot/testsuites/CheckLog.robot b/cmso-robot/robot/testsuites/CheckLog.robot new file mode 100644 index 0000000..13d7b1c --- /dev/null +++ b/cmso-robot/robot/testsuites/CheckLog.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/check_logs.robot + +# Test Setup +# Test Teardown +*** Variable*** +${user_name}= cr057g +${password}= cr057g +${template_folder}= robot/assets/templates/changemanagement +${fail_template_folder}= robot/assets/templates/FailureCasesChangeManagement +*** Test Cases *** + +Check Audit Logs + Check Audit Logs ${user_name} ${password} OneVnfImmediateReplaceVNFInfra.json.template ${template_folder} + +Check Debug Logs + Check Debug Logs ${user_name} ${password} OneVnfImmediateReplaceVNFInfra.json.template ${template_folder} + +Check Metric Logs + Check Metric Logs ${user_name} ${password} OneVnfImmediateReplaceVNFInfra.json.template ${template_folder} + +Check Error Logs + Check Error Logs ${user_name} ${password} OneVnfOneChangeWindowEmptyScheduleID.json.template ${fail_template_folder} + [Tags] + + + + + + + + + + diff --git a/cmso-robot/robot/testsuites/CheckScheduleStatus.robot b/cmso-robot/robot/testsuites/CheckScheduleStatus.robot new file mode 100644 index 0000000..2f96ecb --- /dev/null +++ b/cmso-robot/robot/testsuites/CheckScheduleStatus.robot @@ -0,0 +1,18 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/change_management.robot + +# Test Setup +# Test Teardown +*** Variable*** +${template_folder}= robot/assets/templates/changemanagement +*** Test Cases *** +Change Management Status Immediate + Record Status Immediate Template OneVnfImmediateReplaceVNFInfra.json.template ${template_folder} + +Change Management Status + Record Status Template OneVnfOneChangeWindowReplaceVNFInfra.json.template ${template_folder}
\ No newline at end of file diff --git a/cmso-robot/robot/testsuites/MiscTests.robot b/cmso-robot/robot/testsuites/MiscTests.robot new file mode 100644 index 0000000..6873e3f --- /dev/null +++ b/cmso-robot/robot/testsuites/MiscTests.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library StringTemplater +Library UUID + +Resource ../resources/test_templates/change_management.robot +Resource ../resources/test_templates/check_logs.robot + +# Test Setup +# Test Teardown +*** Variable*** +${user_name}= +${password}= +${uuid_list_file}= robot/assets/get_schedule_UUIDs.txt +${template_folder}= robot/assets/templates/changemanagement +*** Test Cases *** +Get Schedule + Get Schedule Test Template ${uuid_list_file} + +Post Existing Immediate Schedule + Change Management Already Exists Immediate Template OneVnfImmediateReplaceVNFInfra.json.template ${template_folder} + diff --git a/cmso-robot/robot/testsuites/VtmAccess.robot b/cmso-robot/robot/testsuites/VtmAccess.robot new file mode 100644 index 0000000..4a9c0aa --- /dev/null +++ b/cmso-robot/robot/testsuites/VtmAccess.robot @@ -0,0 +1,105 @@ +*** Settings *** +Documentation Creates VID VNF Instance + +Library String +Library OperatingSystem +Library StringTemplater +Library Collections +Library XML + +Resource ../resources/scheduler_common.robot +Resource ../resources/vtm_common.robot +*** Variables **** +${AOTS_USER} ${GLOBAL_VID_USERID} +${ASSETSSTRING} dummy-id + +*** Test Cases *** +Test1 + ${display} Create List actualStartDate actualEndDate dateModified assetId + ${assets}= Create List dummy + ${status}= Create List New Assigned Planning Scheduled Pending WorkInProgress Resolved + ${filter}= Create Dictionary plannedStartDateFrom=1505389844 assetId=${assets} + vTM Query Template vtm display=${display} filter=${filter} + +Delete Tickets + ${tickets} Create List dummy-id + :for ${ticket} in @{tickets} + \ vTM Close Ticket vtm ${ticket} ${GLOBAL_VID_USERID} + +Delete Old Tickets Atomic + @{assets}= Split String ${ASSETS} separator=, + ${end_time}= Get Current Date UTC - 1440 minutes result_format=timestamp exclude_millis=False + ${end_time}= Convert Date ${end_time} epoch + ${end_time}= Evaluate int(${end_time}) + ${display} Create List actualStartDate actualEndDate dateModified assetId + ${status}= Create List New Assigned Planning Scheduled Pending WorkInProgress Resolved + ${filter}= Create Dictionary plannedStartDateFrom=0 plannedEndDateTo=${end_time} assetId=@{assets} status=${status} + ${resp}= vTM Query Template vtm display=${display} filter=${filter} + Log ${resp.json()} + ${list}= Get From Dictionary ${resp.json()} changeInfo + ${changeIds}= Create Dictionary + :for ${ticket} in @{list} + \ ${changeId}= Get From Dictionary ${ticket} changeId + \ Set To Dictionary ${changeIds} ${changeId}=1 + # Weed out dupes if any + ${idlist} Get Dictionary Keys ${changeIds} + :for ${changeId} in @{idlist} + \ vTM Close Ticket vtm ${changeId} ${AOTS_USER} + +Delete Old Scheduler Tickets + :for ${env} in @{DELETE_TICKET_ENVS} + \ Set Global Variable ${GLOBAL_SCHEDULER_HOST} ${env['scheduler']} + \ Set Global Variable ${GLOBAL_VTM_HOST} ${env['vtm']} + \ Delete Scheduler Tickets For ENV + + +Cancel Tickets + ${tickets} Create List dummy-id + :for ${ticket} in @{tickets} + \ vTM Cancel Ticket vtm ${ticket} + + +Delete Schedule + ${uuid}= Catenate dummy-id + ${resp}= Delete Change Management auth schedules/${uuid} + + +*** Keywords *** +Delete Scheduler Tickets For ENV + # Make sure that the Scheduler in the config and the vTM system are the same. + # We will match the tickets to be deleted to the tickets in the scheduler DB + # to ensure we don't clobber other folks test data! + ${scheduler_tickets}= Get Scheduler Tickets + # ELiminate dupes + @{assets} Get Dictionary Values ${scheduler_tickets} + @{assets}= Remove Duplicates ${assets} + ${end_time}= Get Current Date UTC - 1440 minutes result_format=timestamp exclude_millis=False + ${end_time}= Convert Date ${end_time} epoch + ${end_time}= Evaluate int(${end_time}) + ${display} Create List actualStartDate actualEndDate dateModified assetId requesterId + ${status}= Create List New Assigned Planning Scheduled Pending WorkInProgress Resolved + ${filter}= Create Dictionary plannedStartDateFrom=0 plannedEndDateTo=${end_time} assetId=@{assets} status=${status} + ${resp}= vTM Query Template vtm display=${display} filter=${filter} + Log ${resp.json()} + ${list}= Get From Dictionary ${resp.json()} changeInfo + + ## Get list of tickets that are both in our DB and in AOTS + ${changeIds}= Create Dictionary + :for ${ticket} in @{list} + \ ${changeId}= Get From Dictionary ${ticket} changeId + \ ${status} ${value}= Run Keyword and Ignore Error Get From Dictionary ${scheduler_tickets} ${changeId} + \ Run Keyword If '${status}'=='PASS' Set To Dictionary ${changeIds} ${changeId}=1 + # Weed out dupes if any and only cance ones in our DB! + ${idlist} Get Dictionary Keys ${changeIds} + :for ${changeId} in @{idlist} + \ vTM Cancel Ticket vtm ${changeId} + +Get Scheduler Tickets + ${resp}= Get Change Management auth schedules/scheduleDetails + ${dict}= Create Dictionary + Log ${resp.json()} + :for ${details} in @{resp.json()} + \ ${status} ${value}= Run Keyword and Ignore Error Get From Dictionary ${details} aotsChangeId + \ ${assetId}= Get From Dictionary ${details} vnfName + \ Run Keyword If '${status}'=='PASS' Set To Dictionary ${dict} ${value}=${assetId} + [Return] ${dict} |