| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 1 | *** Settings *** | 
|  | 2 | Documentation   DMTF tools utility keywords. | 
|  | 3 |  | 
|  | 4 | Resource        resource.robot | 
|  | 5 | Library         gen_cmd.py | 
|  | 6 |  | 
|  | 7 | *** Variables *** | 
|  | 8 |  | 
|  | 9 | # ignore_err controls Shell Cmd behavior. | 
|  | 10 | ${ignore_err}     ${0} | 
|  | 11 |  | 
|  | 12 | *** Keywords *** | 
|  | 13 |  | 
|  | 14 | Download DMTF Tool | 
|  | 15 | [Documentation]  Git clone tool. | 
| ganesanb | bca06d0 | 2023-04-15 10:52:51 +0000 | [diff] [blame] | 16 | [Arguments]      ${rsv_dir_path}  ${rsv_github_url}  ${branch_name} | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 17 |  | 
|  | 18 | # Description of arguments: | 
|  | 19 | # rsv_dir_path    Directory path for rsv tool (e.g. "Redfish-Service-Validator"). | 
|  | 20 | # rsv_github_url  Github URL link(e.g "https://github.com/DMTF/Redfish-Service-Validator"). | 
| Sridevi Ramesh | 8924229 | 2025-07-20 02:36:56 -0500 | [diff] [blame] | 21 | # branch_name     Name of the branch. | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 22 |  | 
| George Keishing | 2d0804e | 2019-12-12 22:27:05 -0600 | [diff] [blame] | 23 | ${cmd_buf}  Catenate  rm -rf ${rsv_dir_path} ; | 
| ganesanb | bca06d0 | 2023-04-15 10:52:51 +0000 | [diff] [blame] | 24 | ...  git clone --branch ${branch_name} ${rsv_github_url} ${rsv_dir_path} | 
| George Keishing | 2d0804e | 2019-12-12 22:27:05 -0600 | [diff] [blame] | 25 | ${rc}  ${output}=  Shell Cmd  ${cmd_buf} | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 26 |  | 
|  | 27 |  | 
|  | 28 | Run DMTF Tool | 
|  | 29 | [Documentation]  Execution of the command. | 
| manashsarma | a053fb3 | 2020-06-08 08:43:32 -0500 | [diff] [blame] | 30 | [Arguments]      ${rsv_dir_path}  ${command_string}  ${check_error}=0 | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 31 |  | 
|  | 32 | # Description of arguments: | 
|  | 33 | # rsv_dir_path    Directory path for rsv tool (e.g. "Redfish-Service-Validator"). | 
|  | 34 | # command_string  The complete rsv command string to be run. | 
| manashsarma | a053fb3 | 2020-06-08 08:43:32 -0500 | [diff] [blame] | 35 | # check_error     It decides if error information is to be checked. | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 36 |  | 
| manashsarma | a053fb3 | 2020-06-08 08:43:32 -0500 | [diff] [blame] | 37 | ${rc}  ${output}=  Shell Cmd  ${command_string}  ignore_err=${check_error} | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 38 | Log  ${output} | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 39 | RETURN  ${rc}  ${output} | 
| George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 40 |  | 
|  | 41 |  | 
|  | 42 | Redfish Service Validator Result | 
|  | 43 | [Documentation]  Check tool output for errors. | 
|  | 44 | [Arguments]      ${tool_output} | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 45 |  | 
| Sridevi Ramesh | 8924229 | 2025-07-20 02:36:56 -0500 | [diff] [blame] | 46 | # Description of arguments: | 
|  | 47 | # tool_output    DMTF tool output. | 
|  | 48 |  | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 49 | # Example: | 
|  | 50 | # Validation has failed: 9 problems found | 
| George Keishing | 4a90394 | 2022-12-21 23:27:04 -0600 | [diff] [blame] | 51 | # Service could not be started: RetriesExhaustedError() | 
|  | 52 | Should Not Contain Any  ${tool_output}  Validation has failed | 
|  | 53 | ...  Service could not be started: RetriesExhaustedError() | 
| George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 54 |  | 
|  | 55 |  | 
|  | 56 | Redfish JsonSchema ResponseValidator Result | 
|  | 57 | [Documentation]  Check tool output for errors. | 
|  | 58 | [Arguments]      ${tool_output} | 
|  | 59 |  | 
| Sridevi Ramesh | 8924229 | 2025-07-20 02:36:56 -0500 | [diff] [blame] | 60 | # Description of arguments: | 
|  | 61 | # tool_output    DMTF tool output. | 
|  | 62 |  | 
| George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 63 | # Example: | 
|  | 64 | # 0 errors | 
|  | 65 | Should Contain  ${tool_output}  0 errors | 
|  | 66 |  |