blob: 51982c08d3c10a8450ad0ee77b4ba7c649aac952 [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 Somashekara83fb472019-08-29 02:26:21 -050026Verify Redfish User Persistence After Reboot
27 [Documentation] Verify Redfish user persistence after reboot.
28 [Tags] Verify_Redfish_User_Persistence_After_Reboot
29
30 # Create Redfish users.
31 Redfish Create User admin_user TestPwd123 Administrator ${True}
32 Redfish Create User operator_user TestPwd123 Operator ${True}
33 Redfish Create User user_user TestPwd123 User ${True}
34 Redfish Create User callback_user TestPwd123 Callback ${True}
35
36 # Reboot BMC.
37 Redfish OBMC Reboot (off) stack_mode=normal
38 Redfish.Login
39
40 # Verify users after reboot.
41 Redfish Verify User admin_user TestPwd123 Administrator ${True}
42 Redfish Verify User operator_user TestPwd123 Operator ${True}
43 Redfish Verify User user_user TestPwd123 User ${True}
44 Redfish Verify User callback_user TestPwd123 Callback ${True}
45
46 # Delete created users.
47 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
48 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
49 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
50 Redfish.Delete ${REDFISH_ACCOUNTS_URI}callback_user
51
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -060052Redfish Create and Verify Users
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050053 [Documentation] Create Redfish users with various roles.
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -060054 [Tags] Redfish_Create_and_Verify_Users
55 [Template] Redfish Create And Verify User
56
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050057 #username password role_id enabled
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050058 admin_user TestPwd123 Administrator ${True}
59 operator_user TestPwd123 Operator ${True}
60 user_user TestPwd123 User ${True}
61 callback_user TestPwd123 Callback ${True}
Sivas SRR6aa101f2019-02-19 22:31:55 -060062
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050063Verify Redfish User with Wrong Password
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050064 [Documentation] Verify Redfish User with Wrong Password.
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050065 [Tags] Verify_Redfish_User_with_Wrong_Password
66 [Template] Verify Redfish User with Wrong Password
67
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050068 #username password role_id enabled wrong_password
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050069 admin_user TestPwd123 Administrator ${True} alskjhfwurh
70 operator_user TestPwd123 Operator ${True} 12j8a8uakjhdaosiruf024
71 user_user TestPwd123 User ${True} 12
72 callback_user TestPwd123 Callback ${True} !#@D#RF#@!D
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050073
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -050074Verify Login with Deleted Redfish Users
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050075 [Documentation] Verify login with deleted Redfish Users.
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -050076 [Tags] Verify_Login_with_Deleted_Redfish_Users
77 [Template] Verify Login with Deleted Redfish User
78
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050079 #username password role_id enabled
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050080 admin_user TestPwd123 Administrator ${True}
81 operator_user TestPwd123 Operator ${True}
82 user_user TestPwd123 User ${True}
83 callback_user TestPwd123 Callback ${True}
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -050084
George Keishinge0c5ec32019-06-13 09:45:29 -050085Verify User Creation Without Enabling It
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050086 [Documentation] Verify User Creation Without Enabling it.
George Keishinge0c5ec32019-06-13 09:45:29 -050087 [Tags] Verify_User_Creation_Without_Enabling_It
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050088 [Template] Verify Create User Without Enabling
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050089
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050090 #username password role_id enabled
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -050091 admin_user TestPwd123 Administrator ${False}
92 operator_user TestPwd123 Operator ${False}
93 user_user TestPwd123 User ${False}
94 callback_user TestPwd123 Callback ${False}
95
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -050096
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050097Verify User Creation With Invalid Role Id
Sandhya Somashekard7d46c02019-06-26 05:10:25 -050098 [Documentation] Verify user creation with invalid role ID.
Sandhya Somashekare92b1e62019-04-25 05:27:45 -050099 [Tags] Verify_User_Creation_With_Invalid_Role_Id
100
101 # Make sure the user account in question does not already exist.
102 Redfish.Delete ${REDFISH_ACCOUNTS_URI}test_user
103 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
104
105 # Create specified user.
106 ${payload}= Create Dictionary
107 ... UserName=test_user Password=TestPwd123 RoleId=wrongroleid Enabled=${True}
108 Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
109 ... valid_status_codes=[${HTTP_BAD_REQUEST}]
110
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500111Verify Error Upon Creating Same Users With Different Privileges
112 [Documentation] Verify error upon creating same users with different privileges.
113 [Tags] Verify_Error_Upon_Creating_Same_Users_With_Different_Privileges
114
115 Redfish Create User test_user TestPwd123 Administrator ${True}
116
117 # Create specified user.
118 ${payload}= Create Dictionary
119 ... UserName=test_user Password=TestPwd123 RoleId=Operator Enabled=${True}
120 Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
121 ... valid_status_codes=[${HTTP_BAD_REQUEST}]
122
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500123 Redfish.Delete ${REDFISH_ACCOUNTS_URI}test_user
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500124
125Verify Modifying User Attributes
126 [Documentation] Verify modifying user attributes.
127 [Tags] Verify_Modifying_User_Attributes
128
129 # Create Redfish users.
130 Redfish Create User admin_user TestPwd123 Administrator ${True}
131 Redfish Create User operator_user TestPwd123 Operator ${True}
132 Redfish Create User user_user TestPwd123 User ${True}
133 Redfish Create User callback_user TestPwd123 Callback ${True}
134
135 Redfish.Login
136
137 # Make sure the new user account does not already exist.
138 Redfish.Delete ${REDFISH_ACCOUNTS_URI}newadmin_user
139 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
140
141 # Update admin_user username using Redfish.
142 ${payload}= Create Dictionary UserName=newadmin_user
143 Redfish.Patch ${REDFISH_ACCOUNTS_URI}admin_user body=&{payload}
144
145 # Update operator_user password using Redfish.
146 ${payload}= Create Dictionary Password=NewTestPwd123
147 Redfish.Patch ${REDFISH_ACCOUNTS_URI}operator_user body=&{payload}
148
149 # Update user_user role using Redfish.
150 ${payload}= Create Dictionary RoleId=Operator
151 Redfish.Patch ${REDFISH_ACCOUNTS_URI}user_user body=&{payload}
152
153 # Update callback_user to disable using Redfish.
154 ${payload}= Create Dictionary Enabled=${False}
155 Redfish.Patch ${REDFISH_ACCOUNTS_URI}callback_user body=&{payload}
156
157 # Verify users after updating
158 Redfish Verify User newadmin_user TestPwd123 Administrator ${True}
159 Redfish Verify User operator_user NewTestPwd123 Operator ${True}
160 Redfish Verify User user_user TestPwd123 Operator ${True}
161 Redfish Verify User callback_user TestPwd123 Callback ${False}
162
163 # Delete created users.
164 Redfish.Delete ${REDFISH_ACCOUNTS_URI}newadmin_user
165 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
166 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
167 Redfish.Delete ${REDFISH_ACCOUNTS_URI}callback_user
168
Sandhya Somashekar37122b62019-06-18 06:02:02 -0500169Verify User Account Locked
170 [Documentation] Verify user account locked upon trying with invalid password.
171 [Tags] Verify_User_Account_Locked
172
173 Redfish Create User admin_user TestPwd123 Administrator ${True}
174
Sandhya Somashekar4737c8f2019-07-11 00:00:58 -0500175 Redfish.Logout
176
177 Redfish.Login
178
Joy Onyerikwu1483ce02019-06-26 14:56:36 -0500179 ${payload}= Create Dictionary AccountLockoutThreshold=${account_lockout_threshold}
180 ... AccountLockoutDuration=${account_lockout_duration}
181 Redfish.Patch ${REDFISH_ACCOUNTS_SERVICE_URI} body=${payload}
Sandhya Somashekar37122b62019-06-18 06:02:02 -0500182
183 # Make ${account_lockout_threshold} failed login attempts.
184 Repeat Keyword ${account_lockout_threshold} times
185 ... Run Keyword And Expect Error InvalidCredentialsError* Redfish.Login admin_user abc123
186
187 # Verify that legitimate login fails due to lockout.
188 Run Keyword And Expect Error InvalidCredentialsError*
189 ... Redfish.Login admin_user TestPwd123
190
191 # Wait for lockout duration to expire and then verify that login works.
192 Sleep ${account_lockout_duration}s
193 Redfish.Login admin_user TestPwd123
194
195 Redfish.Logout
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500196
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500197 Redfish.Login
198
199 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
200
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500201Verify Admin User Privilege
202 [Documentation] Verify admin user privilege.
203 [Tags] Verify_Admin_User_Privilege
204
205 Redfish Create User admin_user TestPwd123 Administrator ${True}
206 Redfish Create User operator_user TestPwd123 Operator ${True}
207 Redfish Create User user_user TestPwd123 User ${True}
208
209 # Change role ID of operator user with admin user.
210 # Login with admin user.
211 Redfish.Login admin_user TestPwd123
212
213 # Modify Role ID of Operator user.
214 Redfish.Patch ${REDFISH_ACCOUNTS_URI}operator_user body={'RoleId': 'Administrator'}
215
216 # Verify modified user.
217 Redfish Verify User operator_user TestPwd123 Administrator ${True}
218
219 # Change password of 'user' user with admin user.
220 Redfish.Patch ${REDFISH_ACCOUNTS_URI}user_user body={'Password': 'NewTestPwd123'}
221
222 # Verify modified user.
223 Redfish Verify User user_user NewTestPwd123 User ${True}
224
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500225 Redfish.Login
226
227 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
228 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
229 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
230
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500231Verify Operator User Privilege
232 [Documentation] Verify operator user privilege.
233 [Tags] Verify_operator_User_Privilege
234
235 Redfish Create User admin_user TestPwd123 Administrator ${True}
236 Redfish Create User operator_user TestPwd123 Operator ${True}
237
238 # Login with operator user.
239 Redfish.Login operator_user TestPwd123
240
241 # Verify power on system.
242 Redfish OBMC Reboot (off) stack_mode=normal
243
244 # Attempt to change password of admin user with operator user.
245 Redfish.Patch ${REDFISH_ACCOUNTS_URI}admin_user body={'Password': 'NewTestPwd123'}
246 ... valid_status_codes=[${HTTP_UNAUTHORIZED}]
247
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500248 Redfish.Login
249
250 Redfish.Delete ${REDFISH_ACCOUNTS_URI}admin_user
251 Redfish.Delete ${REDFISH_ACCOUNTS_URI}operator_user
252
253
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500254Verify 'User' User Privilege
255 [Documentation] Verify 'user' user privilege.
256 [Tags] Verify_User_User_Privilege
257
258 Redfish Create User user_user TestPwd123 User ${True}
259
260 # Read system level data.
261 ${system_model}= Redfish_Utils.Get Attribute
262 ... ${SYSTEM_BASE_URI} Model
263
Sandhya Somashekar7a237472019-07-15 02:06:39 -0500264 Redfish.Login
265
266 Redfish.Delete ${REDFISH_ACCOUNTS_URI}user_user
267
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500268
Sivas SRR6aa101f2019-02-19 22:31:55 -0600269*** Keywords ***
270
271Test Setup Execution
272 [Documentation] Do test case setup tasks.
273
George Keishing97c93942019-03-04 12:45:07 -0600274 Redfish.Login
Sivas SRR6aa101f2019-02-19 22:31:55 -0600275
276
277Test Teardown Execution
278 [Documentation] Do the post test teardown.
279
Sandhya Somashekar37122b62019-06-18 06:02:02 -0500280 FFDC On Test Case Fail
George Keishing97c93942019-03-04 12:45:07 -0600281 Redfish.Logout
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600282
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500283Redfish Create User
284 [Documentation] Redfish create user.
285 [Arguments] ${username} ${password} ${role_id} ${enabled}
286
287 # Description of argument(s):
288 # username The username to be created.
289 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500290 # role_id The role ID of the user to be created
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500291 # (e.g. "Administrator", "Operator", etc.).
292 # enabled Indicates whether the username being created
293 # should be enabled (${True}, ${False}).
294
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500295 Redfish.Login
296
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500297 # Make sure the user account in question does not already exist.
298 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${userName}
299 ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}]
300
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500301 # Create specified user.
302 ${payload}= Create Dictionary
303 ... UserName=${username} Password=${password} RoleId=${role_id} Enabled=${enabled}
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500304 Redfish.Post ${REDFISH_ACCOUNTS_URI} body=&{payload}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500305 ... valid_status_codes=[${HTTP_CREATED}]
306
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500307 Redfish.Logout
308
309 # Login with created user.
George Keishing4916b462019-08-08 23:24:48 -0500310 Run Keyword If ${enabled} == ${False}
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500311 ... Run Keyword And Expect Error InvalidCredentialsError*
312 ... Redfish.Login ${username} ${password}
313 ... ELSE
314 ... Redfish.Login ${username} ${password}
315
Sandhya Somashekara83fb472019-08-29 02:26:21 -0500316 Run Keyword If ${enabled} == ${False}
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500317 ... Redfish.Login
318
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500319 # Validate Role ID of created user.
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500320 ${role_config}= Redfish_Utils.Get Attribute
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500321 ... ${REDFISH_ACCOUNTS_URI}${username} RoleId
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500322 Should Be Equal ${role_id} ${role_config}
323
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500324
325Redfish Verify User
326 [Documentation] Redfish user verification.
327 [Arguments] ${username} ${password} ${role_id} ${enabled}
328
329 # Description of argument(s):
330 # username The username to be created.
331 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500332 # role_id The role ID of the user to be created
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500333 # (e.g. "Administrator", "Operator", etc.).
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500334 # enabled Indicates whether the username being created
335 # should be enabled (${True}, ${False}).
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500336
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500337 # Trying to do a login with created user.
338 ${status}= Run Keyword And Return Status Redfish.Login ${username} ${password}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500339
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500340 # Doing a check of the returned status.
341 Should Be Equal ${status} ${enabled}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500342
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500343 # We do not need to login with created user (user could be in disabled status).
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500344 Redfish.Login
345
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500346 # Validate Role Id of user.
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500347 ${role_config}= Redfish_Utils.Get Attribute
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500348 ... ${REDFISH_ACCOUNTS_URI}${username} RoleId
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500349 Should Be Equal ${role_id} ${role_config}
350
351
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600352Redfish Create And Verify User
353 [Documentation] Redfish create and verify user.
354 [Arguments] ${username} ${password} ${role_id} ${enabled}
355
356 # Description of argument(s):
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500357 # username The username to be created.
358 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500359 # role_id The role ID of the user to be created
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500360 # (e.g. "Administrator", "Operator", etc.).
361 # enabled Indicates whether the username being created
362 # should be enabled (${True}, ${False}).
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600363
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500364 # Example:
365 #{
366 #"@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount",
367 #"@odata.id": "/redfish/v1/AccountService/Accounts/test1",
368 #"@odata.type": "#ManagerAccount.v1_0_3.ManagerAccount",
369 #"Description": "User Account",
370 #"Enabled": true,
371 #"Id": "test1",
372 #"Links": {
373 # "Role": {
374 # "@odata.id": "/redfish/v1/AccountService/Roles/Administrator"
375 # }
376 #},
377
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500378 Redfish Create User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600379
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500380 Redfish Verify User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekar00f59cc2019-03-05 03:39:47 -0600381
382 # Delete Specified User
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500383 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${username}
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500384
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500385Verify Redfish User with Wrong Password
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500386 [Documentation] Verify Redfish User with Wrong Password.
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500387 [Arguments] ${username} ${password} ${role_id} ${enabled} ${wrong_password}
388
389 # Description of argument(s):
390 # username The username to be created.
391 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500392 # role_id The role ID of the user to be created
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500393 # (e.g. "Administrator", "Operator", etc.).
394 # enabled Indicates whether the username being created
395 # should be enabled (${True}, ${False}).
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500396 # wrong_password Any invalid password.
397
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500398 Redfish Create User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500399
400 # Attempt to login with created user with invalid password.
401 Run Keyword And Expect Error InvalidCredentialsError*
402 ... Redfish.Login ${username} ${wrong_password}
403
404 Redfish.Login
405
406 # Delete newly created user.
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500407 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${username}
Sandhya Somashekar33aa48c2019-03-13 05:54:49 -0500408
409
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500410Verify Login with Deleted Redfish User
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500411 [Documentation] Verify Login with Deleted Redfish User.
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500412 [Arguments] ${username} ${password} ${role_id} ${enabled}
413
414 # Description of argument(s):
415 # username The username to be created.
416 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500417 # role_id The role ID of the user to be created
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500418 # (e.g. "Administrator", "Operator", etc.).
419 # enabled Indicates whether the username being created
420 # should be enabled (${True}, ${False}).
421
Sandhya Somashekaraa280aa2019-04-01 04:15:06 -0500422 Redfish Create User ${username} ${password} ${role_id} ${enabled}
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500423 ${status}= Run Keyword And Return Status Redfish.Login ${username} ${password}
424
425 # Doing a check of the rerurned status
426 Should Be Equal ${status} ${True}
427
428 Redfish.Login
429
430 # Delete newly created user.
431 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${userName}
432
433 # Attempt to login with deleted user account.
434 Run Keyword And Expect Error InvalidCredentialsError*
435 ... Redfish.Login ${username} ${password}
436
437 Redfish.Login
438
439Verify Create User Without Enabling
440 [Documentation] Verify Create User Without Enabling.
441 [Arguments] ${username} ${password} ${role_id} ${enabled}
442
443 # Description of argument(s):
444 # username The username to be created.
445 # password The password to be assigned.
Sandhya Somashekard7d46c02019-06-26 05:10:25 -0500446 # role_id The role ID of the user to be created
Sandhya Somashekare92b1e62019-04-25 05:27:45 -0500447 # (e.g. "Administrator", "Operator", etc.).
448 # enabled Indicates whether the username being created
449 # should be enabled (${True}, ${False}).
450
451 Redfish.Login
452
453 Redfish Create User ${username} ${password} ${role_id} ${enabled}
454
455 Redfish.Logout
456
457 # Login with created user.
458 Run Keyword And Expect Error InvalidCredentialsError*
459 ... Redfish.Login ${username} ${password}
460
461 Redfish.Login
Sandhya Somashekaraf402ca2019-03-18 05:59:19 -0500462
463 # Delete newly created user.
Sandhya Somashekar8c5b2492019-05-16 05:19:03 -0500464 Redfish.Delete ${REDFISH_ACCOUNTS_URI}${username}