blob: a4929b323d386b65a33268ff31700313c5293186 [file] [log] [blame]
manashsarma677408d2021-06-22 07:35:33 -05001*** Settings ***
2Documentation This suite is to test service user functionality via Redfish.
3
manashsarma94c97d82021-07-09 05:25:45 -05004Resource ../../lib/connection_client.robot
5Resource ../../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
12
13*** Test Cases ***
14
manashsarma70adc252021-07-15 07:07:48 -050015Verify Service User Availability
manashsarma677408d2021-06-22 07:35:33 -050016 [Documentation] Verify service user avalability.
manashsarma70adc252021-07-15 07:07:48 -050017 [Tags] Verify_Service_User_Availability
manashsarma677408d2021-06-22 07:35:33 -050018
19 # Verify that service user has administrator privilege.
20 ${role_config}= Redfish_Utils.Get Attribute
21 ... /redfish/v1/AccountService/Accounts/service RoleId
22
23 Should Be Equal Administrator ${role_config}
24
25
manashsarma94c97d82021-07-09 05:25:45 -050026Verify Creating User With Service Username
27 [Documentation] Verify that user with service username can not be created.
manashsarma70adc252021-07-15 07:07:48 -050028 [Tags] Verify_Creating_User_With_Service_Username
manashsarma94c97d82021-07-09 05:25:45 -050029
30 ${payload}= Create Dictionary
31 ... UserName=service Password=TestPwd1 RoleId=Operator Enabled=${True}
32 Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload}
manashsarma5786f282021-08-10 06:40:53 -050033 ... valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma94c97d82021-07-09 05:25:45 -050034
manashsarma70adc252021-07-15 07:07:48 -050035
36Verify Modifying Service User Password
37 [Documentation] Verify error while modifying service user password in Redfish.
38 [Tags] Verify_Modifying_Service_User_Password
39
40 ${payload}= Create Dictionary Password=NewTestPwd123
41 # Modification of service user password is not allowed via Redfish API.
42 Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload}
manashsarma5786f282021-08-10 06:40:53 -050043 ... valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma70adc252021-07-15 07:07:48 -050044
45
manashsarma8fe2b2d2021-07-23 01:59:06 -050046Verify Renaming Service User
47 [Documentation] Verify error while renaming service user via Redfish.
manashsarma39122c12021-07-26 01:57:37 -050048 [Tags] Verify_Renaming_Service_User
manashsarma8fe2b2d2021-07-23 01:59:06 -050049
50 ${payload}= Create Dictionary UserName=new_service
51 Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload}
manashsarma5786f282021-08-10 06:40:53 -050052 ... valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma8fe2b2d2021-07-23 01:59:06 -050053
54
manashsarma39122c12021-07-26 01:57:37 -050055Verify Deleting Service User
56 [Documentation] Verify error while deleting service user via Redfish.
57 [Tags] Verify_Deleting_Service_User
58
manashsarma5786f282021-08-10 06:40:53 -050059 Redfish.Delete /redfish/v1/AccountService/Accounts/service valid_status_codes=[${HTTP_FORBIDDEN}]
manashsarma39122c12021-07-26 01:57:37 -050060
61
manashsarma9b429d62021-11-11 04:16:37 -060062Verify Modifying Service User Role
63 [Documentation] Verify error while modifyig service user role via Redfish.
64 [Tags] Verify_Modifying_Service_User_Role
65
66 ${payload}= Create Dictionary RoleId=Operator
67 Redfish.Patch /redfish/v1/AccountService/Accounts/service body=&{payload}
68 ... valid_status_codes=[${HTTP_FORBIDDEN}]
69
70
manashsarma677408d2021-06-22 07:35:33 -050071*** Keywords ***
72
73Suite Setup Execution
74 [Documentation] Do suite setup tasks.
75
76 Redfish.Login