xref: /openbmc/openbmc-test-automation/redfish/dmtf_tools/Redfish_Protocol_Validator.robot (revision 069b266e40a93fda3992c888062745b1ac920473)
1*** Settings ***
2Documentation             Test BMC using
3...                       https://github.com/DMTF/Redfish-Protocol-Validator
4...                       DMTF tool.
5
6Library                   OperatingSystem
7Resource                  ../../lib/dmtf_tools_utils.robot
8
9Test Setup                Test Setup Execution
10
11*** Variables ***
12
13${DEFAULT_PYTHON}         python3
14
15${rsv_github_url}         https://github.com/DMTF/Redfish-Protocol-Validator
16${rsv_dir_path}           Redfish-Protocol-Validator
17
18${command_string}  ${DEFAULT_PYTHON} ${rsv_dir_path}${/}rf_protocol_validator.py
19...                -r ${OPENBMC_HOST}:${HTTPS_PORT}
20...                -u ${OPENBMC_USERNAME}
21...                -p ${OPENBMC_PASSWORD}
22...                --no-cert-check
23...
24
25${branch_name}    main
26
27*** Test Cases ***
28
29Test BMC Redfish Protocol Validator
30    [Documentation]  The Redfish Protocol Validator tests the HTTP protocol
31    ...              behavior of a Redfish service to validate that it
32    ...              conforms to the Redfish Specification.
33    [Tags]  Test_BMC_Redfish_Protocol_Validator
34
35    ${rc}  ${output}=  Run DMTF Tool  ${rsv_dir_path}  ${command_string}  check_error=1
36
37    # Example output and fail count regex:
38    # Summary - PASS: 61, WARN: 1, FAIL: 42, NOT_TESTED: 60
39    # Fail count group returned from regex ['FAIL: 42', '42']
40
41    ${fail_count}=  Should Match Regexp  ${output}  FAIL: (\\d+)
42
43    IF  ${fail_count[1]} != 0  Fail  Redfish Protocol Validator Failed
44
45
46*** Keywords ***
47
48Test Setup Execution
49    [Documentation]  Do test case setup tasks.
50
51    Download DMTF Tool  ${rsv_dir_path}  ${rsv_github_url}  ${branch_name}
52