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