blob: ce6539fe4bd776ae70e0ee20ce0a83a53aaf7f73 [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
Sridevi Rameshcf0c8b02025-09-17 06:22:35 -050011Test Tags Redfish_Service_Validator
12
George Keishing00ee05a2019-02-25 12:35:06 -060013*** 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 Keishingf189ff82021-08-10 23:32:15 -050018${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 Keishing839ec722023-10-09 12:56:05 +053021${branch_name} main
George Keishing00ee05a2019-02-25 12:35:06 -060022
George Keishing409df052024-01-17 22:36:14 +053023*** Test Cases ***
George Keishing00ee05a2019-02-25 12:35:06 -060024
25Test 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
ganesanbbca06d02023-04-15 10:52:51 +000029 Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name}
George Keishing00ee05a2019-02-25 12:35:06 -060030
George Keishing899ae012022-03-25 10:16:41 -050031 ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${cmd_str_master} check_error=1
George Keishing398d9e62019-02-28 05:41:33 -060032
33 Redfish Service Validator Result ${output}
George Keishingc5dbbdd2025-05-07 13:55:17 +053034 IF ${rc} != 0 Fail Redfish-Service-Validator Failed.
George Keishing4a95aef2020-03-04 01:33:42 -060035
36
37Run 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 Keishing2c132012023-11-08 15:46:54 +053043 #username password role enabled
44 operator_user 0penBmc123 Operator ${True}
45 readonly_user 0penBmc123 ReadOnly ${True}
George Keishing4a95aef2020-03-04 01:33:42 -060046
47*** Keywords ***
48
49Create 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
ganesanbbca06d02023-04-15 10:52:51 +000066 Download DMTF Tool ${rsv_dir_path} ${rsv_github_url} ${branch_name}
George Keishing4a95aef2020-03-04 01:33:42 -060067
68 ${cmd}= Catenate ${DEFAULT_PYTHON} ${rsv_dir_path}${/}RedfishServiceValidator.py
George Keishing899ae012022-03-25 10:16:41 -050069 ... --ip https://${OPENBMC_HOST}:${HTTPS_PORT} --authtype=Session -u ${username}
70 ... -p ${password} --logdir ${EXECDIR}${/}logs_${username}${/} --debugging
George Keishing4a95aef2020-03-04 01:33:42 -060071
72 Rprint Vars cmd
73
George Keishing899ae012022-03-25 10:16:41 -050074 ${rc} ${output}= Run DMTF Tool ${rsv_dir_path} ${cmd} check_error=1
George Keishing4a95aef2020-03-04 01:33:42 -060075
76 Redfish Service Validator Result ${output}
George Keishingc5dbbdd2025-05-07 13:55:17 +053077 IF ${rc} != 0 Fail
George Keishing4a95aef2020-03-04 01:33:42 -060078
79
80Delete 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