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