blob: 273aa8eccf1c707096d52b1970fdb0dde154acfd [file] [log] [blame]
manashsarma677408d2021-06-22 07:35:33 -05001*** Settings ***
2Documentation This suite is to test service user functionality via Redfish.
3
George Keishing33be3592022-03-08 08:52:25 -06004Resource ../../lib/connection_client.robot
manashsarma94c97d82021-07-09 05:25:45 -05005Resource ../../lib/openbmc_ffdc.robot
6Resource ../../lib/bmc_redfish_utils.robot
manashsarma677408d2021-06-22 07:35:33 -05007
8Suite Setup Suite Setup Execution
9Suite Teardown Redfish.Logout
10Test Teardown FFDC On Test Case Fail
11
George Keishing7c32f302023-10-10 16:11:46 +053012Force Tags Service_User
manashsarma677408d2021-06-22 07:35:33 -050013
14*** Test Cases ***
15
manashsarma70adc252021-07-15 07:07:48 -050016Verify Service User Availability
manashsarma677408d2021-06-22 07:35:33 -050017 [Documentation] Verify service user avalability.
manashsarma70adc252021-07-15 07:07:48 -050018 [Tags] Verify_Service_User_Availability
manashsarma677408d2021-06-22 07:35:33 -050019
20 # Verify that service user has administrator privilege.
21 ${role_config}= Redfish_Utils.Get Attribute
22 ... /redfish/v1/AccountService/Accounts/service RoleId
23
24 Should Be Equal Administrator ${role_config}
25
26
manashsarma94c97d82021-07-09 05:25:45 -050027Verify Creating User With Service Username
28 [Documentation] Verify that user with service username can not be created.
manashsarma70adc252021-07-15 07:07:48 -050029 [Tags] Verify_Creating_User_With_Service_Username
manashsarma94c97d82021-07-09 05:25:45 -050030
31 ${payload}= Create Dictionary
32 ... UserName=service Password=TestPwd1 RoleId=Operator Enabled=${True}
33 Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload}
manashsarma5786f282021-08-10 06:40:53 -050034 ... valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma94c97d82021-07-09 05:25:45 -050035
manashsarma70adc252021-07-15 07:07:48 -050036
37Verify Modifying Service User Password
38 [Documentation] Verify error while modifying service user password in Redfish.
39 [Tags] Verify_Modifying_Service_User_Password
40
41 ${payload}= Create Dictionary Password=NewTestPwd123
42 # Modification of service user password is not allowed via Redfish API.
43 Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload}
manashsarma5786f282021-08-10 06:40:53 -050044 ... valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma70adc252021-07-15 07:07:48 -050045
46
manashsarma8fe2b2d2021-07-23 01:59:06 -050047Verify Renaming Service User
48 [Documentation] Verify error while renaming service user via Redfish.
manashsarma39122c12021-07-26 01:57:37 -050049 [Tags] Verify_Renaming_Service_User
manashsarma8fe2b2d2021-07-23 01:59:06 -050050
51 ${payload}= Create Dictionary UserName=new_service
52 Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload}
manashsarma5786f282021-08-10 06:40:53 -050053 ... valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma8fe2b2d2021-07-23 01:59:06 -050054
55
manashsarma39122c12021-07-26 01:57:37 -050056Verify Deleting Service User
57 [Documentation] Verify error while deleting service user via Redfish.
58 [Tags] Verify_Deleting_Service_User
59
manashsarma5786f282021-08-10 06:40:53 -050060 Redfish.Delete /redfish/v1/AccountService/Accounts/service valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma39122c12021-07-26 01:57:37 -050061
62
manashsarma9b429d62021-11-11 04:16:37 -060063Verify Modifying Service User Role
64 [Documentation] Verify error while modifyig service user role via Redfish.
65 [Tags] Verify_Modifying_Service_User_Role
66
67 ${payload}= Create Dictionary RoleId=Operator
68 Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload}
69 ... valid_status_codes=[${HTTP_FORBIDDEN}]
70
71
manashsarma677408d2021-06-22 07:35:33 -050072*** Keywords ***
73
74Suite Setup Execution
75 [Documentation] Do suite setup tasks.
76
77 Redfish.Login