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} |
George Keishing | 63f7bfc | 2019-10-29 00:30:38 -0500 | [diff] [blame] | 11 | ${stable_branch} master |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 12 | |
| 13 | *** Keywords *** |
| 14 | |
| 15 | Download DMTF Tool |
| 16 | [Documentation] Git clone tool. |
| 17 | [Arguments] ${rsv_dir_path} ${rsv_github_url} |
| 18 | |
| 19 | # Description of arguments: |
| 20 | # rsv_dir_path Directory path for rsv tool (e.g. "Redfish-Service-Validator"). |
| 21 | # rsv_github_url Github URL link(e.g "https://github.com/DMTF/Redfish-Service-Validator"). |
| 22 | |
George Keishing | 2d0804e | 2019-12-12 22:27:05 -0600 | [diff] [blame] | 23 | ${cmd_buf} Catenate rm -rf ${rsv_dir_path} ; |
| 24 | ... git clone --branch ${stable_branch} ${rsv_github_url} ${rsv_dir_path} |
| 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 | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 39 | [Return] ${output} |
| 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 | |
| 46 | # Example: |
| 47 | # Validation has failed: 9 problems found |
George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 48 | Should Not Contain ${tool_output} Validation has failed |
| 49 | |
| 50 | |
| 51 | Redfish JsonSchema ResponseValidator Result |
| 52 | [Documentation] Check tool output for errors. |
| 53 | [Arguments] ${tool_output} |
| 54 | |
| 55 | # Example: |
| 56 | # 0 errors |
| 57 | Should Contain ${tool_output} 0 errors |
| 58 | |