blob: 382a2b38d1cb42bf851d4c02f8d46e6869b8f697 [file] [log] [blame]
George Keishing00ee05a2019-02-25 12:35:06 -06001*** Settings ***
2Documentation Test BMC using https://github.com/DMTF/Redfish-Service-Validator.
3... DMTF tool.
4
5Library OperatingSystem
George Keishing4a95aef2020-03-04 01:33:42 -06006Library ../../lib/gen_robot_print.py
George Keishing00ee05a2019-02-25 12:35:06 -06007Resource ../../lib/dmtf_tools_utils.robot
George Keishing4a95aef2020-03-04 01:33:42 -06008Resource ../../lib/bmc_redfish_resource.robot
9Resource ../../lib/bmc_redfish_utils.robot
George Keishing00ee05a2019-02-25 12:35:06 -060010
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 Keishingf189ff82021-08-10 23:32:15 -050016${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 Keishing00ee05a2019-02-25 12:35:06 -060019
20*** Test Case ***
21
22Test 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 Keishing899ae012022-03-25 10:16:41 -050028 ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${cmd_str_master} check_error=1
George Keishing398d9e62019-02-28 05:41:33 -060029
30 Redfish Service Validator Result ${output}
George Keishing899ae012022-03-25 10:16:41 -050031 Run Keyword If ${rc} != 0 Fail Redfish-Service-Validator Failed.
George Keishing4a95aef2020-03-04 01:33:42 -060032
33
34Run Redfish Service Validator With Additional Roles
35 [Documentation] Check Redfish conformance using the Redfish Service Validator.
36 ... Run the validator as additional non-admin user roles.
37 [Tags] Run_Redfish_Service_Validator_With_Additional_Roles
38 [Template] Create User And Run Service Validator
39
40 #username password role enabled
41 operator_user ${OPENBMC_PASSWORD} Operator ${True}
42 readonly_user ${OPENBMC_PASSWORD} ReadOnly ${True}
43
44
45*** Keywords ***
46
47Create 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
64 Download DMTF Tool ${rsv_dir_path} ${rsv_github_url}
65
66 ${cmd}= Catenate ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishServiceValidator.py
George Keishing899ae012022-03-25 10:16:41 -050067 ... --ip https://${OPENBMC_HOST}:${HTTPS_PORT} --authtype=Session -u ${username}
68 ... -p ${password} --logdir ${EXECDIR}${/}logs_${username}${/} --debugging
George Keishing4a95aef2020-03-04 01:33:42 -060069
70 Rprint Vars cmd
71
George Keishing899ae012022-03-25 10:16:41 -050072 ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${cmd} check_error=1
George Keishing4a95aef2020-03-04 01:33:42 -060073
74 Redfish Service Validator Result ${output}
George Keishing899ae012022-03-25 10:16:41 -050075 Run Keyword If ${rc} != 0 Fail
George Keishing4a95aef2020-03-04 01:33:42 -060076
77
78Delete 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