1*** Settings ***
2Documentation   DMTF tools utility keywords.
3
4Resource        resource.robot
5Library         gen_cmd.py
6
7*** Variables ***
8
9# ignore_err controls Shell Cmd behavior.
10${ignore_err}     ${0}
11
12*** Keywords ***
13
14Download 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}
23
24
25Run 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}
35    [Return]  ${output}
36
37
38Redfish Service Validator Result
39    [Documentation]  Check tool output for errors.
40    [Arguments]      ${tool_output}
41
42    # Example:
43    # Validation has failed: 9 problems found
44    Should Not Contain  ${tool_output}  Validation has failed
45
46
47Redfish 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
55