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    ${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}
26
27
28Run DMTF Tool
29    [Documentation]  Execution of the command.
30    [Arguments]      ${rsv_dir_path}  ${command_string}
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.
35
36    ${rc}  ${output}=  Shell Cmd  ${command_string}
37    Log  ${output}
38    [Return]  ${output}
39
40
41Redfish Service Validator Result
42    [Documentation]  Check tool output for errors.
43    [Arguments]      ${tool_output}
44
45    # Example:
46    # Validation has failed: 9 problems found
47    Should Not Contain  ${tool_output}  Validation has failed
48
49
50Redfish JsonSchema ResponseValidator Result
51    [Documentation]  Check tool output for errors.
52    [Arguments]      ${tool_output}
53
54    # Example:
55    # 0 errors
56    Should Contain  ${tool_output}  0 errors
57
58