blob: ca54e41d9e4dd81be3f7a4a9b7067d0ae3c3358d [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
ganesanbbca06d02023-04-15 10:52:51 +000019${branch_name} master
George Keishing00ee05a2019-02-25 12:35:06 -060020
21*** Test Case ***
22
23Test 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
ganesanbbca06d02023-04-15 10:52:51 +000027 Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name}
George Keishing00ee05a2019-02-25 12:35:06 -060028
George Keishing899ae012022-03-25 10:16:41 -050029 ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${cmd_str_master} check_error=1
George Keishing398d9e62019-02-28 05:41:33 -060030
31 Redfish Service Validator Result ${output}
George Keishing899ae012022-03-25 10:16:41 -050032 Run Keyword If ${rc} != 0 Fail Redfish-Service-Validator Failed.
George Keishing4a95aef2020-03-04 01:33:42 -060033
34
35Run 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
41 #username password role enabled
42 operator_user ${OPENBMC_PASSWORD} Operator ${True}
43 readonly_user ${OPENBMC_PASSWORD} ReadOnly ${True}
44
45
46*** Keywords ***
47
48Create User And Run Service Validator
49 [Documentation] Create user and run validator.
50 [Arguments] ${username} ${password} ${role} ${enabled}
51 [Teardown] Delete User Created ${username}
52
53 # Description of argument(s):
54 # username The username to be created.
55 # password The password to be assigned.
56 # role The role of the user to be created
57 # (e.g. "Administrator", "Operator", etc.).
58 # enabled Indicates whether the username being created
59 # should be enabled (${True}, ${False}).
60
61 Redfish.Login
62 Redfish Create User ${username} ${password} ${role} ${enabled}
63 Redfish.Logout
64
ganesanbbca06d02023-04-15 10:52:51 +000065 Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name}
George Keishing4a95aef2020-03-04 01:33:42 -060066
67 ${cmd}= Catenate ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishServiceValidator.py
George Keishing899ae012022-03-25 10:16:41 -050068 ... --ip https://${OPENBMC_HOST}:${HTTPS_PORT} --authtype=Session -u ${username}
69 ... -p ${password} --logdir ${EXECDIR}${/}logs_${username}${/} --debugging
George Keishing4a95aef2020-03-04 01:33:42 -060070
71 Rprint Vars cmd
72
George Keishing899ae012022-03-25 10:16:41 -050073 ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${cmd} check_error=1
George Keishing4a95aef2020-03-04 01:33:42 -060074
75 Redfish Service Validator Result ${output}
George Keishing899ae012022-03-25 10:16:41 -050076 Run Keyword If ${rc} != 0 Fail
George Keishing4a95aef2020-03-04 01:33:42 -060077
78
79Delete User Created
80 [Documentation] Delete user.
81 [Arguments] ${username}
82
83 # Description of argument(s):
84 # username The username to be deleted.
85
86 Redfish.Login
87 Redfish.Delete /redfish/v1/AccountService/Accounts/${username}
88 Redfish.Logout