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"). |
| 21 | |
George Keishing | 2d0804e | 2019-12-12 22:27:05 -0600 | [diff] [blame] | 22 | ${cmd_buf} Catenate rm -rf ${rsv_dir_path} ; |
ganesanb | bca06d0 | 2023-04-15 10:52:51 +0000 | [diff] [blame] | 23 | ... git clone --branch ${branch_name} ${rsv_github_url} ${rsv_dir_path} |
George Keishing | 2d0804e | 2019-12-12 22:27:05 -0600 | [diff] [blame] | 24 | ${rc} ${output}= Shell Cmd ${cmd_buf} |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 25 | |
| 26 | |
| 27 | Run DMTF Tool |
| 28 | [Documentation] Execution of the command. |
manashsarma | a053fb3 | 2020-06-08 08:43:32 -0500 | [diff] [blame] | 29 | [Arguments] ${rsv_dir_path} ${command_string} ${check_error}=0 |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 30 | |
| 31 | # Description of arguments: |
| 32 | # rsv_dir_path Directory path for rsv tool (e.g. "Redfish-Service-Validator"). |
| 33 | # command_string The complete rsv command string to be run. |
manashsarma | a053fb3 | 2020-06-08 08:43:32 -0500 | [diff] [blame] | 34 | # check_error It decides if error information is to be checked. |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 35 | |
manashsarma | a053fb3 | 2020-06-08 08:43:32 -0500 | [diff] [blame] | 36 | ${rc} ${output}= Shell Cmd ${command_string} ignore_err=${check_error} |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 37 | Log ${output} |
George Keishing | 899ae01 | 2022-03-25 10:16:41 -0500 | [diff] [blame] | 38 | [Return] ${rc} ${output} |
George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 39 | |
| 40 | |
| 41 | Redfish Service Validator Result |
| 42 | [Documentation] Check tool output for errors. |
| 43 | [Arguments] ${tool_output} |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 44 | |
| 45 | # Example: |
| 46 | # Validation has failed: 9 problems found |
George Keishing | 4a90394 | 2022-12-21 23:27:04 -0600 | [diff] [blame] | 47 | # Service could not be started: RetriesExhaustedError() |
| 48 | Should Not Contain Any ${tool_output} Validation has failed |
| 49 | ... Service could not be started: RetriesExhaustedError() |
George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 50 | |
| 51 | |
| 52 | Redfish JsonSchema ResponseValidator Result |
| 53 | [Documentation] Check tool output for errors. |
| 54 | [Arguments] ${tool_output} |
| 55 | |
| 56 | # Example: |
| 57 | # 0 errors |
| 58 | Should Contain ${tool_output} 0 errors |
| 59 | |