blob: bb22b0dfe5cd19bd985f20d8faaf8862fdd16b50 [file] [log] [blame]
Sivas SRR7d7bae32019-05-29 00:31:14 -05001*** Settings ***
2Documentation Test Redfish LDAP user configuration.
Sivas SRR73379bc2019-07-22 10:21:45 -05003
Sivas SRRd21c9842019-06-21 05:41:18 -05004Library ../../lib/gen_robot_valid.py
Sivas SRR7d7bae32019-05-29 00:31:14 -05005Resource ../../lib/resource.robot
6Resource ../../lib/bmc_redfish_resource.robot
7Resource ../../lib/openbmc_ffdc.robot
Sivas SRRf4ec6492019-06-16 01:59:30 -05008Library ../../lib/gen_robot_valid.py
Prashanth Katti3dc8cc32020-03-04 11:11:01 -06009Resource ../../lib/bmc_network_utils.robot
Sivas SRR7d7bae32019-05-29 00:31:14 -050010
11Suite Setup Suite Setup Execution
Sivas SRR939b4b12019-06-26 00:01:59 -050012Suite Teardown Run Keywords Restore LDAP Privilege AND Redfish.Logout
Sivas SRRf4ec6492019-06-16 01:59:30 -050013Test Teardown FFDC On Test Case Fail
Sivas SRR7d7bae32019-05-29 00:31:14 -050014
Sivas SRR9358b5c2019-06-06 04:57:03 -050015Force Tags LDAP_Test
16
Sivas SRRf4ec6492019-06-16 01:59:30 -050017*** Variables ***
Sivas SRR873de8e2019-09-26 00:37:53 -050018${old_ldap_privilege} ${EMPTY}
Sivas SRRd21c9842019-06-21 05:41:18 -050019&{old_account_service} &{EMPTY}
Sivas SRR873de8e2019-09-26 00:37:53 -050020&{old_ldap_config} &{EMPTY}
21${hostname} ${EMPTY}
Prashanth Katti3dc8cc32020-03-04 11:11:01 -060022${test_ip} 10.6.6.6
23${test_mask} 255.255.255.0
24${test_gw} 10.6.6.1
Sivas SRRf4ec6492019-06-16 01:59:30 -050025
Sivas SRR7d7bae32019-05-29 00:31:14 -050026** Test Cases **
27
Sivas SRRb1b85752019-07-04 01:28:28 -050028Verify LDAP Configuration Created
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050029 [Documentation] Verify that LDAP configuration created.
Sivas SRRb1b85752019-07-04 01:28:28 -050030 [Tags] Verify_LDAP_Configuration_Created
31
32 Create LDAP Configuration
33 # Call 'Get LDAP Configuration' to verify that LDAP configuration exists.
34 Get LDAP Configuration ${LDAP_TYPE}
35 Sleep 10s
36 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
37 Redfish.Logout
38 Redfish.Login
39
40
41Verify LDAP Service Disable
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050042 [Documentation] Verify that LDAP is disabled and that LDAP user cannot
43 ... login.
Sivas SRRb1b85752019-07-04 01:28:28 -050044 [Tags] Verify_LDAP_Service_Disable
45
46 Redfish.Patch ${REDFISH_BASE_URI}AccountService
47 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${False}}}
48 Sleep 15s
49 ${resp}= Run Keyword And Return Status Redfish.Login ${LDAP_USER}
50 ... ${LDAP_USER_PASSWORD}
George Keishing333bb722019-12-11 11:40:49 -060051 Should Be Equal ${resp} ${False}
52 ... msg=LDAP user was able to login even though the LDAP service was disabled.
Sivas SRRb1b85752019-07-04 01:28:28 -050053 Redfish.Logout
54 Redfish.Login
55 # Enabling LDAP so that LDAP user works.
56 Redfish.Patch ${REDFISH_BASE_URI}AccountService
57 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}}
58 Redfish.Logout
59 Redfish.Login
60
61
Sivas SRR73379bc2019-07-22 10:21:45 -050062Verify LDAP Login With ServiceEnabled
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050063 [Documentation] Verify that LDAP Login with ServiceEnabled.
Sivas SRR73379bc2019-07-22 10:21:45 -050064 [Tags] Verify_LDAP_Login_With_ServiceEnabled
65
66 Disable Other LDAP
67 # Actual service enablement.
68 Redfish.Patch ${REDFISH_BASE_URI}AccountService
69 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}}
70 Sleep 15s
71 # After update, LDAP login.
72 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
73 Redfish.Logout
74 Redfish.Login
75
76
77Verify LDAP Login With Correct AuthenticationType
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050078 [Documentation] Verify that LDAP Login with right AuthenticationType.
Sivas SRR73379bc2019-07-22 10:21:45 -050079 [Tags] Verify_LDAP_Login_With_Correct_AuthenticationType
80
81 Redfish.Patch ${REDFISH_BASE_URI}AccountService
82 ... body={'${ldap_type}': {'Authentication': {'AuthenticationType':'UsernameAndPassword'}}}
83 Sleep 15s
84 # After update, LDAP login.
85 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
86 Redfish.Logout
87 Redfish.Login
88
89
90Verify LDAP Config Update With Incorrect AuthenticationType
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050091 [Documentation] Verify that invalid AuthenticationType is not updated.
Sivas SRR73379bc2019-07-22 10:21:45 -050092 [Tags] Verify_LDAP_Update_With_Incorrect_AuthenticationType
93
George Keishing2d0804e2019-12-12 22:27:05 -060094 ${body}= Catenate {'${ldap_type}': {'Authentication': {'AuthenticationType':'KerberosKeytab'}}}
Prashanth Katti7d38a092020-01-10 06:01:09 -060095
Sivas SRR73379bc2019-07-22 10:21:45 -050096 Redfish.Patch ${REDFISH_BASE_URI}AccountService
Prashanth Katti7d38a092020-01-10 06:01:09 -060097 ... body=${body} valid_status_codes=[400]
Sivas SRR73379bc2019-07-22 10:21:45 -050098
99
100Verify LDAP Login With Correct LDAP URL
101 [Documentation] Verify LDAP Login with right LDAP URL.
102 [Tags] Verify_LDAP_Login_With_Correct_LDAP_URL
103
104 Config LDAP URL ${LDAP_SERVER_URI}
105
106
107Verify LDAP Config Update With Incorrect LDAP URL
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500108 [Documentation] Verify that LDAP Login fails with invalid LDAP URL.
Sivas SRR73379bc2019-07-22 10:21:45 -0500109 [Tags] Verify_LDAP_Config_Update_With_Incorrect_LDAP_URL
110 [Teardown] Run Keywords Restore LDAP URL AND
111 ... FFDC On Test Case Fail
112
Prashanth Katti7d38a092020-01-10 06:01:09 -0600113 Config LDAP URL ldap://1.2.3.4/ ${FALSE}
Sivas SRR73379bc2019-07-22 10:21:45 -0500114
Sivas SRR7d7bae32019-05-29 00:31:14 -0500115Verify LDAP Configuration Exist
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500116 [Documentation] Verify that LDAP configuration is available.
Sivas SRR7d7bae32019-05-29 00:31:14 -0500117 [Tags] Verify_LDAP_Configuration_Exist
Sivas SRR73379bc2019-07-22 10:21:45 -0500118
Sivas SRR7d7bae32019-05-29 00:31:14 -0500119 ${resp}= Redfish.Get Attribute ${REDFISH_BASE_URI}AccountService
120 ... ${LDAP_TYPE} default=${EMPTY}
121 Should Not Be Empty ${resp} msg=LDAP configuration is not defined.
122
123
124Verify LDAP User Login
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500125 [Documentation] Verify that LDAP user able to login into BMC.
Sivas SRR7d7bae32019-05-29 00:31:14 -0500126 [Tags] Verify_LDAP_User_Login
Sivas SRR73379bc2019-07-22 10:21:45 -0500127
128 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
Sivas SRR939b4b12019-06-26 00:01:59 -0500129 Redfish.Logout
130 Redfish.Login
Sivas SRR7d7bae32019-05-29 00:31:14 -0500131
132
133Verify LDAP Service Available
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500134 [Documentation] Verify that LDAP service is available.
Sivas SRR7d7bae32019-05-29 00:31:14 -0500135 [Tags] Verify_LDAP_Service_Available
Sivas SRR73379bc2019-07-22 10:21:45 -0500136
Sivas SRR7d7bae32019-05-29 00:31:14 -0500137 @{ldap_configuration}= Get LDAP Configuration ${LDAP_TYPE}
138 Should Contain ${ldap_configuration} LDAPService
139 ... msg=LDAPService is not available.
140
141
Sivas SRR108f9d32019-06-03 10:05:34 -0500142Verify LDAP Login Works After BMC Reboot
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500143 [Documentation] Verify that LDAP login works after BMC reboot.
Sivas SRR108f9d32019-06-03 10:05:34 -0500144 [Tags] Verify_LDAP_Login_Works_After_BMC_Reboot
Sivas SRR73379bc2019-07-22 10:21:45 -0500145
Sivas SRR108f9d32019-06-03 10:05:34 -0500146 Redfish OBMC Reboot (off)
147 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
148 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500149 Redfish.Login
Sivas SRR108f9d32019-06-03 10:05:34 -0500150
151
152Verify LDAP User With Admin Privilege Able To Do BMC Reboot
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500153 [Documentation] Verify that LDAP user with administrator privilege able to do BMC reboot.
Sivas SRR108f9d32019-06-03 10:05:34 -0500154 [Tags] Verify_LDAP_User_With_Admin_Privilege_Able_To_Do_BMC_Reboot
155
Sivas SRR73379bc2019-07-22 10:21:45 -0500156
Sivas SRR108f9d32019-06-03 10:05:34 -0500157 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
158 ... ${GROUP_PRIVILEGE} ${GROUP_NAME}
159 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
160 # With LDAP user and with right privilege trying to do BMC reboot.
161 Redfish OBMC Reboot (off)
162 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
163 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500164 Redfish.Login
Sivas SRR108f9d32019-06-03 10:05:34 -0500165
166
Sivas SRR2b83ec02019-07-12 11:30:20 -0500167Verify LDAP User With Operator Privilege Able To Do Host Poweroff
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500168 [Documentation] Verify that LDAP user with operator privilege can do host
169 ... power off.
Sivas SRR2b83ec02019-07-12 11:30:20 -0500170 [Tags] Verify_LDAP_User_With_Operator_Privilege_Able_To_Do_Host_Poweroff
Sivas SRRf4ec6492019-06-16 01:59:30 -0500171 [Teardown] Restore LDAP Privilege
172
Sivas SRRf4ec6492019-06-16 01:59:30 -0500173 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
174 ... Operator ${GROUP_NAME}
Sivas SRRf4ec6492019-06-16 01:59:30 -0500175
Sivas SRRf4ec6492019-06-16 01:59:30 -0500176 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
Sivas SRR2b83ec02019-07-12 11:30:20 -0500177 # Verify that the LDAP user with operator privilege is able to power the system off.
178 Redfish.Post ${REDFISH_POWER_URI}
Sivas SRR3d82b3c2019-07-12 12:20:04 -0500179 ... body={'ResetType': 'ForceOff'} valid_status_codes=[200]
Sivas SRRf4ec6492019-06-16 01:59:30 -0500180 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500181 Redfish.Login
Sivas SRRf4ec6492019-06-16 01:59:30 -0500182
183
Sivas SRRd21c9842019-06-21 05:41:18 -0500184Verify AccountLockout Attributes Set To Zero
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500185 [Documentation] Verify that attribute AccountLockoutDuration and
Sivas SRRd21c9842019-06-21 05:41:18 -0500186 ... AccountLockoutThreshold are set to 0.
187 [Teardown] Run Keywords Restore AccountLockout Attributes AND
188 ... FFDC On Test Case Fail
189 [Tags] Verify_AccountLockout_Attributes_Set_To_Zero
Sivas SRR73379bc2019-07-22 10:21:45 -0500190
Sivas SRRd21c9842019-06-21 05:41:18 -0500191 ${old_account_service}= Redfish.Get Properties
192 ... ${REDFISH_BASE_URI}AccountService
Michael Walsh39c00512019-07-17 10:54:06 -0500193 Rprint Vars old_account_service
Sivas SRRd21c9842019-06-21 05:41:18 -0500194 Redfish.Patch ${REDFISH_BASE_URI}AccountService
195 ... body=[('AccountLockoutDuration', 0)]
196 Redfish.Patch ${REDFISH_BASE_URI}AccountService
197 ... body=[('AccountLockoutThreshold', 0)]
198
199
Sivas SRR939b4b12019-06-26 00:01:59 -0500200Verify LDAP User With Read Privilege Able To Check Inventory
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500201 [Documentation] Verify that LDAP user with read privilege able to
Sivas SRR939b4b12019-06-26 00:01:59 -0500202 ... read firmware inventory.
203 [Tags] Verify_LDAP_User_With_Read_Privilege_Able_To_Check_Inventory
204 [Teardown] Run Keywords FFDC On Test Case Fail AND Restore LDAP Privilege
205 [Template] Set Read Privilege And Check Firmware Inventory
206
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600207 ReadOnly
Sivas SRR939b4b12019-06-26 00:01:59 -0500208
209
210Verify LDAP User With Read Privilege Should Not Do Host Poweron
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500211 [Documentation] Verify that LDAP user with read privilege should not be
Sivas SRR939b4b12019-06-26 00:01:59 -0500212 ... allowed to power on the host.
213 [Tags] Verify_LDAP_User_With_Read_Privilege_Should_Not_Do_Host_Poweron
214 [Teardown] Run Keywords FFDC On Test Case Fail AND Restore LDAP Privilege
215 [Template] Set Read Privilege And Check Poweron
216
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600217 ReadOnly
Sivas SRR939b4b12019-06-26 00:01:59 -0500218
219
Sivas SRRe9a47862019-08-05 07:13:43 -0500220Update LDAP Group Name And Verify Operations
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500221 [Documentation] Verify that LDAP group name update and able to do right
222 ... operations.
Sivas SRRe9a47862019-08-05 07:13:43 -0500223 [Tags] Update_LDAP_Group_Name_And_Verify_Operations
224 [Template] Update LDAP Config And Verify Set Host Name
225 [Teardown] Restore LDAP Privilege
226
227 # group_name group_privilege valid_status_codes
228 ${GROUP_NAME} Administrator [${HTTP_OK}]
229 ${GROUP_NAME} Operator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600230 ${GROUP_NAME} ReadOnly [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
231 ${GROUP_NAME} NoAccess [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Sivas SRRe9a47862019-08-05 07:13:43 -0500232 Invalid_LDAP_Group_Name Administrator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
233 Invalid_LDAP_Group_Name Operator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600234 Invalid_LDAP_Group_Name ReadOnly [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
235 Invalid_LDAP_Group_Name NoAccess [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Sivas SRRe9a47862019-08-05 07:13:43 -0500236
237
Sivas SRRa031d2d2019-08-16 07:49:52 -0500238Verify LDAP BaseDN Update And LDAP Login
239 [Documentation] Update LDAP BaseDN of LDAP configuration and verify
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500240 ... that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500241 [Tags] Verify_LDAP_BaseDN_Update_And_LDAP_Login
242
243
244 ${body}= Catenate {'${LDAP_TYPE}': { 'LDAPService': {'SearchSettings':
245 ... {'BaseDistinguishedNames': ['${LDAP_BASE_DN}']}}}}
246 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
247 Sleep 15s
248 Redfish Verify LDAP Login
249
250
251Verify LDAP BindDN Update And LDAP Login
252 [Documentation] Update LDAP BindDN of LDAP configuration and verify
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500253 ... that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500254 [Tags] Verify_LDAP_BindDN_Update_And_LDAP_Login
255
256 ${body}= Catenate {'${LDAP_TYPE}': { 'Authentication':
257 ... {'AuthenticationType':'UsernameAndPassword', 'Username':
258 ... '${LDAP_BIND_DN}'}}}
259 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
260 Sleep 15s
261 Redfish Verify LDAP Login
262
263
264Verify LDAP BindDN Password Update And LDAP Login
265 [Documentation] Update LDAP BindDN password of LDAP configuration and
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500266 ... verify that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500267 [Tags] Verify_LDAP_BindDN_Passsword_Update_And_LDAP_Login
268
269
270 ${body}= Catenate {'${LDAP_TYPE}': { 'Authentication':
271 ... {'AuthenticationType':'UsernameAndPassword', 'Password':
272 ... '${LDAP_BIND_DN_PASSWORD}'}}}
273 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
274 Sleep 15s
275 Redfish Verify LDAP Login
276
277
278Verify LDAP Type Update And LDAP Login
279 [Documentation] Update LDAP type of LDAP configuration and verify
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500280 ... that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500281 [Tags] Verify_LDAP_Type_Update_And_LDAP_Login
282
283 Disable Other LDAP
284 Redfish.Patch ${REDFISH_BASE_URI}AccountService
285 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}}
286 Sleep 15s
287 Redfish Verify LDAP Login
288
289
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500290Verify Authorization With Null Privilege
291 [Documentation] Verify the failure of LDAP authorization with empty
292 ... privilege.
293 [Tags] Verify_LDAP_Authorization_With_Null_Privilege
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500294 [Teardown] Restore LDAP Privilege
295
296 Update LDAP Config And Verify Set Host Name ${GROUP_NAME} ${EMPTY}
297 ... [${HTTP_FORBIDDEN}]
298
299
300Verify Authorization With Invalid Privilege
301 [Documentation] Verify that LDAP user authorization with wrong privilege
302 ... fails.
303 [Tags] Verify_LDAP_Authorization_With_Invalid_Privilege
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500304 [Teardown] Restore LDAP Privilege
305
306 Update LDAP Config And Verify Set Host Name ${GROUP_NAME}
307 ... Invalid_Privilege [${HTTP_FORBIDDEN}]
308
309
310Verify LDAP Login With Invalid Data
311 [Documentation] Verify that LDAP login with Invalid LDAP data and
312 ... right LDAP user fails.
313 [Tags] Verify_LDAP_Login_With_Invalid_Data
314 [Teardown] Run Keywords FFDC On Test Case Fail AND
315 ... Create LDAP Configuration
316
317 Create LDAP Configuration ${LDAP_TYPE} Invalid_LDAP_Server_URI
318 ... Invalid_LDAP_BIND_DN LDAP_BIND_DN_PASSWORD
319 ... Invalid_LDAP_BASE_DN
320 Sleep 15s
321 Redfish Verify LDAP Login ${False}
322
323
324Verify LDAP Config Creation Without BASE_DN
325 [Documentation] Verify that LDAP login with LDAP configuration
326 ... created without BASE_DN fails.
327 [Tags] Verify_LDAP_Config_Creation_Without_BASE_DN
328 [Teardown] Run Keywords FFDC On Test Case Fail AND
329 ... Create LDAP Configuration
330
331 Create LDAP Configuration ${LDAP_TYPE} Invalid_LDAP_Server_URI
332 ... Invalid_LDAP_BIND_DN LDAP_BIND_DN_PASSWORD ${EMPTY}
333 Sleep 15s
334 Redfish Verify LDAP Login ${False}
335
336
337Verify LDAP Authentication Without Password
338 [Documentation] Verify that LDAP user authentication without LDAP
339 ... user password fails.
340 [Tags] Verify_LDAP_Authentication_Without_Password
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500341
342 ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER}
343 Valid Value status [${False}]
344
345
Sivas SRRcde694c2019-09-09 12:20:34 -0500346Verify LDAP Login With Invalid BASE_DN
347 [Documentation] Verify that LDAP login with invalid BASE_DN and
348 ... valid LDAP user fails.
349 [Tags] Verify_LDAP_Login_With_Invalid_BASE_DN
350 [Teardown] Run Keywords FFDC On Test Case Fail AND
351 ... Create LDAP Configuration
352
353 Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI}
354 ... ${LDAP_BIND_DN} ${LDAP_BIND_DN_PASSWORD} Invalid_LDAP_BASE_DN
355 Sleep 15s
356 Redfish Verify LDAP Login ${False}
357
358
359Verify LDAP Login With Invalid BIND_DN_PASSWORD
360 [Documentation] Verify that LDAP login with invalid BIND_DN_PASSWORD and
361 ... valid LDAP user fails.
362 [Tags] Verify_LDAP_Login_With_Invalid_BIND_DN_PASSWORD
363 [Teardown] Run Keywords FFDC On Test Case Fail AND
364 ... Create LDAP Configuration
365
366 Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI}
367 ... ${LDAP_BIND_DN} INVALID_LDAP_BIND_DN_PASSWORD ${LDAP_BASE_DN}
368 Sleep 15s
369 Redfish Verify LDAP Login ${False}
370
371
372Verify LDAP Login With Invalid BASE_DN And Invalid BIND_DN
373 [Documentation] Verify that LDAP login with invalid BASE_DN and invalid
374 ... BIND_DN and valid LDAP user fails.
375 [Tags] Verify_LDAP_Login_With_Invalid_BASE_DN_And_Invalid_BIND_DN
376 [Teardown] Run Keywords FFDC On Test Case Fail AND
377 ... Create LDAP Configuration
378
379 Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI}
380 ... INVALID_LDAP_BIND_DN ${LDAP_BIND_DN_PASSWORD} INVALID_LDAP_BASE_DN
381 Sleep 15s
382 Redfish Verify LDAP Login ${False}
383
384
385Verify Group Name And Group Privilege Able To Modify
386 [Documentation] Verify that LDAP group name and group privilege able to
387 ... modify.
388 [Tags] Verify_Group_Name_And_Group_Privilege_Able_To_Modify
Sivas SRR873de8e2019-09-26 00:37:53 -0500389 [Setup] Update LDAP Configuration with LDAP User Role And Group
Sivas SRRcde694c2019-09-09 12:20:34 -0500390 ... ${LDAP_TYPE} Operator ${GROUP_NAME}
391
392 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
393 ... Administrator ${GROUP_NAME}
394
395
396Verify LDAP Login With Invalid BIND_DN
397 [Documentation] Verify that LDAP login with invalid BIND_DN and
398 ... valid LDAP user fails.
399 [Tags] Verify_LDAP_Login_With_Invalid_BIND_DN
400 [Teardown] Run Keywords FFDC On Test Case Fail AND
401 ... Create LDAP Configuration
402
403 Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI}
404 ... Invalid_LDAP_BIND_DN ${LDAP_BIND_DN_PASSWORD} ${LDAP_BASE_DN}
405 Sleep 15s
406 Redfish Verify LDAP Login ${False}
407
408
409Verify LDAP Authentication With Invalid LDAP User
410 [Documentation] Verify that LDAP user authentication for user not exist
411 ... in LDAP server and fails.
412 [Tags] Verify_LDAP_Authentication_With_Invalid_LDAP_User
Sivas SRRcde694c2019-09-09 12:20:34 -0500413
414 ${status}= Run Keyword And Return Status Redfish.Login INVALID_LDAP_USER
415 ... ${LDAP_USER_PASSWORD}
416 Valid Value status [${False}]
417
418
Prashanth Kattife798812020-01-31 07:04:26 -0600419Update LDAP User Roles And Verify Host Poweroff Operation
420 [Documentation] Update LDAP user roles and verify host poweroff operation.
421 [Tags] Update_LDAP_User_Roles_And_Verify_Host_Poweroff_Operation
422 [Teardown] Restore LDAP Privilege
423
424 [Template] Update LDAP User Role And Host Poweroff
425 # ldap_type group_privilege group_name valid_status_codes
426
427 # Verify LDAP user with NoAccess privilege not able to do host poweroff.
428 ${LDAP_TYPE} NoAccess ${GROUP_NAME} ${HTTP_FORBIDDEN}
429
430 # Verify LDAP user with ReadOnly privilege not able to do host poweroff.
431 ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN}
432
433 # Verify LDAP user with Operator privilege able to do host poweroff.
434 ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK}
435
436 # Verify LDAP user with Administrator privilege able to do host poweroff.
437 ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK}
438
439
Prashanth Kattia4f79292020-02-20 03:34:01 -0600440Update LDAP User Roles And Verify Host Poweron Operation
441 [Documentation] Update LDAP user roles and verify host poweron operation.
442 [Tags] Update_LDAP_User_Roles_And_Verify_Host_Poweron_Operation
443 [Teardown] Restore LDAP Privilege
444
445 [Template] Update LDAP User Role And Host Poweron
446 # ldap_type group_privilege group_name valid_status_codes
447
448 # Verify LDAP user with NoAccess privilege not able to do host poweron.
449 ${LDAP_TYPE} NoAccess ${GROUP_NAME} ${HTTP_FORBIDDEN}
450
451 # Verify LDAP user with ReadOnly privilege not able to do host poweron.
452 ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN}
453
454 # Verify LDAP user with Operator privilege able to do host poweron.
455 ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK}
456
457 # Verify LDAP user with Administrator privilege able to do host poweron.
458 ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK}
459
460
Prashanth Katti3dc8cc32020-03-04 11:11:01 -0600461Configure IP Address Via Different User Roles And Verify
462 [Documentation] Configure IP address via different user roles and verify.
463 [Tags] Configure_IP_Address_Via_Different_User_Roles_And_Verify
464 [Teardown] Restore LDAP Privilege
465
466 [Template] Update LDAP User Role And Configure IP Address
467 # Verify LDAP user with Administrator privilege is able to configure IP address.
468 ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK}
469
470 # Verify LDAP user with ReadOnly privilege is forbidden to configure IP address.
471 ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN}
472
473 # Verify LDAP user with NoAccess privilege is forbidden to configure IP address.
474 ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN}
475
476 # Verify LDAP user with Operator privilege is able to configure IP address.
477 ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK}
478
479
Prashanth Kattif90c4742020-03-18 11:08:47 -0500480Delete IP Address Via Different User Roles And Verify
481 [Documentation] Delete IP address via different user roles and verify.
482 [Tags] Delete_IP_Address_Via_Different_User_Roles_And_Verify
483 [Teardown] Run Keywords Restore LDAP Privilege AND FFDC On Test Case Fail
484
485 [Template] Update LDAP User Role And Delete IP Address
486 # Verify LDAP user with Administrator privilege is able to delete IP address.
487 ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK}
488
489 # Verify LDAP user with ReadOnly privilege is forbidden to delete IP address.
490 ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN}
491
492 # Verify LDAP user with NoAccess privilege is forbidden to delete IP address.
493 ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN}
494
495 # Verify LDAP user with Operator privilege is able to delete IP address.
496 ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK}
497
498
Sivas SRR7d7bae32019-05-29 00:31:14 -0500499*** Keywords ***
Sivas SRRd21c9842019-06-21 05:41:18 -0500500
Sivas SRRa031d2d2019-08-16 07:49:52 -0500501Redfish Verify LDAP Login
502 [Documentation] LDAP user log into BMC.
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500503 [Arguments] ${valid_status}=${True}
504
505 # Description of argument(s):
506 # valid_status Expected status of LDAP login ("True" or "False").
Sivas SRRa031d2d2019-08-16 07:49:52 -0500507
508 # According to our repo coding rules, Redfish.Login is to be done in Suite
509 # Setup and Redfish.Logout is to be done in Suite Teardown. For any
510 # deviation from this rule (such as in this keyword), the deviant code
511 # must take steps to restore us to our original logged-in state.
512
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500513 ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER}
514 ... ${LDAP_USER_PASSWORD}
515 Valid Value status [${valid_status}]
Sivas SRRa031d2d2019-08-16 07:49:52 -0500516 Redfish.Logout
517 Redfish.Login
518
519
Sivas SRRe9a47862019-08-05 07:13:43 -0500520Update LDAP Config And Verify Set Host Name
521 [Documentation] Update LDAP config and verify by attempting to set host name.
522 [Arguments] ${group_name} ${group_privilege}=Administrator
523 ... ${valid_status_codes}=[${HTTP_OK}]
524
525 # Description of argument(s):
526 # group_name The group name of user.
527 # group_privilege The group privilege ("Administrator",
528 # "Operator", "User" or "Callback").
529 # valid_status_codes Expected return code(s) from patch
530 # operation (e.g. "200") used to update
531 # HostName. See prolog of rest_request
532 # method in redfish_plut.py for details.
533 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
534 ... ${group_privilege} ${group_name}
535 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
536 # Verify that the LDAP user in ${group_name} with the given privilege is
537 # allowed to change the hostname.
Sivas SRRe9a47862019-08-05 07:13:43 -0500538 Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={'HostName': '${hostname}'}
539 ... valid_status_codes=${valid_status_codes}
540 Redfish.Logout
541 Redfish.Login
542
543
Sivas SRR73379bc2019-07-22 10:21:45 -0500544Disable Other LDAP
545 [Documentation] Disable other LDAP configuration.
546
547 # First disable other LDAP.
548 ${inverse_ldap_type}= Set Variable If '${LDAP_TYPE}' == 'LDAP' ActiveDirectory LDAP
549 Redfish.Patch ${REDFISH_BASE_URI}AccountService
550 ... body={'${inverse_ldap_type}': {'ServiceEnabled': ${False}}}
551 Sleep 15s
552
553
Sivas SRRb1b85752019-07-04 01:28:28 -0500554Create LDAP Configuration
555 [Documentation] Create LDAP configuration.
556 [Arguments] ${ldap_type}=${LDAP_TYPE} ${ldap_server_uri}=${LDAP_SERVER_URI}
557 ... ${ldap_bind_dn}=${LDAP_BIND_DN} ${ldap_bind_dn_password}=${LDAP_BIND_DN_PASSWORD}
558 ... ${ldap_base_dn}=${LDAP_BASE_DN}
559
560 # Description of argument(s):
561 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
562 # ldap_server_uri LDAP server uri (e.g. ldap://XX.XX.XX.XX).
563 # ldap_bind_dn The LDAP bind distinguished name.
564 # ldap_bind_dn_password The LDAP bind distinguished name password.
565 # ldap_base_dn The LDAP base distinguished name.
566
George Keishing2d0804e2019-12-12 22:27:05 -0600567 ${body}= Catenate {'${ldap_type}':
568 ... {'ServiceEnabled': ${True},
569 ... 'ServiceAddresses': ['${ldap_server_uri}'],
570 ... 'Authentication':
571 ... {'AuthenticationType': 'UsernameAndPassword',
572 ... 'Username':'${ldap_bind_dn}',
573 ... 'Password': '${ldap_bind_dn_password}'},
574 ... 'LDAPService':
575 ... {'SearchSettings':
576 ... {'BaseDistinguishedNames': ['${ldap_base_dn}']}}}}
577
578 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
Sivas SRRb1b85752019-07-04 01:28:28 -0500579 Sleep 15s
Sivas SRR73379bc2019-07-22 10:21:45 -0500580
581
582Config LDAP URL
583 [Documentation] Config LDAP URL.
Prashanth Katti7d38a092020-01-10 06:01:09 -0600584 [Arguments] ${ldap_server_uri}=${LDAP_SERVER_URI} ${expected_status}=${TRUE}
Sivas SRR73379bc2019-07-22 10:21:45 -0500585
586 # Description of argument(s):
587 # ldap_server_uri LDAP server uri (e.g. "ldap://XX.XX.XX.XX/").
588
Sivas SRRb1b85752019-07-04 01:28:28 -0500589 Redfish.Patch ${REDFISH_BASE_URI}AccountService
590 ... body={'${ldap_type}': {'ServiceAddresses': ['${ldap_server_uri}']}}
591 Sleep 15s
Sivas SRR73379bc2019-07-22 10:21:45 -0500592 # After update, LDAP login.
Prashanth Katti7d38a092020-01-10 06:01:09 -0600593 ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
594 Valid Value status [${expected_status}]
595
Sivas SRR73379bc2019-07-22 10:21:45 -0500596 Redfish.Logout
597 Redfish.Login
598
599
600Restore LDAP URL
601 [Documentation] Restore LDAP URL.
602
603 # Restoring the working LDAP server uri.
Sivas SRRb1b85752019-07-04 01:28:28 -0500604 Redfish.Patch ${REDFISH_BASE_URI}AccountService
Sivas SRR73379bc2019-07-22 10:21:45 -0500605 ... body={'${ldap_type}': {'ServiceAddresses': ['${LDAP_SERVER_URI}']}}
Sivas SRRb1b85752019-07-04 01:28:28 -0500606 Sleep 15s
607
608
Sivas SRRd21c9842019-06-21 05:41:18 -0500609Restore AccountLockout Attributes
610 [Documentation] Restore AccountLockout Attributes.
Sivas SRR73379bc2019-07-22 10:21:45 -0500611
Sivas SRRd21c9842019-06-21 05:41:18 -0500612 Return From Keyword If &{old_account_service} == &{EMPTY}
613 Redfish.Patch ${REDFISH_BASE_URI}AccountService
614 ... body=[('AccountLockoutDuration', ${old_account_service['AccountLockoutDuration']})]
615 Redfish.Patch ${REDFISH_BASE_URI}AccountService
616 ... body=[('AccountLockoutDuration', ${old_account_service['AccountLockoutThreshold']})]
617
618
Sivas SRR7d7bae32019-05-29 00:31:14 -0500619Suite Setup Execution
620 [Documentation] Do suite setup tasks.
Sivas SRR73379bc2019-07-22 10:21:45 -0500621
Michael Walshe7edb222019-08-19 17:39:38 -0500622 Valid Value LDAP_TYPE valid_values=["ActiveDirectory", "LDAP"]
623 Valid Value LDAP_USER
624 Valid Value LDAP_USER_PASSWORD
625 Valid Value GROUP_PRIVILEGE
626 Valid Value GROUP_NAME
627 Valid Value LDAP_SERVER_URI
628 Valid Value LDAP_BIND_DN_PASSWORD
629 Valid Value LDAP_BIND_DN
630 Valid Value LDAP_BASE_DN
Sivas SRRe9a47862019-08-05 07:13:43 -0500631
Sivas SRRf4ec6492019-06-16 01:59:30 -0500632 Redfish.Login
Sivas SRR73379bc2019-07-22 10:21:45 -0500633 # Call 'Get LDAP Configuration' to verify that LDAP configuration exists.
634 Get LDAP Configuration ${LDAP_TYPE}
Sivas SRR939b4b12019-06-26 00:01:59 -0500635 ${old_ldap_privilege}= Get LDAP Privilege
Prashanth Kattife798812020-01-31 07:04:26 -0600636 Set Suite Variable ${old_ldap_privilege}
Sivas SRRcde694c2019-09-09 12:20:34 -0500637 Disable Other LDAP
Sivas SRR873de8e2019-09-26 00:37:53 -0500638 Create LDAP Configuration
639 ${hostname}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
Sivas SRR7d7bae32019-05-29 00:31:14 -0500640
641
Sivas SRR939b4b12019-06-26 00:01:59 -0500642Set Read Privilege And Check Firmware Inventory
643 [Documentation] Set read privilege and check firmware inventory.
644 [Arguments] ${read_privilege}
645
646 # Description of argument(s):
647 # read_privilege The read privilege role (e.g. "User" / "Callback").
648
649 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
650 ... ${read_privilege} ${GROUP_NAME}
651
652 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
653 # Verify that the LDAP user with read privilege is able to read inventory.
654 ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory
655 Should Be True ${resp.dict["Members@odata.count"]} >= ${1}
656 Length Should Be ${resp.dict["Members"]} ${resp.dict["Members@odata.count"]}
Sivas SRRd21c9842019-06-21 05:41:18 -0500657 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500658 Redfish.Login
659
660
661Set Read Privilege And Check Poweron
662 [Documentation] Set read privilege and power on should not be possible.
663 [Arguments] ${read_privilege}
664
665 # Description of argument(s):
666 # read_privilege The read privilege role (e.g. "User" / "Callback").
667
668 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
669 ... ${read_privilege} ${GROUP_NAME}
670 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
671 Redfish.Post ${REDFISH_POWER_URI}
672 ... body={'ResetType': 'On'} valid_status_codes=[401, 403]
673 Redfish.Logout
674 Redfish.Login
Sivas SRRd21c9842019-06-21 05:41:18 -0500675
676
Sivas SRR7d7bae32019-05-29 00:31:14 -0500677Get LDAP Configuration
678 [Documentation] Retrieve LDAP Configuration.
679 [Arguments] ${ldap_type}
680
681 # Description of argument(s):
682 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
683
684 ${ldap_config}= Redfish.Get Properties ${REDFISH_BASE_URI}AccountService
685 [Return] ${ldap_config["${ldap_type}"]}
Sivas SRR108f9d32019-06-03 10:05:34 -0500686
687
688Update LDAP Configuration with LDAP User Role And Group
689 [Documentation] Update LDAP configuration update with LDAP user Role and group.
690 [Arguments] ${ldap_type} ${group_privilege} ${group_name}
691
692 # Description of argument(s):
693 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
694 # group_privilege The group privilege ("Administrator", "Operator", "User" or "Callback").
695 # group_name The group name of user.
696
697 ${local_role_remote_group}= Create Dictionary LocalRole=${group_privilege} RemoteGroup=${group_name}
698 ${remote_role_mapping}= Create List ${local_role_remote_group}
699 ${ldap_data}= Create Dictionary RemoteRoleMapping=${remote_role_mapping}
700 ${payload}= Create Dictionary ${ldap_type}=${ldap_data}
701 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=&{payload}
Sivas SRR939b4b12019-06-26 00:01:59 -0500702 # Provide adequate time for LDAP daemon to restart after the update.
Sivas SRR73379bc2019-07-22 10:21:45 -0500703 Sleep 15s
Sivas SRR108f9d32019-06-03 10:05:34 -0500704
Sivas SRRf4ec6492019-06-16 01:59:30 -0500705
706Get LDAP Privilege
707 [Documentation] Get LDAP privilege and return it.
Sivas SRR73379bc2019-07-22 10:21:45 -0500708
Sivas SRRf4ec6492019-06-16 01:59:30 -0500709 ${ldap_config}= Get LDAP Configuration ${LDAP_TYPE}
Sivas SRRe9a47862019-08-05 07:13:43 -0500710 ${num_list_entries}= Get Length ${ldap_config["RemoteRoleMapping"]}
711 Return From Keyword If ${num_list_entries} == ${0} @{EMPTY}
712
Sivas SRRf4ec6492019-06-16 01:59:30 -0500713 [Return] ${ldap_config["RemoteRoleMapping"][0]["LocalRole"]}
714
715
716Restore LDAP Privilege
717 [Documentation] Restore the LDAP privilege to its original value.
Sivas SRR73379bc2019-07-22 10:21:45 -0500718
Sivas SRR939b4b12019-06-26 00:01:59 -0500719 Return From Keyword If '${old_ldap_privilege}' == '${EMPTY}'
720 # Log back in to restore the original privilege.
Sivas SRRf4ec6492019-06-16 01:59:30 -0500721 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
722 ... ${old_ldap_privilege} ${GROUP_NAME}
Prashanth Kattife798812020-01-31 07:04:26 -0600723
724 Sleep 18s
725
726
727Update LDAP User Role And Host Poweroff
728 [Documentation] Update LDAP user role and do host poweroff.
729 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}
Prashanth Kattia4f79292020-02-20 03:34:01 -0600730 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login
Prashanth Kattife798812020-01-31 07:04:26 -0600731
732 # Description of argument(s):
733 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
734 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
735 # group_name The group name of user.
736 # valid_status_code The expected valid status code.
737
738 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
739 ... ${group_privilege} ${group_name}
740
741 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
742
743 Redfish.Post ${REDFISH_POWER_URI}
744 ... body={'ResetType': 'ForceOff'} valid_status_codes=[${valid_status_code}]
745
Prashanth Kattia4f79292020-02-20 03:34:01 -0600746
747Update LDAP User Role And Host Poweron
748 [Documentation] Update LDAP user role and do host poweron.
749 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}
750 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login
751
752 # Description of argument(s):
753 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
754 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
755 # group_name The group name of user.
756 # valid_status_code The expected valid status code.
757
758 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
759 ... ${group_privilege} ${group_name}
760
761 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
762
763 Redfish.Post ${REDFISH_POWER_URI}
764 ... body={'ResetType': 'On'} valid_status_codes=[${valid_status_code}]
Prashanth Katti3dc8cc32020-03-04 11:11:01 -0600765
766
767Update LDAP User Role And Configure IP Address
768 [Documentation] Update LDAP user role and configure IP address.
769 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK}
770 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND Delete IP Address ${test_ip}
771
772 # Description of argument(s):
773 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
774 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
775 # group_name The group name of user.
776 # valid_status_code The expected valid status code.
777
778 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
779 ... ${group_privilege} ${group_name}
780
781 Redfish.Logout
782
783 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
784
785 Add IP Address ${test_ip} ${test_mask} ${test_gw} ${valid_status_code}
Prashanth Kattif90c4742020-03-18 11:08:47 -0500786
787
788Update LDAP User Role And Delete IP Address
789 [Documentation] Update LDAP user role and delete IP address.
790 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK}
791 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND Delete IP Address ${test_ip}
792
793 # Description of argument(s):
794 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
795 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
796 # group_name The group name of user.
797 # valid_status_code The expected valid status code.
798
799 # Configure IP address before deleting via LDAP user roles.
800 Add IP Address ${test_ip} ${test_mask} ${test_gw}
801
802 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
803 ... ${group_privilege} ${group_name}
804
805 Redfish.Logout
806
807 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
808
809 Delete IP Address ${test_ip} ${valid_status_code}