blob: 141d73497fe2dc6d675903115297c96063ad8f41 [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
Sivas SRRf4ec6492019-06-16 01:59:30 -050024
Sivas SRR7d7bae32019-05-29 00:31:14 -050025** Test Cases **
26
Sivas SRRb1b85752019-07-04 01:28:28 -050027Verify LDAP Configuration Created
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050028 [Documentation] Verify that LDAP configuration created.
Sivas SRRb1b85752019-07-04 01:28:28 -050029 [Tags] Verify_LDAP_Configuration_Created
30
31 Create LDAP Configuration
32 # Call 'Get LDAP Configuration' to verify that LDAP configuration exists.
33 Get LDAP Configuration ${LDAP_TYPE}
34 Sleep 10s
35 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
36 Redfish.Logout
37 Redfish.Login
38
39
40Verify LDAP Service Disable
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050041 [Documentation] Verify that LDAP is disabled and that LDAP user cannot
42 ... login.
Sivas SRRb1b85752019-07-04 01:28:28 -050043 [Tags] Verify_LDAP_Service_Disable
44
45 Redfish.Patch ${REDFISH_BASE_URI}AccountService
46 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${False}}}
47 Sleep 15s
48 ${resp}= Run Keyword And Return Status Redfish.Login ${LDAP_USER}
49 ... ${LDAP_USER_PASSWORD}
George Keishing333bb722019-12-11 11:40:49 -060050 Should Be Equal ${resp} ${False}
51 ... msg=LDAP user was able to login even though the LDAP service was disabled.
Sivas SRRb1b85752019-07-04 01:28:28 -050052 Redfish.Logout
53 Redfish.Login
54 # Enabling LDAP so that LDAP user works.
55 Redfish.Patch ${REDFISH_BASE_URI}AccountService
56 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}}
57 Redfish.Logout
58 Redfish.Login
59
60
Sivas SRR73379bc2019-07-22 10:21:45 -050061Verify LDAP Login With ServiceEnabled
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050062 [Documentation] Verify that LDAP Login with ServiceEnabled.
Sivas SRR73379bc2019-07-22 10:21:45 -050063 [Tags] Verify_LDAP_Login_With_ServiceEnabled
64
65 Disable Other LDAP
66 # Actual service enablement.
67 Redfish.Patch ${REDFISH_BASE_URI}AccountService
68 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}}
69 Sleep 15s
70 # After update, LDAP login.
71 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
72 Redfish.Logout
73 Redfish.Login
74
75
76Verify LDAP Login With Correct AuthenticationType
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050077 [Documentation] Verify that LDAP Login with right AuthenticationType.
Sivas SRR73379bc2019-07-22 10:21:45 -050078 [Tags] Verify_LDAP_Login_With_Correct_AuthenticationType
79
80 Redfish.Patch ${REDFISH_BASE_URI}AccountService
81 ... body={'${ldap_type}': {'Authentication': {'AuthenticationType':'UsernameAndPassword'}}}
82 Sleep 15s
83 # After update, LDAP login.
84 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
85 Redfish.Logout
86 Redfish.Login
87
88
89Verify LDAP Config Update With Incorrect AuthenticationType
Sivas SRR6f8ac5d2019-08-27 01:09:52 -050090 [Documentation] Verify that invalid AuthenticationType is not updated.
Sivas SRR73379bc2019-07-22 10:21:45 -050091 [Tags] Verify_LDAP_Update_With_Incorrect_AuthenticationType
92
George Keishing2d0804e2019-12-12 22:27:05 -060093 ${body}= Catenate {'${ldap_type}': {'Authentication': {'AuthenticationType':'KerberosKeytab'}}}
Prashanth Katti7d38a092020-01-10 06:01:09 -060094
Sivas SRR73379bc2019-07-22 10:21:45 -050095 Redfish.Patch ${REDFISH_BASE_URI}AccountService
Prashanth Katti7d38a092020-01-10 06:01:09 -060096 ... body=${body} valid_status_codes=[400]
Sivas SRR73379bc2019-07-22 10:21:45 -050097
98
99Verify LDAP Login With Correct LDAP URL
100 [Documentation] Verify LDAP Login with right LDAP URL.
101 [Tags] Verify_LDAP_Login_With_Correct_LDAP_URL
102
103 Config LDAP URL ${LDAP_SERVER_URI}
104
105
106Verify LDAP Config Update With Incorrect LDAP URL
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500107 [Documentation] Verify that LDAP Login fails with invalid LDAP URL.
Sivas SRR73379bc2019-07-22 10:21:45 -0500108 [Tags] Verify_LDAP_Config_Update_With_Incorrect_LDAP_URL
109 [Teardown] Run Keywords Restore LDAP URL AND
110 ... FFDC On Test Case Fail
111
Prashanth Katti7d38a092020-01-10 06:01:09 -0600112 Config LDAP URL ldap://1.2.3.4/ ${FALSE}
Sivas SRR73379bc2019-07-22 10:21:45 -0500113
Sivas SRR7d7bae32019-05-29 00:31:14 -0500114Verify LDAP Configuration Exist
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500115 [Documentation] Verify that LDAP configuration is available.
Sivas SRR7d7bae32019-05-29 00:31:14 -0500116 [Tags] Verify_LDAP_Configuration_Exist
Sivas SRR73379bc2019-07-22 10:21:45 -0500117
Sivas SRR7d7bae32019-05-29 00:31:14 -0500118 ${resp}= Redfish.Get Attribute ${REDFISH_BASE_URI}AccountService
119 ... ${LDAP_TYPE} default=${EMPTY}
120 Should Not Be Empty ${resp} msg=LDAP configuration is not defined.
121
122
123Verify LDAP User Login
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500124 [Documentation] Verify that LDAP user able to login into BMC.
Sivas SRR7d7bae32019-05-29 00:31:14 -0500125 [Tags] Verify_LDAP_User_Login
Sivas SRR73379bc2019-07-22 10:21:45 -0500126
127 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
Sivas SRR939b4b12019-06-26 00:01:59 -0500128 Redfish.Logout
129 Redfish.Login
Sivas SRR7d7bae32019-05-29 00:31:14 -0500130
131
132Verify LDAP Service Available
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500133 [Documentation] Verify that LDAP service is available.
Sivas SRR7d7bae32019-05-29 00:31:14 -0500134 [Tags] Verify_LDAP_Service_Available
Sivas SRR73379bc2019-07-22 10:21:45 -0500135
Sivas SRR7d7bae32019-05-29 00:31:14 -0500136 @{ldap_configuration}= Get LDAP Configuration ${LDAP_TYPE}
137 Should Contain ${ldap_configuration} LDAPService
138 ... msg=LDAPService is not available.
139
140
Sivas SRR108f9d32019-06-03 10:05:34 -0500141Verify LDAP Login Works After BMC Reboot
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500142 [Documentation] Verify that LDAP login works after BMC reboot.
Sivas SRR108f9d32019-06-03 10:05:34 -0500143 [Tags] Verify_LDAP_Login_Works_After_BMC_Reboot
Sivas SRR73379bc2019-07-22 10:21:45 -0500144
Sivas SRR108f9d32019-06-03 10:05:34 -0500145 Redfish OBMC Reboot (off)
146 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
147 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500148 Redfish.Login
Sivas SRR108f9d32019-06-03 10:05:34 -0500149
150
151Verify LDAP User With Admin Privilege Able To Do BMC Reboot
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500152 [Documentation] Verify that LDAP user with administrator privilege able to do BMC reboot.
Sivas SRR108f9d32019-06-03 10:05:34 -0500153 [Tags] Verify_LDAP_User_With_Admin_Privilege_Able_To_Do_BMC_Reboot
154
Sivas SRR73379bc2019-07-22 10:21:45 -0500155
Sivas SRR108f9d32019-06-03 10:05:34 -0500156 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
157 ... ${GROUP_PRIVILEGE} ${GROUP_NAME}
158 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
159 # With LDAP user and with right privilege trying to do BMC reboot.
160 Redfish OBMC Reboot (off)
161 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
162 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500163 Redfish.Login
Sivas SRR108f9d32019-06-03 10:05:34 -0500164
165
Sivas SRR2b83ec02019-07-12 11:30:20 -0500166Verify LDAP User With Operator Privilege Able To Do Host Poweroff
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500167 [Documentation] Verify that LDAP user with operator privilege can do host
168 ... power off.
Sivas SRR2b83ec02019-07-12 11:30:20 -0500169 [Tags] Verify_LDAP_User_With_Operator_Privilege_Able_To_Do_Host_Poweroff
Sivas SRRf4ec6492019-06-16 01:59:30 -0500170 [Teardown] Restore LDAP Privilege
171
Sivas SRRf4ec6492019-06-16 01:59:30 -0500172 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
173 ... Operator ${GROUP_NAME}
Sivas SRRf4ec6492019-06-16 01:59:30 -0500174
Sivas SRRf4ec6492019-06-16 01:59:30 -0500175 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
Sivas SRR2b83ec02019-07-12 11:30:20 -0500176 # Verify that the LDAP user with operator privilege is able to power the system off.
177 Redfish.Post ${REDFISH_POWER_URI}
Sivas SRR3d82b3c2019-07-12 12:20:04 -0500178 ... body={'ResetType': 'ForceOff'} valid_status_codes=[200]
Sivas SRRf4ec6492019-06-16 01:59:30 -0500179 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500180 Redfish.Login
Sivas SRRf4ec6492019-06-16 01:59:30 -0500181
182
Sivas SRRd21c9842019-06-21 05:41:18 -0500183Verify AccountLockout Attributes Set To Zero
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500184 [Documentation] Verify that attribute AccountLockoutDuration and
Sivas SRRd21c9842019-06-21 05:41:18 -0500185 ... AccountLockoutThreshold are set to 0.
186 [Teardown] Run Keywords Restore AccountLockout Attributes AND
187 ... FFDC On Test Case Fail
188 [Tags] Verify_AccountLockout_Attributes_Set_To_Zero
Sivas SRR73379bc2019-07-22 10:21:45 -0500189
Sivas SRRd21c9842019-06-21 05:41:18 -0500190 ${old_account_service}= Redfish.Get Properties
191 ... ${REDFISH_BASE_URI}AccountService
Michael Walsh39c00512019-07-17 10:54:06 -0500192 Rprint Vars old_account_service
Sivas SRRd21c9842019-06-21 05:41:18 -0500193 Redfish.Patch ${REDFISH_BASE_URI}AccountService
194 ... body=[('AccountLockoutDuration', 0)]
195 Redfish.Patch ${REDFISH_BASE_URI}AccountService
196 ... body=[('AccountLockoutThreshold', 0)]
197
198
Sivas SRR939b4b12019-06-26 00:01:59 -0500199Verify LDAP User With Read Privilege Able To Check Inventory
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500200 [Documentation] Verify that LDAP user with read privilege able to
Sivas SRR939b4b12019-06-26 00:01:59 -0500201 ... read firmware inventory.
202 [Tags] Verify_LDAP_User_With_Read_Privilege_Able_To_Check_Inventory
203 [Teardown] Run Keywords FFDC On Test Case Fail AND Restore LDAP Privilege
204 [Template] Set Read Privilege And Check Firmware Inventory
205
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600206 ReadOnly
Sivas SRR939b4b12019-06-26 00:01:59 -0500207
208
209Verify LDAP User With Read Privilege Should Not Do Host Poweron
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500210 [Documentation] Verify that LDAP user with read privilege should not be
Sivas SRR939b4b12019-06-26 00:01:59 -0500211 ... allowed to power on the host.
212 [Tags] Verify_LDAP_User_With_Read_Privilege_Should_Not_Do_Host_Poweron
213 [Teardown] Run Keywords FFDC On Test Case Fail AND Restore LDAP Privilege
214 [Template] Set Read Privilege And Check Poweron
215
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600216 ReadOnly
Sivas SRR939b4b12019-06-26 00:01:59 -0500217
218
Sivas SRRe9a47862019-08-05 07:13:43 -0500219Update LDAP Group Name And Verify Operations
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500220 [Documentation] Verify that LDAP group name update and able to do right
221 ... operations.
Sivas SRRe9a47862019-08-05 07:13:43 -0500222 [Tags] Update_LDAP_Group_Name_And_Verify_Operations
223 [Template] Update LDAP Config And Verify Set Host Name
224 [Teardown] Restore LDAP Privilege
225
226 # group_name group_privilege valid_status_codes
227 ${GROUP_NAME} Administrator [${HTTP_OK}]
228 ${GROUP_NAME} Operator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600229 ${GROUP_NAME} ReadOnly [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
230 ${GROUP_NAME} NoAccess [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Sivas SRRe9a47862019-08-05 07:13:43 -0500231 Invalid_LDAP_Group_Name Administrator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
232 Invalid_LDAP_Group_Name Operator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Prashanth Kattiedce4a92020-01-16 07:28:39 -0600233 Invalid_LDAP_Group_Name ReadOnly [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
234 Invalid_LDAP_Group_Name NoAccess [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}]
Sivas SRRe9a47862019-08-05 07:13:43 -0500235
236
Sivas SRRa031d2d2019-08-16 07:49:52 -0500237Verify LDAP BaseDN Update And LDAP Login
238 [Documentation] Update LDAP BaseDN of LDAP configuration and verify
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500239 ... that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500240 [Tags] Verify_LDAP_BaseDN_Update_And_LDAP_Login
241
242
243 ${body}= Catenate {'${LDAP_TYPE}': { 'LDAPService': {'SearchSettings':
244 ... {'BaseDistinguishedNames': ['${LDAP_BASE_DN}']}}}}
245 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
246 Sleep 15s
247 Redfish Verify LDAP Login
248
249
250Verify LDAP BindDN Update And LDAP Login
251 [Documentation] Update LDAP BindDN of LDAP configuration and verify
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500252 ... that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500253 [Tags] Verify_LDAP_BindDN_Update_And_LDAP_Login
254
255 ${body}= Catenate {'${LDAP_TYPE}': { 'Authentication':
256 ... {'AuthenticationType':'UsernameAndPassword', 'Username':
257 ... '${LDAP_BIND_DN}'}}}
258 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
259 Sleep 15s
260 Redfish Verify LDAP Login
261
262
263Verify LDAP BindDN Password Update And LDAP Login
264 [Documentation] Update LDAP BindDN password of LDAP configuration and
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500265 ... verify that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500266 [Tags] Verify_LDAP_BindDN_Passsword_Update_And_LDAP_Login
267
268
269 ${body}= Catenate {'${LDAP_TYPE}': { 'Authentication':
270 ... {'AuthenticationType':'UsernameAndPassword', 'Password':
271 ... '${LDAP_BIND_DN_PASSWORD}'}}}
272 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
273 Sleep 15s
274 Redfish Verify LDAP Login
275
276
277Verify LDAP Type Update And LDAP Login
278 [Documentation] Update LDAP type of LDAP configuration and verify
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500279 ... that LDAP login works.
Sivas SRRa031d2d2019-08-16 07:49:52 -0500280 [Tags] Verify_LDAP_Type_Update_And_LDAP_Login
281
282 Disable Other LDAP
283 Redfish.Patch ${REDFISH_BASE_URI}AccountService
284 ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}}
285 Sleep 15s
286 Redfish Verify LDAP Login
287
288
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500289Verify Authorization With Null Privilege
290 [Documentation] Verify the failure of LDAP authorization with empty
291 ... privilege.
292 [Tags] Verify_LDAP_Authorization_With_Null_Privilege
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500293 [Teardown] Restore LDAP Privilege
294
295 Update LDAP Config And Verify Set Host Name ${GROUP_NAME} ${EMPTY}
296 ... [${HTTP_FORBIDDEN}]
297
298
299Verify Authorization With Invalid Privilege
300 [Documentation] Verify that LDAP user authorization with wrong privilege
301 ... fails.
302 [Tags] Verify_LDAP_Authorization_With_Invalid_Privilege
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500303 [Teardown] Restore LDAP Privilege
304
305 Update LDAP Config And Verify Set Host Name ${GROUP_NAME}
306 ... Invalid_Privilege [${HTTP_FORBIDDEN}]
307
308
309Verify LDAP Login With Invalid Data
310 [Documentation] Verify that LDAP login with Invalid LDAP data and
311 ... right LDAP user fails.
312 [Tags] Verify_LDAP_Login_With_Invalid_Data
313 [Teardown] Run Keywords FFDC On Test Case Fail AND
314 ... Create LDAP Configuration
315
316 Create LDAP Configuration ${LDAP_TYPE} Invalid_LDAP_Server_URI
317 ... Invalid_LDAP_BIND_DN LDAP_BIND_DN_PASSWORD
318 ... Invalid_LDAP_BASE_DN
319 Sleep 15s
320 Redfish Verify LDAP Login ${False}
321
322
323Verify LDAP Config Creation Without BASE_DN
324 [Documentation] Verify that LDAP login with LDAP configuration
325 ... created without BASE_DN fails.
326 [Tags] Verify_LDAP_Config_Creation_Without_BASE_DN
327 [Teardown] Run Keywords FFDC On Test Case Fail AND
328 ... Create LDAP Configuration
329
330 Create LDAP Configuration ${LDAP_TYPE} Invalid_LDAP_Server_URI
331 ... Invalid_LDAP_BIND_DN LDAP_BIND_DN_PASSWORD ${EMPTY}
332 Sleep 15s
333 Redfish Verify LDAP Login ${False}
334
335
336Verify LDAP Authentication Without Password
337 [Documentation] Verify that LDAP user authentication without LDAP
338 ... user password fails.
339 [Tags] Verify_LDAP_Authentication_Without_Password
Anves Kumar rayankula5bf342e2020-06-25 08:35:34 -0500340 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login
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.
Prashanth Katti67e06202020-05-20 06:16:51 -0500474 ${LDAP_TYPE} NoAccess ${GROUP_NAME} ${HTTP_FORBIDDEN}
Prashanth Katti3dc8cc32020-03-04 11:11:01 -0600475
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.
Prashanth Katti67e06202020-05-20 06:16:51 -0500493 ${LDAP_TYPE} NoAccess ${GROUP_NAME} ${HTTP_FORBIDDEN}
Prashanth Kattif90c4742020-03-18 11:08:47 -0500494
495 # Verify LDAP user with Operator privilege is able to delete IP address.
496 ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK}
497
498
Prashanth Katti67e06202020-05-20 06:16:51 -0500499Read Network Configuration Via Different User Roles And Verify
David Shaw8e6d4ee2020-06-12 10:03:59 -0500500 [Documentation] Read network configuration via different user roles and verify.
Prashanth Katti67e06202020-05-20 06:16:51 -0500501 [Tags] Read_Network_configuration_Via_Different_User_Roles_And_Verify
502 [Teardown] Restore LDAP Privilege
503
504 [Template] Update LDAP User Role And Read Network Configuration
505 ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK}
506
507 ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_OK}
508
509 ${LDAP_TYPE} NoAccess ${GROUP_NAME} ${HTTP_FORBIDDEN}
510
511 ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK}
512
513
Sivas SRR7d7bae32019-05-29 00:31:14 -0500514*** Keywords ***
Sivas SRRd21c9842019-06-21 05:41:18 -0500515
Sivas SRRa031d2d2019-08-16 07:49:52 -0500516Redfish Verify LDAP Login
517 [Documentation] LDAP user log into BMC.
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500518 [Arguments] ${valid_status}=${True}
519
520 # Description of argument(s):
521 # valid_status Expected status of LDAP login ("True" or "False").
Sivas SRRa031d2d2019-08-16 07:49:52 -0500522
523 # According to our repo coding rules, Redfish.Login is to be done in Suite
524 # Setup and Redfish.Logout is to be done in Suite Teardown. For any
525 # deviation from this rule (such as in this keyword), the deviant code
526 # must take steps to restore us to our original logged-in state.
527
Sivas SRR6f8ac5d2019-08-27 01:09:52 -0500528 ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER}
529 ... ${LDAP_USER_PASSWORD}
530 Valid Value status [${valid_status}]
Sivas SRRa031d2d2019-08-16 07:49:52 -0500531 Redfish.Logout
532 Redfish.Login
533
534
Sivas SRRe9a47862019-08-05 07:13:43 -0500535Update LDAP Config And Verify Set Host Name
536 [Documentation] Update LDAP config and verify by attempting to set host name.
537 [Arguments] ${group_name} ${group_privilege}=Administrator
538 ... ${valid_status_codes}=[${HTTP_OK}]
539
540 # Description of argument(s):
541 # group_name The group name of user.
542 # group_privilege The group privilege ("Administrator",
543 # "Operator", "User" or "Callback").
544 # valid_status_codes Expected return code(s) from patch
545 # operation (e.g. "200") used to update
546 # HostName. See prolog of rest_request
547 # method in redfish_plut.py for details.
548 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
549 ... ${group_privilege} ${group_name}
550 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
551 # Verify that the LDAP user in ${group_name} with the given privilege is
552 # allowed to change the hostname.
Sivas SRRe9a47862019-08-05 07:13:43 -0500553 Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={'HostName': '${hostname}'}
554 ... valid_status_codes=${valid_status_codes}
555 Redfish.Logout
556 Redfish.Login
557
558
Sivas SRR73379bc2019-07-22 10:21:45 -0500559Disable Other LDAP
560 [Documentation] Disable other LDAP configuration.
561
562 # First disable other LDAP.
563 ${inverse_ldap_type}= Set Variable If '${LDAP_TYPE}' == 'LDAP' ActiveDirectory LDAP
564 Redfish.Patch ${REDFISH_BASE_URI}AccountService
565 ... body={'${inverse_ldap_type}': {'ServiceEnabled': ${False}}}
566 Sleep 15s
567
568
Sivas SRRb1b85752019-07-04 01:28:28 -0500569Create LDAP Configuration
570 [Documentation] Create LDAP configuration.
571 [Arguments] ${ldap_type}=${LDAP_TYPE} ${ldap_server_uri}=${LDAP_SERVER_URI}
572 ... ${ldap_bind_dn}=${LDAP_BIND_DN} ${ldap_bind_dn_password}=${LDAP_BIND_DN_PASSWORD}
573 ... ${ldap_base_dn}=${LDAP_BASE_DN}
574
575 # Description of argument(s):
576 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
577 # ldap_server_uri LDAP server uri (e.g. ldap://XX.XX.XX.XX).
578 # ldap_bind_dn The LDAP bind distinguished name.
579 # ldap_bind_dn_password The LDAP bind distinguished name password.
580 # ldap_base_dn The LDAP base distinguished name.
581
George Keishing2d0804e2019-12-12 22:27:05 -0600582 ${body}= Catenate {'${ldap_type}':
583 ... {'ServiceEnabled': ${True},
584 ... 'ServiceAddresses': ['${ldap_server_uri}'],
585 ... 'Authentication':
586 ... {'AuthenticationType': 'UsernameAndPassword',
587 ... 'Username':'${ldap_bind_dn}',
588 ... 'Password': '${ldap_bind_dn_password}'},
589 ... 'LDAPService':
590 ... {'SearchSettings':
591 ... {'BaseDistinguishedNames': ['${ldap_base_dn}']}}}}
592
593 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body}
Sivas SRRb1b85752019-07-04 01:28:28 -0500594 Sleep 15s
Sivas SRR73379bc2019-07-22 10:21:45 -0500595
596
597Config LDAP URL
598 [Documentation] Config LDAP URL.
Prashanth Katti7d38a092020-01-10 06:01:09 -0600599 [Arguments] ${ldap_server_uri}=${LDAP_SERVER_URI} ${expected_status}=${TRUE}
Sivas SRR73379bc2019-07-22 10:21:45 -0500600
601 # Description of argument(s):
602 # ldap_server_uri LDAP server uri (e.g. "ldap://XX.XX.XX.XX/").
603
Sivas SRRb1b85752019-07-04 01:28:28 -0500604 Redfish.Patch ${REDFISH_BASE_URI}AccountService
605 ... body={'${ldap_type}': {'ServiceAddresses': ['${ldap_server_uri}']}}
606 Sleep 15s
Sivas SRR73379bc2019-07-22 10:21:45 -0500607 # After update, LDAP login.
Prashanth Katti7d38a092020-01-10 06:01:09 -0600608 ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
609 Valid Value status [${expected_status}]
610
Sivas SRR73379bc2019-07-22 10:21:45 -0500611 Redfish.Logout
612 Redfish.Login
613
614
615Restore LDAP URL
616 [Documentation] Restore LDAP URL.
617
618 # Restoring the working LDAP server uri.
Sivas SRRb1b85752019-07-04 01:28:28 -0500619 Redfish.Patch ${REDFISH_BASE_URI}AccountService
Sivas SRR73379bc2019-07-22 10:21:45 -0500620 ... body={'${ldap_type}': {'ServiceAddresses': ['${LDAP_SERVER_URI}']}}
Sivas SRRb1b85752019-07-04 01:28:28 -0500621 Sleep 15s
622
623
Sivas SRRd21c9842019-06-21 05:41:18 -0500624Restore AccountLockout Attributes
625 [Documentation] Restore AccountLockout Attributes.
Sivas SRR73379bc2019-07-22 10:21:45 -0500626
Sivas SRRd21c9842019-06-21 05:41:18 -0500627 Return From Keyword If &{old_account_service} == &{EMPTY}
628 Redfish.Patch ${REDFISH_BASE_URI}AccountService
629 ... body=[('AccountLockoutDuration', ${old_account_service['AccountLockoutDuration']})]
630 Redfish.Patch ${REDFISH_BASE_URI}AccountService
631 ... body=[('AccountLockoutDuration', ${old_account_service['AccountLockoutThreshold']})]
632
633
Sivas SRR7d7bae32019-05-29 00:31:14 -0500634Suite Setup Execution
635 [Documentation] Do suite setup tasks.
Sivas SRR73379bc2019-07-22 10:21:45 -0500636
Michael Walshe7edb222019-08-19 17:39:38 -0500637 Valid Value LDAP_TYPE valid_values=["ActiveDirectory", "LDAP"]
638 Valid Value LDAP_USER
639 Valid Value LDAP_USER_PASSWORD
640 Valid Value GROUP_PRIVILEGE
641 Valid Value GROUP_NAME
642 Valid Value LDAP_SERVER_URI
643 Valid Value LDAP_BIND_DN_PASSWORD
644 Valid Value LDAP_BIND_DN
645 Valid Value LDAP_BASE_DN
Sivas SRRe9a47862019-08-05 07:13:43 -0500646
Sivas SRRf4ec6492019-06-16 01:59:30 -0500647 Redfish.Login
Sivas SRR73379bc2019-07-22 10:21:45 -0500648 # Call 'Get LDAP Configuration' to verify that LDAP configuration exists.
649 Get LDAP Configuration ${LDAP_TYPE}
Sivas SRR939b4b12019-06-26 00:01:59 -0500650 ${old_ldap_privilege}= Get LDAP Privilege
Prashanth Kattife798812020-01-31 07:04:26 -0600651 Set Suite Variable ${old_ldap_privilege}
Sivas SRRcde694c2019-09-09 12:20:34 -0500652 Disable Other LDAP
Sivas SRR873de8e2019-09-26 00:37:53 -0500653 Create LDAP Configuration
654 ${hostname}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
Sivas SRR7d7bae32019-05-29 00:31:14 -0500655
656
Sivas SRR939b4b12019-06-26 00:01:59 -0500657Set Read Privilege And Check Firmware Inventory
658 [Documentation] Set read privilege and check firmware inventory.
659 [Arguments] ${read_privilege}
660
661 # Description of argument(s):
662 # read_privilege The read privilege role (e.g. "User" / "Callback").
663
664 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
665 ... ${read_privilege} ${GROUP_NAME}
666
667 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
668 # Verify that the LDAP user with read privilege is able to read inventory.
669 ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory
670 Should Be True ${resp.dict["Members@odata.count"]} >= ${1}
671 Length Should Be ${resp.dict["Members"]} ${resp.dict["Members@odata.count"]}
Sivas SRRd21c9842019-06-21 05:41:18 -0500672 Redfish.Logout
Sivas SRR939b4b12019-06-26 00:01:59 -0500673 Redfish.Login
674
675
676Set Read Privilege And Check Poweron
677 [Documentation] Set read privilege and power on should not be possible.
678 [Arguments] ${read_privilege}
679
680 # Description of argument(s):
681 # read_privilege The read privilege role (e.g. "User" / "Callback").
682
683 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
684 ... ${read_privilege} ${GROUP_NAME}
685 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
686 Redfish.Post ${REDFISH_POWER_URI}
687 ... body={'ResetType': 'On'} valid_status_codes=[401, 403]
688 Redfish.Logout
689 Redfish.Login
Sivas SRRd21c9842019-06-21 05:41:18 -0500690
691
Sivas SRR7d7bae32019-05-29 00:31:14 -0500692Get LDAP Configuration
693 [Documentation] Retrieve LDAP Configuration.
694 [Arguments] ${ldap_type}
695
696 # Description of argument(s):
697 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
698
699 ${ldap_config}= Redfish.Get Properties ${REDFISH_BASE_URI}AccountService
700 [Return] ${ldap_config["${ldap_type}"]}
Sivas SRR108f9d32019-06-03 10:05:34 -0500701
702
703Update LDAP Configuration with LDAP User Role And Group
704 [Documentation] Update LDAP configuration update with LDAP user Role and group.
705 [Arguments] ${ldap_type} ${group_privilege} ${group_name}
706
707 # Description of argument(s):
708 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
709 # group_privilege The group privilege ("Administrator", "Operator", "User" or "Callback").
710 # group_name The group name of user.
711
712 ${local_role_remote_group}= Create Dictionary LocalRole=${group_privilege} RemoteGroup=${group_name}
713 ${remote_role_mapping}= Create List ${local_role_remote_group}
714 ${ldap_data}= Create Dictionary RemoteRoleMapping=${remote_role_mapping}
715 ${payload}= Create Dictionary ${ldap_type}=${ldap_data}
716 Redfish.Patch ${REDFISH_BASE_URI}AccountService body=&{payload}
Sivas SRR939b4b12019-06-26 00:01:59 -0500717 # Provide adequate time for LDAP daemon to restart after the update.
Sivas SRR73379bc2019-07-22 10:21:45 -0500718 Sleep 15s
Sivas SRR108f9d32019-06-03 10:05:34 -0500719
Sivas SRRf4ec6492019-06-16 01:59:30 -0500720
721Get LDAP Privilege
722 [Documentation] Get LDAP privilege and return it.
Sivas SRR73379bc2019-07-22 10:21:45 -0500723
Sivas SRRf4ec6492019-06-16 01:59:30 -0500724 ${ldap_config}= Get LDAP Configuration ${LDAP_TYPE}
Sivas SRRe9a47862019-08-05 07:13:43 -0500725 ${num_list_entries}= Get Length ${ldap_config["RemoteRoleMapping"]}
726 Return From Keyword If ${num_list_entries} == ${0} @{EMPTY}
727
Sivas SRRf4ec6492019-06-16 01:59:30 -0500728 [Return] ${ldap_config["RemoteRoleMapping"][0]["LocalRole"]}
729
730
731Restore LDAP Privilege
732 [Documentation] Restore the LDAP privilege to its original value.
Sivas SRR73379bc2019-07-22 10:21:45 -0500733
Anves Kumar rayankula5bf342e2020-06-25 08:35:34 -0500734 Return From Keyword If '${old_ldap_privilege}' == '${EMPTY}' or '${old_ldap_privilege}' == '[]'
Sivas SRR939b4b12019-06-26 00:01:59 -0500735 # Log back in to restore the original privilege.
Sivas SRRf4ec6492019-06-16 01:59:30 -0500736 Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE}
737 ... ${old_ldap_privilege} ${GROUP_NAME}
Prashanth Kattife798812020-01-31 07:04:26 -0600738
739 Sleep 18s
740
741
742Update LDAP User Role And Host Poweroff
743 [Documentation] Update LDAP user role and do host poweroff.
744 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}
Prashanth Kattia4f79292020-02-20 03:34:01 -0600745 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login
Prashanth Kattife798812020-01-31 07:04:26 -0600746
747 # Description of argument(s):
748 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
749 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
750 # group_name The group name of user.
751 # valid_status_code The expected valid status code.
752
753 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
754 ... ${group_privilege} ${group_name}
755
756 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
757
758 Redfish.Post ${REDFISH_POWER_URI}
759 ... body={'ResetType': 'ForceOff'} valid_status_codes=[${valid_status_code}]
760
Prashanth Kattia4f79292020-02-20 03:34:01 -0600761
762Update LDAP User Role And Host Poweron
763 [Documentation] Update LDAP user role and do host poweron.
764 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}
765 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login
766
767 # Description of argument(s):
768 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
769 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
770 # group_name The group name of user.
771 # valid_status_code The expected valid status code.
772
773 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
774 ... ${group_privilege} ${group_name}
775
776 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
777
778 Redfish.Post ${REDFISH_POWER_URI}
779 ... body={'ResetType': 'On'} valid_status_codes=[${valid_status_code}]
Prashanth Katti3dc8cc32020-03-04 11:11:01 -0600780
781
782Update LDAP User Role And Configure IP Address
783 [Documentation] Update LDAP user role and configure IP address.
784 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK}
785 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND Delete IP Address ${test_ip}
786
787 # Description of argument(s):
788 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
789 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
790 # group_name The group name of user.
791 # valid_status_code The expected valid status code.
792
793 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
794 ... ${group_privilege} ${group_name}
795
796 Redfish.Logout
797
798 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
799
Anves Kumar rayankula5bf342e2020-06-25 08:35:34 -0500800 ${test_gateway}= Get BMC Default Gateway
801
802 Add IP Address ${test_ip} ${test_mask} ${test_gateway} ${valid_status_code}
Prashanth Kattif90c4742020-03-18 11:08:47 -0500803
804
805Update LDAP User Role And Delete IP Address
806 [Documentation] Update LDAP user role and delete IP address.
807 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK}
808 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND Delete IP Address ${test_ip}
809
810 # Description of argument(s):
811 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
812 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
813 # group_name The group name of user.
814 # valid_status_code The expected valid status code.
815
Anves Kumar rayankula5bf342e2020-06-25 08:35:34 -0500816 ${test_gateway}= Get BMC Default Gateway
817
Prashanth Kattif90c4742020-03-18 11:08:47 -0500818 # Configure IP address before deleting via LDAP user roles.
Anves Kumar rayankula5bf342e2020-06-25 08:35:34 -0500819 Add IP Address ${test_ip} ${test_mask} ${test_gateway}
Prashanth Kattif90c4742020-03-18 11:08:47 -0500820
821 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
822 ... ${group_privilege} ${group_name}
823
824 Redfish.Logout
825
826 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
827
828 Delete IP Address ${test_ip} ${valid_status_code}
Prashanth Katti67e06202020-05-20 06:16:51 -0500829
830
831Update LDAP User Role And Read Network Configuration
832 [Documentation] Update LDAP user role and read network configuration.
833 [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK}
834 [Teardown] Run Keywords Redfish.Logout AND Redfish.Login
835
836 # Description of argument(s):
837 # ldap_type The LDAP type ("ActiveDirectory" or "LDAP").
838 # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess").
839 # group_name The group name of user.
840 # valid_status_code The expected valid status code.
841
842 Update LDAP Configuration with LDAP User Role And Group ${ldap_type}
843 ... ${group_privilege} ${group_name}
844
845 Redfish.Logout
846
847 Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD}
848 Redfish.Get ${REDFISH_NW_ETH0_URI} valid_status_codes=[${valid_status_code}]
Anves Kumar rayankula5bf342e2020-06-25 08:35:34 -0500849