diff options
author | 2018-09-19 17:40:40 -0400 | |
---|---|---|
committer | 2018-09-19 17:40:40 -0400 | |
commit | fbe4bb98345727d190cefcfb3ec54ad9075fba9d (patch) | |
tree | f2e0c091a4c132c89dafb061c81eeebfb0e9a773 /cmso-robot/robot/resources/misc.robot | |
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/resources/misc.robot')
-rw-r--r-- | cmso-robot/robot/resources/misc.robot | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/cmso-robot/robot/resources/misc.robot b/cmso-robot/robot/resources/misc.robot new file mode 100644 index 0000000..8409601 --- /dev/null +++ b/cmso-robot/robot/resources/misc.robot @@ -0,0 +1,42 @@ +*** Settings *** +Library Collections +Library String +Library UUID +Library Process +Library HttpLibrary.HTTP +Documentation Miscellaneous keywords + +Resource json_templater.robot +Resource scheduler_requests/create_schedule.robot + + +*** Variables *** + +*** Keywords *** + +Validate Status + [Documentation] Fail unless the Request response is in the passed list of valid HTTP status codes. + [Arguments] ${resp} ${valid_status_list} + ${status_code} Convert To String ${resp.status_code} + Return From Keyword If '${resp.status_code}' in ${valid_status_list} + Fail ${resp.status_code} + +Validate JSON Error + [Documentation] Fails if messageIds do not match. expected_errors should be a list but a string would likely work as well + [Arguments] ${resp_json} ${expected_errors} + ${result}= Get From Dictionary ${resp_json['requestError']} messageId + Should Contain ${expected_errors} ${result} #checks expected_errors list for the actual error received from schedule + +Check ATTIDs Template + [Documentation] This just checks a list of uuids + [Arguments] ${expected_status_code} ${template_folder} + ${request_file}= Convert to String OneVnfImmediateATTID.json.template + ${attid_file}= OperatingSystem.Get File robot/assets/AOTS_CM_IDs.txt + @{attids}= Split to lines ${attid_file} + :for ${attid} in @{attids} + \ ${uuid}= Generate UUID + \ ${resp}= Run Keyword and Continue on Failure Create Schedule ${uuid} ${request_file} ${template_folder} attid=${attid} + \ Run Keyword and Continue on Failure Should Be Equal as Strings ${resp.status_code} ${expected_status_code} + \ ${reps}= Delete Change Management auth schedules/${uuid} + +
\ No newline at end of file |