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. |
| 16 | [Arguments] ${rsv_dir_path} ${rsv_github_url} |
| 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 | |
| 22 | ${rc} ${output}= Shell Cmd rm -rf ${rsv_dir_path} ; git clone ${rsv_github_url} ${rsv_dir_path} |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 23 | |
| 24 | |
| 25 | Run DMTF Tool |
| 26 | [Documentation] Execution of the command. |
| 27 | [Arguments] ${rsv_dir_path} ${command_string} |
| 28 | |
| 29 | # Description of arguments: |
| 30 | # rsv_dir_path Directory path for rsv tool (e.g. "Redfish-Service-Validator"). |
| 31 | # command_string The complete rsv command string to be run. |
| 32 | |
| 33 | ${rc} ${output}= Shell Cmd ${command_string} |
| 34 | Log ${output} |
George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 35 | [Return] ${output} |
| 36 | |
| 37 | |
| 38 | Redfish Service Validator Result |
| 39 | [Documentation] Check tool output for errors. |
| 40 | [Arguments] ${tool_output} |
George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 41 | |
| 42 | # Example: |
| 43 | # Validation has failed: 9 problems found |
George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 44 | Should Not Contain ${tool_output} Validation has failed |
| 45 | |
| 46 | |
| 47 | Redfish JsonSchema ResponseValidator Result |
| 48 | [Documentation] Check tool output for errors. |
| 49 | [Arguments] ${tool_output} |
| 50 | |
| 51 | # Example: |
| 52 | # 0 errors |
| 53 | Should Contain ${tool_output} 0 errors |
| 54 | |