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