blob: 4109154ffc6ca8fc5924169bde805c0c4a21730f [file] [log] [blame]
Sivas SRR6aa101f2019-02-19 22:31:55 -06001*** Settings ***
2Documentation Test Redfish user account.
3
4Resource ../../lib/resource.robot
5Resource ../../lib/bmc_redfish_resource.robot
6Resource ../../lib/openbmc_ffdc.robot
7
8Test Setup Test Setup Execution
9Test Teardown Test Teardown Execution
10
Sandhya Somashekar37122b62019-06-18 06:02:02 -050011*** Variables ***
12
13${account_lockout_duration} ${30}
14${account_lockout_threshold} ${3}
15
Sivas SRR6aa101f2019-02-19 22:31:55 -060016
17** Test Cases **
18
19Verify AccountService Available
Sivas SRRfa6831c2019-02-22 00:12:00 -060020 [Documentation] Verify Redfish account service is available.
Sivas SRR6aa101f2019-02-19 22:31:55 -060021 [Tags] Verify_AccountService_Available
22
George Keishing97c93942019-03-04 12:45:07 -060023 ${resp} = Redfish_utils.Get Attribute /redfish/v1/AccountService ServiceEnabled
Sivas SRR6aa101f2019-02-19 22:31:55 -060024 Should Be Equal As Strings ${resp} ${True}
25
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -060026Redfish Create and Verify Users
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050027 [Documentation] Create Redfish users with various roles.
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -060028 [Tags] Redfish_Create_and_Verify_Users
29 [Template] Redfish Create And Verify User
30
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050031 #username password role_id enabled
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050032 admin_user TestPwd123 Administrator ${True}
33 operator_user TestPwd123 Operator ${True}
34 user_user TestPwd123 User ${True}
35 callback_user TestPwd123 Callback ${True}
Sivas SRR6aa101f2019-02-19 22:31:55 -060036
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050037Verify Redfish User with Wrong Password
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050038 [Documentation] Verify Redfish User with Wrong Password.
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050039 [Tags] Verify_Redfish_User_with_Wrong_Password
40 [Template] Verify Redfish User with Wrong Password
41
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050042 #username password role_id enabled wrong_password
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050043 admin_user TestPwd123 Administrator ${True} alskjhfwurh
44 operator_user TestPwd123 Operator ${True} 12j8a8uakjhdaosiruf024
45 user_user TestPwd123 User ${True} 12
46 callback_user TestPwd123 Callback ${True} !#@D#RF#@!D
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050047
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -050048Verify Login with Deleted Redfish Users
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050049 [Documentation] Verify login with deleted Redfish Users.
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -050050 [Tags] Verify_Login_with_Deleted_Redfish_Users
51 [Template] Verify Login with Deleted Redfish User
52
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050053 #username password role_id enabled
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050054 admin_user TestPwd123 Administrator ${True}
55 operator_user TestPwd123 Operator ${True}
56 user_user TestPwd123 User ${True}
57 callback_user TestPwd123 Callback ${True}
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -050058
George Keishinge0c5ec32019-06-13 09:45:29 -050059Verify User Creation Without Enabling It
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050060 [Documentation] Verify User Creation Without Enabling it.
George Keishinge0c5ec32019-06-13 09:45:29 -050061 [Tags] Verify_User_Creation_Without_Enabling_It
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050062 [Template] Verify Create User Without Enabling
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050063
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050064 #username password role_id enabled
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050065 admin_user TestPwd123 Administrator ${False}
66 operator_user TestPwd123 Operator ${False}
67 user_user TestPwd123 User ${False}
68 callback_user TestPwd123 Callback ${False}
69
70Verify Redfish User Persistence After Reboot
71 [Documentation] Verify Redfish user persistence after reboot.
72 [Tags] Verify_Redfish_User_Persistence_After_Reboot
73
74 # Create Redfish users.
75 Redfish Create User admin_user TestPwd123 Administrator ${True}
76 Redfish Create User operator_user TestPwd123 Operator ${True}
77 Redfish Create User user_user TestPwd123 User ${True}
78 Redfish Create User callback_user TestPwd123 Callback ${True}
79
80 # Reboot BMC.
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050081 Redfish OBMC Reboot (off) stack_mode=normal
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050082
83 # Verify users after reboot.
84 Redfish Verify User admin_user TestPwd123 Administrator ${True}
85 Redfish Verify User operator_user TestPwd123 Operator ${True}
86 Redfish Verify User user_user TestPwd123 User ${True}
87 Redfish Verify User callback_user TestPwd123 Callback ${True}
88
89 # Delete created users.
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -050090 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
91 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
92 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
93 Redfish.Delete ${REDFISH_ACCOUNTS_URI}callback_user
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050094
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050095Verify User Creation With Invalid Role Id
Sandhya Somashekard7d46c02019-06-26 05:10:25 -050096 [Documentation] Verify user creation with invalid role ID.
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050097 [Tags] Verify_User_Creation_With_Invalid_Role_Id
98
99 # Make sure the user account in question does not already exist.
100 Redfish.Delete ${REDFISH_ACCOUNTS_URI}test_user
101 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
102
103 # Create specified user.
104 ${payload}= Create Dictionary
105 ... UserName=test_user Password=TestPwd123 RoleId=wrongroleid Enabled=${True}
106 Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
107 ... valid_status_codes=[${HTTP_BAD_REQUEST}]
108
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500109Verify Error Upon Creating Same Users With Different Privileges
110 [Documentation] Verify error upon creating same users with different privileges.
111 [Tags] Verify_Error_Upon_Creating_Same_Users_With_Different_Privileges
112
113 Redfish Create User test_user TestPwd123 Administrator ${True}
114
115 # Create specified user.
116 ${payload}= Create Dictionary
117 ... UserName=test_user Password=TestPwd123 RoleId=Operator Enabled=${True}
118 Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
119 ... valid_status_codes=[${HTTP_BAD_REQUEST}]
120
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500121 Redfish.Delete ${REDFISH_ACCOUNTS_URI}test_user
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500122
123Verify Modifying User Attributes
124 [Documentation] Verify modifying user attributes.
125 [Tags] Verify_Modifying_User_Attributes
126
127 # Create Redfish users.
128 Redfish Create User admin_user TestPwd123 Administrator ${True}
129 Redfish Create User operator_user TestPwd123 Operator ${True}
130 Redfish Create User user_user TestPwd123 User ${True}
131 Redfish Create User callback_user TestPwd123 Callback ${True}
132
133 Redfish.Login
134
135 # Make sure the new user account does not already exist.
136 Redfish.Delete ${REDFISH_ACCOUNTS_URI}newadmin_user
137 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
138
139 # Update admin_user username using Redfish.
140 ${payload}= Create Dictionary UserName=newadmin_user
141 Redfish.Patch ${REDFISH_ACCOUNTS_URI}admin_user body=&{payload}
142
143 # Update operator_user password using Redfish.
144 ${payload}= Create Dictionary Password=NewTestPwd123
145 Redfish.Patch ${REDFISH_ACCOUNTS_URI}operator_user body=&{payload}
146
147 # Update user_user role using Redfish.
148 ${payload}= Create Dictionary RoleId=Operator
149 Redfish.Patch ${REDFISH_ACCOUNTS_URI}user_user body=&{payload}
150
151 # Update callback_user to disable using Redfish.
152 ${payload}= Create Dictionary Enabled=${False}
153 Redfish.Patch ${REDFISH_ACCOUNTS_URI}callback_user body=&{payload}
154
155 # Verify users after updating
156 Redfish Verify User newadmin_user TestPwd123 Administrator ${True}
157 Redfish Verify User operator_user NewTestPwd123 Operator ${True}
158 Redfish Verify User user_user TestPwd123 Operator ${True}
159 Redfish Verify User callback_user TestPwd123 Callback ${False}
160
161 # Delete created users.
162 Redfish.Delete ${REDFISH_ACCOUNTS_URI}newadmin_user
163 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
164 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
165 Redfish.Delete ${REDFISH_ACCOUNTS_URI}callback_user
166
Sandhya Somashekar37122b62019-06-18 06:02:02 -0500167Verify User Account Locked
168 [Documentation] Verify user account locked upon trying with invalid password.
169 [Tags] Verify_User_Account_Locked
170
171 Redfish Create User admin_user TestPwd123 Administrator ${True}
172
Sandhya Somashekar4737c8f2019-07-11 00:00:58 -0500173 Redfish.Logout
174
175 Redfish.Login
176
Joy Onyerikwu1483ce02019-06-26 14:56:36 -0500177 ${payload}= Create Dictionary AccountLockoutThreshold=${account_lockout_threshold}
178 ... AccountLockoutDuration=${account_lockout_duration}
179 Redfish.Patch ${REDFISH_ACCOUNTS_SERVICE_URI} body=${payload}
Sandhya Somashekar37122b62019-06-18 06:02:02 -0500180
181 # Make ${account_lockout_threshold} failed login attempts.
182 Repeat Keyword ${account_lockout_threshold} times
183 ... Run Keyword And Expect Error InvalidCredentialsError* Redfish.Login admin_user abc123
184
185 # Verify that legitimate login fails due to lockout.
186 Run Keyword And Expect Error InvalidCredentialsError*
187 ... Redfish.Login admin_user TestPwd123
188
189 # Wait for lockout duration to expire and then verify that login works.
190 Sleep ${account_lockout_duration}s
191 Redfish.Login admin_user TestPwd123
192
193 Redfish.Logout
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500194
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500195 Redfish.Login
196
197 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
198
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500199Verify Admin User Privilege
200 [Documentation] Verify admin user privilege.
201 [Tags] Verify_Admin_User_Privilege
202
203 Redfish Create User admin_user TestPwd123 Administrator ${True}
204 Redfish Create User operator_user TestPwd123 Operator ${True}
205 Redfish Create User user_user TestPwd123 User ${True}
206
207 # Change role ID of operator user with admin user.
208 # Login with admin user.
209 Redfish.Login admin_user TestPwd123
210
211 # Modify Role ID of Operator user.
212 Redfish.Patch ${REDFISH_ACCOUNTS_URI}operator_user body={'RoleId': 'Administrator'}
213
214 # Verify modified user.
215 Redfish Verify User operator_user TestPwd123 Administrator ${True}
216
217 # Change password of 'user' user with admin user.
218 Redfish.Patch ${REDFISH_ACCOUNTS_URI}user_user body={'Password': 'NewTestPwd123'}
219
220 # Verify modified user.
221 Redfish Verify User user_user NewTestPwd123 User ${True}
222
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500223 Redfish.Login
224
225 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
226 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
227 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
228
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500229Verify Operator User Privilege
230 [Documentation] Verify operator user privilege.
231 [Tags] Verify_operator_User_Privilege
232
233 Redfish Create User admin_user TestPwd123 Administrator ${True}
234 Redfish Create User operator_user TestPwd123 Operator ${True}
235
236 # Login with operator user.
237 Redfish.Login operator_user TestPwd123
238
239 # Verify power on system.
240 Redfish OBMC Reboot (off) stack_mode=normal
241
242 # Attempt to change password of admin user with operator user.
243 Redfish.Patch ${REDFISH_ACCOUNTS_URI}admin_user body={'Password': 'NewTestPwd123'}
244 ... valid_status_codes=[${HTTP_UNAUTHORIZED}]
245
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500246 Redfish.Login
247
248 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
249 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
250
251
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500252Verify 'User' User Privilege
253 [Documentation] Verify 'user' user privilege.
254 [Tags] Verify_User_User_Privilege
255
256 Redfish Create User user_user TestPwd123 User ${True}
257
258 # Read system level data.
259 ${system_model}= Redfish_Utils.Get Attribute
260 ... ${SYSTEM_BASE_URI} Model
261
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500262 Redfish.Login
263
264 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
265
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500266
Sivas SRR6aa101f2019-02-19 22:31:55 -0600267*** Keywords ***
268
269Test Setup Execution
270 [Documentation] Do test case setup tasks.
271
George Keishing97c93942019-03-04 12:45:07 -0600272 Redfish.Login
Sivas SRR6aa101f2019-02-19 22:31:55 -0600273
274
275Test Teardown Execution
276 [Documentation] Do the post test teardown.
277
Sandhya Somashekar37122b62019-06-18 06:02:02 -0500278 FFDC On Test Case Fail
George Keishing97c93942019-03-04 12:45:07 -0600279 Redfish.Logout
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600280
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500281Redfish Create User
282 [Documentation] Redfish create user.
283 [Arguments] ${username} ${password} ${role_id} ${enabled}
284
285 # Description of argument(s):
286 # username The username to be created.
287 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500288 # role_id The role ID of the user to be created
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500289 # (e.g. "Administrator", "Operator", etc.).
290 # enabled Indicates whether the username being created
291 # should be enabled (${True}, ${False}).
292
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500293 Redfish.Login
294
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500295 # Make sure the user account in question does not already exist.
296 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${userName}
297 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
298
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500299 # Create specified user.
300 ${payload}= Create Dictionary
301 ... UserName=${username} Password=${password} RoleId=${role_id} Enabled=${enabled}
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500302 Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500303 ... valid_status_codes=[${HTTP_CREATED}]
304
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500305 Redfish.Logout
306
307 # Login with created user.
308 Run Keyword If ${enabled} == False
309 ... Run Keyword And Expect Error InvalidCredentialsError*
310 ... Redfish.Login ${username} ${password}
311 ... ELSE
312 ... Redfish.Login ${username} ${password}
313
314 Run Keyword If ${enabled} == False
315 ... Redfish.Login
316
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500317 # Validate Role ID of created user.
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500318 ${role_config}= Redfish_Utils.Get Attribute
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500319 ... ${REDFISH_ACCOUNTS_URI}${username} RoleId
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500320 Should Be Equal ${role_id} ${role_config}
321
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500322
323Redfish Verify User
324 [Documentation] Redfish user verification.
325 [Arguments] ${username} ${password} ${role_id} ${enabled}
326
327 # Description of argument(s):
328 # username The username to be created.
329 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500330 # role_id The role ID of the user to be created
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500331 # (e.g. "Administrator", "Operator", etc.).
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500332 # enabled Indicates whether the username being created
333 # should be enabled (${True}, ${False}).
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500334
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500335 # Trying to do a login with created user.
336 ${status}= Run Keyword And Return Status Redfish.Login ${username} ${password}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500337
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500338 # Doing a check of the returned status.
339 Should Be Equal ${status} ${enabled}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500340
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500341 # We do not need to login with created user (user could be in disabled status).
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500342 Redfish.Login
343
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500344 # Validate Role Id of user.
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500345 ${role_config}= Redfish_Utils.Get Attribute
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500346 ... ${REDFISH_ACCOUNTS_URI}${username} RoleId
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500347 Should Be Equal ${role_id} ${role_config}
348
349
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600350Redfish Create And Verify User
351 [Documentation] Redfish create and verify user.
352 [Arguments] ${username} ${password} ${role_id} ${enabled}
353
354 # Description of argument(s):
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500355 # username The username to be created.
356 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500357 # role_id The role ID of the user to be created
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500358 # (e.g. "Administrator", "Operator", etc.).
359 # enabled Indicates whether the username being created
360 # should be enabled (${True}, ${False}).
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600361
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500362 # Example:
363 #{
364 #"@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount",
365 #"@odata.id": "/redfish/v1/AccountService/Accounts/test1",
366 #"@odata.type": "#ManagerAccount.v1_0_3.ManagerAccount",
367 #"Description": "User Account",
368 #"Enabled": true,
369 #"Id": "test1",
370 #"Links": {
371 # "Role": {
372 # "@odata.id": "/redfish/v1/AccountService/Roles/Administrator"
373 # }
374 #},
375
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500376 Redfish Create User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600377
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500378 Redfish Verify User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600379
380 # Delete Specified User
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500381 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${username}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500382
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500383Verify Redfish User with Wrong Password
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500384 [Documentation] Verify Redfish User with Wrong Password.
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500385 [Arguments] ${username} ${password} ${role_id} ${enabled} ${wrong_password}
386
387 # Description of argument(s):
388 # username The username to be created.
389 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500390 # role_id The role ID of the user to be created
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500391 # (e.g. "Administrator", "Operator", etc.).
392 # enabled Indicates whether the username being created
393 # should be enabled (${True}, ${False}).
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500394 # wrong_password Any invalid password.
395
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500396 Redfish Create User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500397
398 # Attempt to login with created user with invalid password.
399 Run Keyword And Expect Error InvalidCredentialsError*
400 ... Redfish.Login ${username} ${wrong_password}
401
402 Redfish.Login
403
404 # Delete newly created user.
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500405 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${username}
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500406
407
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500408Verify Login with Deleted Redfish User
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500409 [Documentation] Verify Login with Deleted Redfish User.
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500410 [Arguments] ${username} ${password} ${role_id} ${enabled}
411
412 # Description of argument(s):
413 # username The username to be created.
414 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500415 # role_id The role ID of the user to be created
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500416 # (e.g. "Administrator", "Operator", etc.).
417 # enabled Indicates whether the username being created
418 # should be enabled (${True}, ${False}).
419
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500420 Redfish Create User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500421 ${status}= Run Keyword And Return Status Redfish.Login ${username} ${password}
422
423 # Doing a check of the rerurned status
424 Should Be Equal ${status} ${True}
425
426 Redfish.Login
427
428 # Delete newly created user.
429 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${userName}
430
431 # Attempt to login with deleted user account.
432 Run Keyword And Expect Error InvalidCredentialsError*
433 ... Redfish.Login ${username} ${password}
434
435 Redfish.Login
436
437Verify Create User Without Enabling
438 [Documentation] Verify Create User Without Enabling.
439 [Arguments] ${username} ${password} ${role_id} ${enabled}
440
441 # Description of argument(s):
442 # username The username to be created.
443 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500444 # role_id The role ID of the user to be created
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500445 # (e.g. "Administrator", "Operator", etc.).
446 # enabled Indicates whether the username being created
447 # should be enabled (${True}, ${False}).
448
449 Redfish.Login
450
451 Redfish Create User ${username} ${password} ${role_id} ${enabled}
452
453 Redfish.Logout
454
455 # Login with created user.
456 Run Keyword And Expect Error InvalidCredentialsError*
457 ... Redfish.Login ${username} ${password}
458
459 Redfish.Login
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500460
461 # Delete newly created user.
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500462 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${username}