| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 1 | *** Settings *** | 
 | 2 | Documentation      Test BMC using https://github.com/DMTF/Redfish-Service-Validator. | 
 | 3 | ...                DMTF tool. | 
 | 4 |  | 
 | 5 | Library            OperatingSystem | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 6 | Library            ../../lib/gen_robot_print.py | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 7 | Resource           ../../lib/dmtf_tools_utils.robot | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 8 | Resource           ../../lib/bmc_redfish_resource.robot | 
 | 9 | Resource           ../../lib/bmc_redfish_utils.robot | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 10 |  | 
| Sridevi Ramesh | cf0c8b0 | 2025-09-17 06:22:35 -0500 | [diff] [blame] | 11 | Test Tags          Redfish_Service_Validator | 
 | 12 |  | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 13 | *** Variables *** | 
 | 14 |  | 
 | 15 | ${DEFAULT_PYTHON}  python3 | 
 | 16 | ${rsv_dir_path}    Redfish-Service-Validator | 
 | 17 | ${rsv_github_url}  https://github.com/DMTF/Redfish-Service-Validator.git | 
| George Keishing | f189ff8 | 2021-08-10 23:32:15 -0500 | [diff] [blame] | 18 | ${cmd_str_master}  ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishServiceValidator.py | 
 | 19 | ...                --ip https://${OPENBMC_HOST}:${HTTPS_PORT} --authtype=Session -u ${OPENBMC_USERNAME} | 
 | 20 | ...                -p ${OPENBMC_PASSWORD} --logdir ${EXECDIR}${/}logs${/} --debugging | 
| George Keishing | 839ec72 | 2023-10-09 12:56:05 +0530 | [diff] [blame] | 21 | ${branch_name}    main | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 22 |  | 
| George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 23 | *** Test Cases *** | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 24 |  | 
 | 25 | Test BMC Redfish Using Redfish Service Validator | 
 | 26 |     [Documentation]  Check conformance with a Redfish service interface. | 
 | 27 |     [Tags]  Test_BMC_Redfish_Using_Redfish_Service_Validator | 
 | 28 |  | 
| ganesanb | bca06d0 | 2023-04-15 10:52:51 +0000 | [diff] [blame] | 29 |     Download DMTF Tool  ${rsv_dir_path}  ${rsv_github_url}  ${branch_name} | 
| George Keishing | 00ee05a | 2019-02-25 12:35:06 -0600 | [diff] [blame] | 30 |  | 
| George Keishing | 899ae01 | 2022-03-25 10:16:41 -0500 | [diff] [blame] | 31 |     ${rc}  ${output}=  Run DMTF Tool  ${rsv_dir_path}  ${cmd_str_master}  check_error=1 | 
| George Keishing | 398d9e6 | 2019-02-28 05:41:33 -0600 | [diff] [blame] | 32 |  | 
 | 33 |     Redfish Service Validator Result  ${output} | 
| George Keishing | c5dbbdd | 2025-05-07 13:55:17 +0530 | [diff] [blame] | 34 |     IF  ${rc} != 0  Fail  Redfish-Service-Validator Failed. | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 35 |  | 
 | 36 |  | 
 | 37 | Run Redfish Service Validator With Additional Roles | 
 | 38 |     [Documentation]  Check Redfish conformance using the Redfish Service Validator. | 
 | 39 |     ...  Run the validator as additional non-admin user roles. | 
 | 40 |     [Tags]  Run_Redfish_Service_Validator_With_Additional_Roles | 
 | 41 |     [Template]  Create User And Run Service Validator | 
 | 42 |  | 
| George Keishing | 2c13201 | 2023-11-08 15:46:54 +0530 | [diff] [blame] | 43 |     #username      password       role        enabled | 
 | 44 |     operator_user  0penBmc123     Operator    ${True} | 
 | 45 |     readonly_user  0penBmc123     ReadOnly    ${True} | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 46 |  | 
 | 47 | *** Keywords *** | 
 | 48 |  | 
 | 49 | Create User And Run Service Validator | 
 | 50 |     [Documentation]  Create user and run validator. | 
 | 51 |     [Arguments]   ${username}  ${password}  ${role}  ${enabled} | 
 | 52 |     [Teardown]  Delete User Created  ${username} | 
 | 53 |  | 
 | 54 |     # Description of argument(s): | 
 | 55 |     # username            The username to be created. | 
 | 56 |     # password            The password to be assigned. | 
 | 57 |     # role                The role of the user to be created | 
 | 58 |     #                     (e.g. "Administrator", "Operator", etc.). | 
 | 59 |     # enabled             Indicates whether the username being created | 
 | 60 |     #                     should be enabled (${True}, ${False}). | 
 | 61 |  | 
 | 62 |     Redfish.Login | 
 | 63 |     Redfish Create User  ${username}  ${password}  ${role}  ${enabled} | 
 | 64 |     Redfish.Logout | 
 | 65 |  | 
| ganesanb | bca06d0 | 2023-04-15 10:52:51 +0000 | [diff] [blame] | 66 |     Download DMTF Tool  ${rsv_dir_path}  ${rsv_github_url}  ${branch_name} | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 67 |  | 
 | 68 |     ${cmd}=  Catenate  ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishServiceValidator.py | 
| George Keishing | 899ae01 | 2022-03-25 10:16:41 -0500 | [diff] [blame] | 69 |     ...  --ip https://${OPENBMC_HOST}:${HTTPS_PORT} --authtype=Session -u ${username} | 
 | 70 |     ...  -p ${password} --logdir ${EXECDIR}${/}logs_${username}${/} --debugging | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 71 |  | 
 | 72 |     Rprint Vars  cmd | 
 | 73 |  | 
| George Keishing | 899ae01 | 2022-03-25 10:16:41 -0500 | [diff] [blame] | 74 |     ${rc}  ${output}=  Run DMTF Tool  ${rsv_dir_path}  ${cmd}  check_error=1 | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 75 |  | 
 | 76 |     Redfish Service Validator Result  ${output} | 
| George Keishing | c5dbbdd | 2025-05-07 13:55:17 +0530 | [diff] [blame] | 77 |     IF  ${rc} != 0  Fail | 
| George Keishing | 4a95aef | 2020-03-04 01:33:42 -0600 | [diff] [blame] | 78 |  | 
 | 79 |  | 
 | 80 | Delete User Created | 
 | 81 |     [Documentation]  Delete user. | 
 | 82 |     [Arguments]   ${username} | 
 | 83 |  | 
 | 84 |     # Description of argument(s): | 
 | 85 |     # username            The username to be deleted. | 
 | 86 |  | 
 | 87 |     Redfish.Login | 
 | 88 |     Redfish.Delete  /redfish/v1/AccountService/Accounts/${username} | 
 | 89 |     Redfish.Logout |