Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test Redfish LDAP user configuration. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 3 | |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 4 | Library ../../lib/gen_robot_valid.py |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 5 | Resource ../../lib/bmc_redfish_resource.robot |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 6 | Resource ../../lib/utils.robot |
George Keishing | db553df | 2022-12-15 10:53:04 -0600 | [diff] [blame] | 7 | Resource ../../lib/openbmc_ffdc.robot |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 8 | Resource ../../lib/bmc_network_utils.robot |
Anves Kumar rayankula | 04bc48c | 2021-07-08 23:33:37 -0500 | [diff] [blame] | 9 | Resource ../../lib/bmc_ldap_utils.robot |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 10 | |
| 11 | Suite Setup Suite Setup Execution |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 12 | Suite Teardown LDAP Suite Teardown Execution |
| 13 | Test Teardown Run Keywords Redfish.Login AND FFDC On Test Case Fail |
George Keishing | 9899a90 | 2023-09-07 20:57:53 +0530 | [diff] [blame] | 14 | Force Tags Ldap_Configuration |
Sivas SRR | 9358b5c | 2019-06-06 04:57:03 -0500 | [diff] [blame] | 15 | |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 16 | *** Variables *** |
Nagarjun B | 1b82161 | 2021-12-06 22:52:04 +0530 | [diff] [blame] | 17 | ${old_ldap_privilege} Administrator |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 18 | &{old_account_service} &{EMPTY} |
Sivas SRR | 873de8e | 2019-09-26 00:37:53 -0500 | [diff] [blame] | 19 | &{old_ldap_config} &{EMPTY} |
| 20 | ${hostname} ${EMPTY} |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 21 | ${test_ip} 10.6.6.6 |
| 22 | ${test_mask} 255.255.255.0 |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 23 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 24 | ** Test Cases ** |
| 25 | |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 26 | Verify LDAP Configuration Created |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 27 | [Documentation] Verify that LDAP configuration created. |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 28 | [Tags] Verify_LDAP_Configuration_Created |
| 29 | |
| 30 | Create LDAP Configuration |
| 31 | # Call 'Get LDAP Configuration' to verify that LDAP configuration exists. |
| 32 | Get LDAP Configuration ${LDAP_TYPE} |
| 33 | Sleep 10s |
| 34 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 35 | Redfish.Logout |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 36 | |
| 37 | |
ganesanb | 628874f | 2023-05-12 01:11:43 +0000 | [diff] [blame] | 38 | Verify Redfish LDAP Service Disable |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 39 | [Documentation] Verify that LDAP is disabled and that LDAP user cannot |
| 40 | ... login. |
ganesanb | 628874f | 2023-05-12 01:11:43 +0000 | [diff] [blame] | 41 | [Tags] Verify_Redfish_LDAP_Service_Disable |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 42 | |
| 43 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 44 | ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${False}}} |
| 45 | Sleep 15s |
| 46 | ${resp}= Run Keyword And Return Status Redfish.Login ${LDAP_USER} |
| 47 | ... ${LDAP_USER_PASSWORD} |
George Keishing | 333bb72 | 2019-12-11 11:40:49 -0600 | [diff] [blame] | 48 | Should Be Equal ${resp} ${False} |
| 49 | ... msg=LDAP user was able to login even though the LDAP service was disabled. |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 50 | Redfish.Logout |
| 51 | Redfish.Login |
| 52 | # Enabling LDAP so that LDAP user works. |
| 53 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 54 | ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}} |
| 55 | Redfish.Logout |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 56 | |
| 57 | |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 58 | Verify LDAP Login With ServiceEnabled |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 59 | [Documentation] Verify that LDAP Login with ServiceEnabled. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 60 | [Tags] Verify_LDAP_Login_With_ServiceEnabled |
| 61 | |
| 62 | Disable Other LDAP |
| 63 | # Actual service enablement. |
| 64 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 65 | ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}} |
| 66 | Sleep 15s |
| 67 | # After update, LDAP login. |
| 68 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 69 | Redfish.Logout |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 70 | |
| 71 | |
| 72 | Verify LDAP Login With Correct AuthenticationType |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 73 | [Documentation] Verify that LDAP Login with right AuthenticationType. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 74 | [Tags] Verify_LDAP_Login_With_Correct_AuthenticationType |
| 75 | |
| 76 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 77 | ... body={'${ldap_type}': {'Authentication': {'AuthenticationType':'UsernameAndPassword'}}} |
| 78 | Sleep 15s |
| 79 | # After update, LDAP login. |
| 80 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 81 | Redfish.Logout |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 82 | |
| 83 | |
| 84 | Verify LDAP Config Update With Incorrect AuthenticationType |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 85 | [Documentation] Verify that invalid AuthenticationType is not updated. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 86 | [Tags] Verify_LDAP_Config_Update_With_Incorrect_AuthenticationType |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 87 | |
George Keishing | 2d0804e | 2019-12-12 22:27:05 -0600 | [diff] [blame] | 88 | ${body}= Catenate {'${ldap_type}': {'Authentication': {'AuthenticationType':'KerberosKeytab'}}} |
Prashanth Katti | 7d38a09 | 2020-01-10 06:01:09 -0600 | [diff] [blame] | 89 | |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 90 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
Prashanth Katti | 7d38a09 | 2020-01-10 06:01:09 -0600 | [diff] [blame] | 91 | ... body=${body} valid_status_codes=[400] |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 92 | |
| 93 | |
| 94 | Verify LDAP Login With Correct LDAP URL |
| 95 | [Documentation] Verify LDAP Login with right LDAP URL. |
| 96 | [Tags] Verify_LDAP_Login_With_Correct_LDAP_URL |
| 97 | |
| 98 | Config LDAP URL ${LDAP_SERVER_URI} |
| 99 | |
| 100 | |
| 101 | Verify LDAP Config Update With Incorrect LDAP URL |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 102 | [Documentation] Verify that LDAP Login fails with invalid LDAP URL. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 103 | [Tags] Verify_LDAP_Config_Update_With_Incorrect_LDAP_URL |
| 104 | [Teardown] Run Keywords Restore LDAP URL AND |
| 105 | ... FFDC On Test Case Fail |
| 106 | |
Prashanth Katti | 7d38a09 | 2020-01-10 06:01:09 -0600 | [diff] [blame] | 107 | Config LDAP URL ldap://1.2.3.4/ ${FALSE} |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 108 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 109 | Verify LDAP Configuration Exist |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 110 | [Documentation] Verify that LDAP configuration is available. |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 111 | [Tags] Verify_LDAP_Configuration_Exist |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 112 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 113 | ${resp}= Redfish.Get Attribute ${REDFISH_BASE_URI}AccountService |
| 114 | ... ${LDAP_TYPE} default=${EMPTY} |
| 115 | Should Not Be Empty ${resp} msg=LDAP configuration is not defined. |
| 116 | |
| 117 | |
| 118 | Verify LDAP User Login |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 119 | [Documentation] Verify that LDAP user able to login into BMC. |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 120 | [Tags] Verify_LDAP_User_Login |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 121 | |
| 122 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 123 | Redfish.Logout |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 124 | |
| 125 | |
| 126 | Verify LDAP Service Available |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 127 | [Documentation] Verify that LDAP service is available. |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 128 | [Tags] Verify_LDAP_Service_Available |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 129 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 130 | @{ldap_configuration}= Get LDAP Configuration ${LDAP_TYPE} |
| 131 | Should Contain ${ldap_configuration} LDAPService |
| 132 | ... msg=LDAPService is not available. |
| 133 | |
| 134 | |
Sivas SRR | 108f9d3 | 2019-06-03 10:05:34 -0500 | [diff] [blame] | 135 | Verify LDAP Login Works After BMC Reboot |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 136 | [Documentation] Verify that LDAP login works after BMC reboot. |
Sivas SRR | 108f9d3 | 2019-06-03 10:05:34 -0500 | [diff] [blame] | 137 | [Tags] Verify_LDAP_Login_Works_After_BMC_Reboot |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 138 | |
Sivas SRR | 108f9d3 | 2019-06-03 10:05:34 -0500 | [diff] [blame] | 139 | Redfish OBMC Reboot (off) |
| 140 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 141 | Redfish.Logout |
| 142 | |
| 143 | |
| 144 | Verify LDAP User With Admin Privilege Able To Do BMC Reboot |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 145 | [Documentation] Verify that LDAP user with administrator privilege able to do BMC reboot. |
Sivas SRR | 108f9d3 | 2019-06-03 10:05:34 -0500 | [diff] [blame] | 146 | [Tags] Verify_LDAP_User_With_Admin_Privilege_Able_To_Do_BMC_Reboot |
| 147 | |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 148 | |
Sivas SRR | 108f9d3 | 2019-06-03 10:05:34 -0500 | [diff] [blame] | 149 | Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE} |
| 150 | ... ${GROUP_PRIVILEGE} ${GROUP_NAME} |
| 151 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 152 | # With LDAP user and with right privilege trying to do BMC reboot. |
| 153 | Redfish OBMC Reboot (off) |
| 154 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 155 | Redfish.Logout |
| 156 | |
| 157 | |
Sivas SRR | 2b83ec0 | 2019-07-12 11:30:20 -0500 | [diff] [blame] | 158 | Verify LDAP User With Operator Privilege Able To Do Host Poweroff |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 159 | [Documentation] Verify that LDAP user with operator privilege can do host |
| 160 | ... power off. |
Sivas SRR | 2b83ec0 | 2019-07-12 11:30:20 -0500 | [diff] [blame] | 161 | [Tags] Verify_LDAP_User_With_Operator_Privilege_Able_To_Do_Host_Poweroff |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 162 | [Teardown] Restore LDAP Privilege |
| 163 | |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 164 | Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE} |
| 165 | ... Operator ${GROUP_NAME} |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 166 | |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 167 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
Sivas SRR | 2b83ec0 | 2019-07-12 11:30:20 -0500 | [diff] [blame] | 168 | # Verify that the LDAP user with operator privilege is able to power the system off. |
| 169 | Redfish.Post ${REDFISH_POWER_URI} |
Sivas SRR | 3d82b3c | 2019-07-12 12:20:04 -0500 | [diff] [blame] | 170 | ... body={'ResetType': 'ForceOff'} valid_status_codes=[200] |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 171 | Redfish.Logout |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 172 | Redfish.Login |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 173 | |
| 174 | |
Prashanth Katti | 12e2040 | 2022-01-12 05:19:23 -0600 | [diff] [blame] | 175 | Verify AccountLockout Attributes Set To Zero By LDAP User |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 176 | [Documentation] Verify that attribute AccountLockoutDuration and |
Prashanth Katti | 12e2040 | 2022-01-12 05:19:23 -0600 | [diff] [blame] | 177 | ... AccountLockoutThreshold are set to 0 by LDAP user. |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 178 | [Teardown] Run Keywords Restore AccountLockout Attributes AND |
| 179 | ... FFDC On Test Case Fail |
Prashanth Katti | 12e2040 | 2022-01-12 05:19:23 -0600 | [diff] [blame] | 180 | [Tags] Verify_AccountLockout_Attributes_Set_To_Zero_By_LDAP_User |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 181 | |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 182 | ${old_account_service}= Redfish.Get Properties |
| 183 | ... ${REDFISH_BASE_URI}AccountService |
Michael Walsh | 39c0051 | 2019-07-17 10:54:06 -0500 | [diff] [blame] | 184 | Rprint Vars old_account_service |
Prashanth Katti | 12e2040 | 2022-01-12 05:19:23 -0600 | [diff] [blame] | 185 | |
| 186 | # Create LDAP user and create session using LDAP user. |
| 187 | Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE} |
| 188 | ... Administrator ${GROUP_NAME} |
| 189 | |
| 190 | # Clear existing Redfish sessions. |
| 191 | Redfish.Logout |
| 192 | |
| 193 | # Login using LDAP user. |
| 194 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 195 | |
| 196 | # Set Account Lockout attributes using LDAP user. |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 197 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 198 | ... body=[('AccountLockoutDuration', 0)] |
| 199 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 200 | ... body=[('AccountLockoutThreshold', 0)] |
| 201 | |
| 202 | |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 203 | Verify LDAP User With Read Privilege Able To Check Inventory |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 204 | [Documentation] Verify that LDAP user with read privilege able to |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 205 | ... read firmware inventory. |
| 206 | [Tags] Verify_LDAP_User_With_Read_Privilege_Able_To_Check_Inventory |
| 207 | [Teardown] Run Keywords FFDC On Test Case Fail AND Restore LDAP Privilege |
| 208 | [Template] Set Read Privilege And Check Firmware Inventory |
| 209 | |
Prashanth Katti | edce4a9 | 2020-01-16 07:28:39 -0600 | [diff] [blame] | 210 | ReadOnly |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 211 | |
| 212 | |
| 213 | Verify LDAP User With Read Privilege Should Not Do Host Poweron |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 214 | [Documentation] Verify that LDAP user with read privilege should not be |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 215 | ... allowed to power on the host. |
| 216 | [Tags] Verify_LDAP_User_With_Read_Privilege_Should_Not_Do_Host_Poweron |
| 217 | [Teardown] Run Keywords FFDC On Test Case Fail AND Restore LDAP Privilege |
| 218 | [Template] Set Read Privilege And Check Poweron |
| 219 | |
Prashanth Katti | edce4a9 | 2020-01-16 07:28:39 -0600 | [diff] [blame] | 220 | ReadOnly |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 221 | |
| 222 | |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 223 | Update LDAP Group Name And Verify Operations |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 224 | [Documentation] Verify that LDAP group name update and able to do right |
| 225 | ... operations. |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 226 | [Tags] Update_LDAP_Group_Name_And_Verify_Operations |
| 227 | [Template] Update LDAP Config And Verify Set Host Name |
| 228 | [Teardown] Restore LDAP Privilege |
| 229 | |
| 230 | # group_name group_privilege valid_status_codes |
Anves Kumar rayankula | 9954c4c | 2020-07-31 05:49:16 -0500 | [diff] [blame] | 231 | ${GROUP_NAME} Administrator [${HTTP_OK}, ${HTTP_NO_CONTENT}] |
Prashanth Katti | c5d0706 | 2021-07-07 03:05:37 -0500 | [diff] [blame] | 232 | ${GROUP_NAME} Operator [${HTTP_OK}, ${HTTP_NO_CONTENT}] |
Prashanth Katti | edce4a9 | 2020-01-16 07:28:39 -0600 | [diff] [blame] | 233 | ${GROUP_NAME} ReadOnly [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}] |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 234 | Invalid_LDAP_Group_Name Administrator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}] |
| 235 | Invalid_LDAP_Group_Name Operator [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}] |
Prashanth Katti | edce4a9 | 2020-01-16 07:28:39 -0600 | [diff] [blame] | 236 | Invalid_LDAP_Group_Name ReadOnly [${HTTP_UNAUTHORIZED}, ${HTTP_FORBIDDEN}] |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 237 | |
| 238 | |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 239 | Verify LDAP BaseDN Update And LDAP Login |
| 240 | [Documentation] Update LDAP BaseDN of LDAP configuration and verify |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 241 | ... that LDAP login works. |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 242 | [Tags] Verify_LDAP_BaseDN_Update_And_LDAP_Login |
| 243 | |
| 244 | |
| 245 | ${body}= Catenate {'${LDAP_TYPE}': { 'LDAPService': {'SearchSettings': |
| 246 | ... {'BaseDistinguishedNames': ['${LDAP_BASE_DN}']}}}} |
| 247 | Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body} |
| 248 | Sleep 15s |
| 249 | Redfish Verify LDAP Login |
| 250 | |
| 251 | |
| 252 | Verify LDAP BindDN Update And LDAP Login |
| 253 | [Documentation] Update LDAP BindDN of LDAP configuration and verify |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 254 | ... that LDAP login works. |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 255 | [Tags] Verify_LDAP_BindDN_Update_And_LDAP_Login |
| 256 | |
| 257 | ${body}= Catenate {'${LDAP_TYPE}': { 'Authentication': |
| 258 | ... {'AuthenticationType':'UsernameAndPassword', 'Username': |
| 259 | ... '${LDAP_BIND_DN}'}}} |
| 260 | Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body} |
| 261 | Sleep 15s |
| 262 | Redfish Verify LDAP Login |
| 263 | |
| 264 | |
| 265 | Verify LDAP BindDN Password Update And LDAP Login |
| 266 | [Documentation] Update LDAP BindDN password of LDAP configuration and |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 267 | ... verify that LDAP login works. |
George Keishing | 0c8100f | 2022-01-13 00:24:57 -0600 | [diff] [blame] | 268 | [Tags] Verify_LDAP_BindDN_Password_Update_And_LDAP_Login |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 269 | |
| 270 | |
| 271 | ${body}= Catenate {'${LDAP_TYPE}': { 'Authentication': |
| 272 | ... {'AuthenticationType':'UsernameAndPassword', 'Password': |
| 273 | ... '${LDAP_BIND_DN_PASSWORD}'}}} |
| 274 | Redfish.Patch ${REDFISH_BASE_URI}AccountService body=${body} |
| 275 | Sleep 15s |
| 276 | Redfish Verify LDAP Login |
| 277 | |
| 278 | |
| 279 | Verify LDAP Type Update And LDAP Login |
| 280 | [Documentation] Update LDAP type of LDAP configuration and verify |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 281 | ... that LDAP login works. |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 282 | [Tags] Verify_LDAP_Type_Update_And_LDAP_Login |
| 283 | |
| 284 | Disable Other LDAP |
| 285 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 286 | ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${True}}} |
| 287 | Sleep 15s |
| 288 | Redfish Verify LDAP Login |
| 289 | |
| 290 | |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 291 | Verify LDAP Authorization With Null Privilege |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 292 | [Documentation] Verify the failure of LDAP authorization with empty |
| 293 | ... privilege. |
| 294 | [Tags] Verify_LDAP_Authorization_With_Null_Privilege |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 295 | [Teardown] Restore LDAP Privilege |
| 296 | |
| 297 | Update LDAP Config And Verify Set Host Name ${GROUP_NAME} ${EMPTY} |
| 298 | ... [${HTTP_FORBIDDEN}] |
| 299 | |
| 300 | |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 301 | Verify LDAP Authorization With Invalid Privilege |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 302 | [Documentation] Verify that LDAP user authorization with wrong privilege |
| 303 | ... fails. |
| 304 | [Tags] Verify_LDAP_Authorization_With_Invalid_Privilege |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 305 | [Teardown] Restore LDAP Privilege |
| 306 | |
| 307 | Update LDAP Config And Verify Set Host Name ${GROUP_NAME} |
| 308 | ... Invalid_Privilege [${HTTP_FORBIDDEN}] |
| 309 | |
| 310 | |
| 311 | Verify LDAP Login With Invalid Data |
| 312 | [Documentation] Verify that LDAP login with Invalid LDAP data and |
| 313 | ... right LDAP user fails. |
| 314 | [Tags] Verify_LDAP_Login_With_Invalid_Data |
| 315 | [Teardown] Run Keywords FFDC On Test Case Fail AND |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 316 | ... Redfish.Login AND |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 317 | ... Create LDAP Configuration |
| 318 | |
| 319 | Create LDAP Configuration ${LDAP_TYPE} Invalid_LDAP_Server_URI |
| 320 | ... Invalid_LDAP_BIND_DN LDAP_BIND_DN_PASSWORD |
| 321 | ... Invalid_LDAP_BASE_DN |
| 322 | Sleep 15s |
| 323 | Redfish Verify LDAP Login ${False} |
| 324 | |
| 325 | |
ganesanb | 628874f | 2023-05-12 01:11:43 +0000 | [diff] [blame] | 326 | Verify LDAP Config Creation Without BASE DN |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 327 | [Documentation] Verify that LDAP login with LDAP configuration |
| 328 | ... created without BASE_DN fails. |
| 329 | [Tags] Verify_LDAP_Config_Creation_Without_BASE_DN |
| 330 | [Teardown] Run Keywords FFDC On Test Case Fail AND |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 331 | ... Redfish.Login AND |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 332 | ... Create LDAP Configuration |
| 333 | |
| 334 | Create LDAP Configuration ${LDAP_TYPE} Invalid_LDAP_Server_URI |
| 335 | ... Invalid_LDAP_BIND_DN LDAP_BIND_DN_PASSWORD ${EMPTY} |
| 336 | Sleep 15s |
| 337 | Redfish Verify LDAP Login ${False} |
| 338 | |
| 339 | |
| 340 | Verify LDAP Authentication Without Password |
| 341 | [Documentation] Verify that LDAP user authentication without LDAP |
| 342 | ... user password fails. |
| 343 | [Tags] Verify_LDAP_Authentication_Without_Password |
Anves Kumar rayankula | 5bf342e | 2020-06-25 08:35:34 -0500 | [diff] [blame] | 344 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 345 | |
| 346 | ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER} |
| 347 | Valid Value status [${False}] |
| 348 | |
| 349 | |
ganesanb | 628874f | 2023-05-12 01:11:43 +0000 | [diff] [blame] | 350 | Verify LDAP Login With Invalid BASE DN |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 351 | [Documentation] Verify that LDAP login with invalid BASE_DN and |
| 352 | ... valid LDAP user fails. |
| 353 | [Tags] Verify_LDAP_Login_With_Invalid_BASE_DN |
| 354 | [Teardown] Run Keywords FFDC On Test Case Fail AND |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 355 | ... Redfish.Login AND |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 356 | ... Create LDAP Configuration |
| 357 | |
| 358 | Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI} |
| 359 | ... ${LDAP_BIND_DN} ${LDAP_BIND_DN_PASSWORD} Invalid_LDAP_BASE_DN |
| 360 | Sleep 15s |
| 361 | Redfish Verify LDAP Login ${False} |
| 362 | |
| 363 | |
| 364 | Verify LDAP Login With Invalid BIND_DN_PASSWORD |
| 365 | [Documentation] Verify that LDAP login with invalid BIND_DN_PASSWORD and |
| 366 | ... valid LDAP user fails. |
| 367 | [Tags] Verify_LDAP_Login_With_Invalid_BIND_DN_PASSWORD |
| 368 | [Teardown] Run Keywords FFDC On Test Case Fail AND |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 369 | ... Redfish.Login AND |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 370 | ... Create LDAP Configuration |
| 371 | |
| 372 | Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI} |
| 373 | ... ${LDAP_BIND_DN} INVALID_LDAP_BIND_DN_PASSWORD ${LDAP_BASE_DN} |
| 374 | Sleep 15s |
| 375 | Redfish Verify LDAP Login ${False} |
| 376 | |
| 377 | |
ganesanb | 628874f | 2023-05-12 01:11:43 +0000 | [diff] [blame] | 378 | Verify LDAP Login With Invalid BASE DN And Invalid BIND DN |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 379 | [Documentation] Verify that LDAP login with invalid BASE_DN and invalid |
| 380 | ... BIND_DN and valid LDAP user fails. |
| 381 | [Tags] Verify_LDAP_Login_With_Invalid_BASE_DN_And_Invalid_BIND_DN |
| 382 | [Teardown] Run Keywords FFDC On Test Case Fail AND |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 383 | ... Redfish.Login AND |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 384 | ... Create LDAP Configuration |
| 385 | |
| 386 | Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI} |
| 387 | ... INVALID_LDAP_BIND_DN ${LDAP_BIND_DN_PASSWORD} INVALID_LDAP_BASE_DN |
| 388 | Sleep 15s |
| 389 | Redfish Verify LDAP Login ${False} |
| 390 | |
| 391 | |
| 392 | Verify Group Name And Group Privilege Able To Modify |
| 393 | [Documentation] Verify that LDAP group name and group privilege able to |
| 394 | ... modify. |
| 395 | [Tags] Verify_Group_Name_And_Group_Privilege_Able_To_Modify |
Sivas SRR | 873de8e | 2019-09-26 00:37:53 -0500 | [diff] [blame] | 396 | [Setup] Update LDAP Configuration with LDAP User Role And Group |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 397 | ... ${LDAP_TYPE} Operator ${GROUP_NAME} |
| 398 | |
| 399 | Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE} |
| 400 | ... Administrator ${GROUP_NAME} |
| 401 | |
| 402 | |
ganesanb | 628874f | 2023-05-12 01:11:43 +0000 | [diff] [blame] | 403 | Verify LDAP Login With Invalid BIND DN |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 404 | [Documentation] Verify that LDAP login with invalid BIND_DN and |
| 405 | ... valid LDAP user fails. |
| 406 | [Tags] Verify_LDAP_Login_With_Invalid_BIND_DN |
| 407 | [Teardown] Run Keywords FFDC On Test Case Fail AND |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 408 | ... Redfish.Login AND |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 409 | ... Create LDAP Configuration |
| 410 | |
| 411 | Create LDAP Configuration ${LDAP_TYPE} ${LDAP_SERVER_URI} |
| 412 | ... Invalid_LDAP_BIND_DN ${LDAP_BIND_DN_PASSWORD} ${LDAP_BASE_DN} |
| 413 | Sleep 15s |
| 414 | Redfish Verify LDAP Login ${False} |
| 415 | |
| 416 | |
| 417 | Verify LDAP Authentication With Invalid LDAP User |
| 418 | [Documentation] Verify that LDAP user authentication for user not exist |
| 419 | ... in LDAP server and fails. |
| 420 | [Tags] Verify_LDAP_Authentication_With_Invalid_LDAP_User |
Anves Kumar rayankula | 9954c4c | 2020-07-31 05:49:16 -0500 | [diff] [blame] | 421 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 422 | |
| 423 | ${status}= Run Keyword And Return Status Redfish.Login INVALID_LDAP_USER |
| 424 | ... ${LDAP_USER_PASSWORD} |
| 425 | Valid Value status [${False}] |
| 426 | |
| 427 | |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 428 | Update LDAP User Roles And Verify Host Poweroff Operation |
| 429 | [Documentation] Update LDAP user roles and verify host poweroff operation. |
| 430 | [Tags] Update_LDAP_User_Roles_And_Verify_Host_Poweroff_Operation |
| 431 | [Teardown] Restore LDAP Privilege |
| 432 | |
| 433 | [Template] Update LDAP User Role And Host Poweroff |
| 434 | # ldap_type group_privilege group_name valid_status_codes |
| 435 | |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 436 | # Verify LDAP user with ReadOnly privilege not able to do host poweroff. |
| 437 | ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN} |
| 438 | |
| 439 | # Verify LDAP user with Operator privilege able to do host poweroff. |
| 440 | ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK} |
| 441 | |
| 442 | # Verify LDAP user with Administrator privilege able to do host poweroff. |
| 443 | ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK} |
| 444 | |
| 445 | |
Prashanth Katti | a4f7929 | 2020-02-20 03:34:01 -0600 | [diff] [blame] | 446 | Update LDAP User Roles And Verify Host Poweron Operation |
| 447 | [Documentation] Update LDAP user roles and verify host poweron operation. |
| 448 | [Tags] Update_LDAP_User_Roles_And_Verify_Host_Poweron_Operation |
| 449 | [Teardown] Restore LDAP Privilege |
| 450 | |
| 451 | [Template] Update LDAP User Role And Host Poweron |
| 452 | # ldap_type group_privilege group_name valid_status_codes |
| 453 | |
Prashanth Katti | a4f7929 | 2020-02-20 03:34:01 -0600 | [diff] [blame] | 454 | # Verify LDAP user with ReadOnly privilege not able to do host poweron. |
| 455 | ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN} |
| 456 | |
| 457 | # Verify LDAP user with Operator privilege able to do host poweron. |
| 458 | ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK} |
| 459 | |
| 460 | # Verify LDAP user with Administrator privilege able to do host poweron. |
| 461 | ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK} |
| 462 | |
| 463 | |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 464 | Configure IP Address Via Different User Roles And Verify |
| 465 | [Documentation] Configure IP address via different user roles and verify. |
| 466 | [Tags] Configure_IP_Address_Via_Different_User_Roles_And_Verify |
| 467 | [Teardown] Restore LDAP Privilege |
| 468 | |
| 469 | [Template] Update LDAP User Role And Configure IP Address |
| 470 | # Verify LDAP user with Administrator privilege is able to configure IP address. |
| 471 | ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK} |
| 472 | |
| 473 | # Verify LDAP user with ReadOnly privilege is forbidden to configure IP address. |
| 474 | ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_FORBIDDEN} |
| 475 | |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 476 | # Verify LDAP user with Operator privilege is able to configure IP address. |
Sweta Potthuri | f4c86a0 | 2022-02-02 10:11:22 -0600 | [diff] [blame] | 477 | ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_FORBIDDEN} |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 478 | |
| 479 | |
Prashanth Katti | f90c474 | 2020-03-18 11:08:47 -0500 | [diff] [blame] | 480 | Delete 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 | |
Prashanth Katti | f90c474 | 2020-03-18 11:08:47 -0500 | [diff] [blame] | 492 | # Verify LDAP user with Operator privilege is able to delete IP address. |
Sweta Potthuri | f4c86a0 | 2022-02-02 10:11:22 -0600 | [diff] [blame] | 493 | ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_FORBIDDEN} |
Prashanth Katti | f90c474 | 2020-03-18 11:08:47 -0500 | [diff] [blame] | 494 | |
| 495 | |
Prashanth Katti | 67e0620 | 2020-05-20 06:16:51 -0500 | [diff] [blame] | 496 | Read Network Configuration Via Different User Roles And Verify |
David Shaw | 8e6d4ee | 2020-06-12 10:03:59 -0500 | [diff] [blame] | 497 | [Documentation] Read network configuration via different user roles and verify. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 498 | [Tags] Read_Network_Configuration_Via_Different_User_Roles_And_Verify |
Prashanth Katti | 67e0620 | 2020-05-20 06:16:51 -0500 | [diff] [blame] | 499 | [Teardown] Restore LDAP Privilege |
| 500 | |
| 501 | [Template] Update LDAP User Role And Read Network Configuration |
| 502 | ${LDAP_TYPE} Administrator ${GROUP_NAME} ${HTTP_OK} |
| 503 | |
| 504 | ${LDAP_TYPE} ReadOnly ${GROUP_NAME} ${HTTP_OK} |
| 505 | |
Prashanth Katti | 67e0620 | 2020-05-20 06:16:51 -0500 | [diff] [blame] | 506 | ${LDAP_TYPE} Operator ${GROUP_NAME} ${HTTP_OK} |
| 507 | |
Sweta Potthuri | aa8cda9 | 2022-10-19 04:45:08 -0500 | [diff] [blame] | 508 | Switch LDAP Type And Verify Login Fails |
| 509 | [Documentation] Switch LDAP type and verify login fails. |
| 510 | [Tags] Switch_LDAP_Type_And_Verify_Login_Fails |
| 511 | |
| 512 | # Check Login with LDAP Type is working |
| 513 | Create LDAP Configuration |
| 514 | Redfish Verify LDAP Login |
| 515 | |
| 516 | # Disable the LDAP Type from OpenLDAP to ActiveDirectory or vice-versa |
| 517 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 518 | ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${False}}} |
| 519 | |
| 520 | # Enable the inverse LDAP type |
| 521 | Disable Other LDAP ${True} |
| 522 | Create LDAP Configuration ${LDAP_TYPE_1} ${LDAP_SERVER_URI_1} ${LDAP_BIND_DN_1} ${LDAP_BIND_DN_PASSWORD_1} ${LDAP_BASE_DN_1} |
| 523 | Redfish.Logout |
| 524 | Sleep 10s |
| 525 | |
| 526 | # Check if Login works via Inverse LDAP |
| 527 | Redfish.Login ${LDAP_USER_1} ${LDAP_USER_PASSWORD_1} |
| 528 | Redfish.Logout |
| 529 | Sleep 10s |
| 530 | |
| 531 | # Login using LDAP type must fail |
| 532 | Redfish Verify LDAP Login ${False} |
| 533 | Redfish.Logout |
Prashanth Katti | 67e0620 | 2020-05-20 06:16:51 -0500 | [diff] [blame] | 534 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 535 | *** Keywords *** |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 536 | |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 537 | Redfish Verify LDAP Login |
| 538 | [Documentation] LDAP user log into BMC. |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 539 | [Arguments] ${valid_status}=${True} |
| 540 | |
| 541 | # Description of argument(s): |
| 542 | # valid_status Expected status of LDAP login ("True" or "False"). |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 543 | |
| 544 | # According to our repo coding rules, Redfish.Login is to be done in Suite |
| 545 | # Setup and Redfish.Logout is to be done in Suite Teardown. For any |
| 546 | # deviation from this rule (such as in this keyword), the deviant code |
| 547 | # must take steps to restore us to our original logged-in state. |
| 548 | |
Sivas SRR | 6f8ac5d | 2019-08-27 01:09:52 -0500 | [diff] [blame] | 549 | ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER} |
| 550 | ... ${LDAP_USER_PASSWORD} |
| 551 | Valid Value status [${valid_status}] |
Sivas SRR | a031d2d | 2019-08-16 07:49:52 -0500 | [diff] [blame] | 552 | Redfish.Logout |
| 553 | Redfish.Login |
| 554 | |
| 555 | |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 556 | Update LDAP Config And Verify Set Host Name |
| 557 | [Documentation] Update LDAP config and verify by attempting to set host name. |
| 558 | [Arguments] ${group_name} ${group_privilege}=Administrator |
| 559 | ... ${valid_status_codes}=[${HTTP_OK}] |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 560 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 561 | |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 562 | # Description of argument(s): |
| 563 | # group_name The group name of user. |
| 564 | # group_privilege The group privilege ("Administrator", |
| 565 | # "Operator", "User" or "Callback"). |
| 566 | # valid_status_codes Expected return code(s) from patch |
| 567 | # operation (e.g. "200") used to update |
| 568 | # HostName. See prolog of rest_request |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 569 | # method in redfish_plus.py for details. |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 570 | Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE} |
| 571 | ... ${group_privilege} ${group_name} |
Nagarjun B | 1b82161 | 2021-12-06 22:52:04 +0530 | [diff] [blame] | 572 | |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 573 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 574 | # Verify that the LDAP user in ${group_name} with the given privilege is |
| 575 | # allowed to change the hostname. |
Anves Kumar rayankula | f853363 | 2021-05-31 02:52:19 -0500 | [diff] [blame] | 576 | Redfish.Patch ${REDFISH_NW_ETH0_URI} body={'HostName': '${hostname}'} |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 577 | ... valid_status_codes=${valid_status_codes} |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 578 | |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 579 | Disable Other LDAP |
| 580 | [Documentation] Disable other LDAP configuration. |
Sweta Potthuri | aa8cda9 | 2022-10-19 04:45:08 -0500 | [diff] [blame] | 581 | [Arguments] ${service_state}=${False} |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 582 | |
| 583 | # First disable other LDAP. |
| 584 | ${inverse_ldap_type}= Set Variable If '${LDAP_TYPE}' == 'LDAP' ActiveDirectory LDAP |
| 585 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
Sweta Potthuri | aa8cda9 | 2022-10-19 04:45:08 -0500 | [diff] [blame] | 586 | ... body={'${inverse_ldap_type}': {'ServiceEnabled': ${service_state}}} |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 587 | Sleep 15s |
| 588 | |
| 589 | |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 590 | Config LDAP URL |
| 591 | [Documentation] Config LDAP URL. |
Prashanth Katti | 7d38a09 | 2020-01-10 06:01:09 -0600 | [diff] [blame] | 592 | [Arguments] ${ldap_server_uri}=${LDAP_SERVER_URI} ${expected_status}=${TRUE} |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 593 | |
| 594 | # Description of argument(s): |
| 595 | # ldap_server_uri LDAP server uri (e.g. "ldap://XX.XX.XX.XX/"). |
| 596 | |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 597 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 598 | ... body={'${ldap_type}': {'ServiceAddresses': ['${ldap_server_uri}']}} |
| 599 | Sleep 15s |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 600 | # After update, LDAP login. |
Prashanth Katti | 7d38a09 | 2020-01-10 06:01:09 -0600 | [diff] [blame] | 601 | ${status}= Run Keyword And Return Status Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 602 | Valid Value status [${expected_status}] |
| 603 | |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 604 | Redfish.Logout |
| 605 | Redfish.Login |
| 606 | |
| 607 | |
| 608 | Restore LDAP URL |
| 609 | [Documentation] Restore LDAP URL. |
| 610 | |
| 611 | # Restoring the working LDAP server uri. |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 612 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 613 | ... body={'${ldap_type}': {'ServiceAddresses': ['${LDAP_SERVER_URI}']}} |
Sivas SRR | b1b8575 | 2019-07-04 01:28:28 -0500 | [diff] [blame] | 614 | Sleep 15s |
| 615 | |
| 616 | |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 617 | Restore AccountLockout Attributes |
| 618 | [Documentation] Restore AccountLockout Attributes. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 619 | |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 620 | Return From Keyword If &{old_account_service} == &{EMPTY} |
| 621 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 622 | ... body=[('AccountLockoutDuration', ${old_account_service['AccountLockoutDuration']})] |
| 623 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
Wilson Suen | 70523a9 | 2023-12-28 17:49:02 -0800 | [diff] [blame^] | 624 | ... body=[('AccountLockoutThreshold', ${old_account_service['AccountLockoutThreshold']})] |
Sivas SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 625 | |
| 626 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 627 | Suite Setup Execution |
| 628 | [Documentation] Do suite setup tasks. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 629 | |
Michael Walsh | e7edb22 | 2019-08-19 17:39:38 -0500 | [diff] [blame] | 630 | Valid Value LDAP_TYPE valid_values=["ActiveDirectory", "LDAP"] |
| 631 | Valid Value LDAP_USER |
| 632 | Valid Value LDAP_USER_PASSWORD |
| 633 | Valid Value GROUP_PRIVILEGE |
| 634 | Valid Value GROUP_NAME |
| 635 | Valid Value LDAP_SERVER_URI |
| 636 | Valid Value LDAP_BIND_DN_PASSWORD |
| 637 | Valid Value LDAP_BIND_DN |
| 638 | Valid Value LDAP_BASE_DN |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 639 | |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 640 | Redfish.Login |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 641 | # Call 'Get LDAP Configuration' to verify that LDAP configuration exists. |
| 642 | Get LDAP Configuration ${LDAP_TYPE} |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 643 | Set Suite Variable ${old_ldap_privilege} |
Sivas SRR | cde694c | 2019-09-09 12:20:34 -0500 | [diff] [blame] | 644 | Disable Other LDAP |
Sivas SRR | 873de8e | 2019-09-26 00:37:53 -0500 | [diff] [blame] | 645 | Create LDAP Configuration |
| 646 | ${hostname}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 647 | |
| 648 | |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 649 | LDAP Suite Teardown Execution |
| 650 | [Documentation] Restore ldap configuration, delete unused redfish session. |
| 651 | |
| 652 | Restore LDAP Privilege |
| 653 | Redfish.Logout |
| 654 | Run Keyword And Ignore Error Delete All Redfish Sessions |
| 655 | |
| 656 | |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 657 | Set 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 SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 672 | Redfish.Logout |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 673 | Redfish.Login |
| 674 | |
| 675 | |
| 676 | Set 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 SRR | d21c984 | 2019-06-21 05:41:18 -0500 | [diff] [blame] | 690 | |
| 691 | |
Sivas SRR | 7d7bae3 | 2019-05-29 00:31:14 -0500 | [diff] [blame] | 692 | Get 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 SRR | 108f9d3 | 2019-06-03 10:05:34 -0500 | [diff] [blame] | 701 | |
| 702 | |
| 703 | Update 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 SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 717 | # Provide adequate time for LDAP daemon to restart after the update. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 718 | Sleep 15s |
Sivas SRR | 108f9d3 | 2019-06-03 10:05:34 -0500 | [diff] [blame] | 719 | |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 720 | |
| 721 | Get LDAP Privilege |
| 722 | [Documentation] Get LDAP privilege and return it. |
Sivas SRR | 73379bc | 2019-07-22 10:21:45 -0500 | [diff] [blame] | 723 | |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 724 | ${ldap_config}= Get LDAP Configuration ${LDAP_TYPE} |
Sivas SRR | e9a4786 | 2019-08-05 07:13:43 -0500 | [diff] [blame] | 725 | ${num_list_entries}= Get Length ${ldap_config["RemoteRoleMapping"]} |
| 726 | Return From Keyword If ${num_list_entries} == ${0} @{EMPTY} |
| 727 | |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 728 | [Return] ${ldap_config["RemoteRoleMapping"][0]["LocalRole"]} |
| 729 | |
| 730 | |
| 731 | Restore LDAP Privilege |
| 732 | [Documentation] Restore the LDAP privilege to its original value. |
George Keishing | 538f174 | 2022-03-14 05:00:55 -0500 | [diff] [blame] | 733 | |
Nagarjun B | 1b82161 | 2021-12-06 22:52:04 +0530 | [diff] [blame] | 734 | Redfish.Login |
Anves Kumar rayankula | 5bf342e | 2020-06-25 08:35:34 -0500 | [diff] [blame] | 735 | Return From Keyword If '${old_ldap_privilege}' == '${EMPTY}' or '${old_ldap_privilege}' == '[]' |
Sivas SRR | 939b4b1 | 2019-06-26 00:01:59 -0500 | [diff] [blame] | 736 | # Log back in to restore the original privilege. |
Sivas SRR | f4ec649 | 2019-06-16 01:59:30 -0500 | [diff] [blame] | 737 | Update LDAP Configuration with LDAP User Role And Group ${LDAP_TYPE} |
| 738 | ... ${old_ldap_privilege} ${GROUP_NAME} |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 739 | |
| 740 | Sleep 18s |
| 741 | |
Nagarjun B | 1b82161 | 2021-12-06 22:52:04 +0530 | [diff] [blame] | 742 | Verify Host Power Status |
| 743 | [Documentation] Verify the Host power status and do host power on/off respectively. |
| 744 | [Arguments] ${expected_power_status} |
| 745 | |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 746 | # Description of argument(s): |
| 747 | # expected_power_status State of Host e.g. Off or On. |
| 748 | |
Nagarjun B | 1b82161 | 2021-12-06 22:52:04 +0530 | [diff] [blame] | 749 | ${power_status}= Redfish.Get Attribute /redfish/v1/Chassis/${CHASSIS_ID} PowerState |
| 750 | Return From Keyword If '${power_status}' == '${expected_power_status}' |
| 751 | |
| 752 | Run Keyword If '${power_status}' == 'Off' Redfish Power On |
| 753 | ... ELSE Redfish Power Off |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 754 | |
| 755 | Update LDAP User Role And Host Poweroff |
| 756 | [Documentation] Update LDAP user role and do host poweroff. |
| 757 | [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code} |
Prashanth Katti | a4f7929 | 2020-02-20 03:34:01 -0600 | [diff] [blame] | 758 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 759 | |
| 760 | # Description of argument(s): |
| 761 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 762 | # group_privilege The group privilege ("Administrator", "Operator" or "ReadOnly"). |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 763 | # group_name The group name of user. |
| 764 | # valid_status_code The expected valid status code. |
| 765 | |
Nagarjun B | 1b82161 | 2021-12-06 22:52:04 +0530 | [diff] [blame] | 766 | # check Host state and do the power on/off if needed. |
| 767 | Verify Host Power Status On |
| 768 | |
Prashanth Katti | fe79881 | 2020-01-31 07:04:26 -0600 | [diff] [blame] | 769 | Update LDAP Configuration with LDAP User Role And Group ${ldap_type} |
| 770 | ... ${group_privilege} ${group_name} |
| 771 | |
| 772 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 773 | |
| 774 | Redfish.Post ${REDFISH_POWER_URI} |
| 775 | ... body={'ResetType': 'ForceOff'} valid_status_codes=[${valid_status_code}] |
| 776 | |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 777 | Return From Keyword If ${valid_status_code} == ${HTTP_FORBIDDEN} |
| 778 | Wait Until Keyword Succeeds 1 min 10 sec Verify Host Power State Off |
| 779 | |
| 780 | |
Prashanth Katti | a4f7929 | 2020-02-20 03:34:01 -0600 | [diff] [blame] | 781 | Update LDAP User Role And Host Poweron |
| 782 | [Documentation] Update LDAP user role and do host poweron. |
| 783 | [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code} |
| 784 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
| 785 | |
| 786 | # Description of argument(s): |
| 787 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 788 | # group_privilege The group privilege ("Administrator", "Operator" or "ReadOnly"). |
Prashanth Katti | a4f7929 | 2020-02-20 03:34:01 -0600 | [diff] [blame] | 789 | # group_name The group name of user. |
| 790 | # valid_status_code The expected valid status code. |
| 791 | |
Nagarjun B | 1b82161 | 2021-12-06 22:52:04 +0530 | [diff] [blame] | 792 | # check Host state and do the power on/off if needed. |
| 793 | Verify Host Power Status Off |
| 794 | |
Prashanth Katti | a4f7929 | 2020-02-20 03:34:01 -0600 | [diff] [blame] | 795 | Update LDAP Configuration with LDAP User Role And Group ${ldap_type} |
| 796 | ... ${group_privilege} ${group_name} |
| 797 | |
| 798 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 799 | |
| 800 | Redfish.Post ${REDFISH_POWER_URI} |
| 801 | ... body={'ResetType': 'On'} valid_status_codes=[${valid_status_code}] |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 802 | |
nagarjunb22 | 00108dc | 2022-07-12 21:50:45 +0530 | [diff] [blame] | 803 | Return From Keyword If ${valid_status_code} == ${HTTP_FORBIDDEN} |
| 804 | Verify Host Is Up |
| 805 | |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 806 | |
| 807 | Update LDAP User Role And Configure IP Address |
| 808 | [Documentation] Update LDAP user role and configure IP address. |
| 809 | [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK} |
| 810 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND Delete IP Address ${test_ip} |
| 811 | |
| 812 | # Description of argument(s): |
| 813 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 814 | # group_privilege The group privilege ("Administrator", "Operator" or "ReadOnly"). |
Prashanth Katti | 3dc8cc3 | 2020-03-04 11:11:01 -0600 | [diff] [blame] | 815 | # group_name The group name of user. |
| 816 | # valid_status_code The expected valid status code. |
| 817 | |
| 818 | Update LDAP Configuration with LDAP User Role And Group ${ldap_type} |
| 819 | ... ${group_privilege} ${group_name} |
| 820 | |
| 821 | Redfish.Logout |
| 822 | |
| 823 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 824 | |
Anves Kumar rayankula | 5bf342e | 2020-06-25 08:35:34 -0500 | [diff] [blame] | 825 | ${test_gateway}= Get BMC Default Gateway |
| 826 | |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 827 | Add IP Address ${test_ip} ${test_mask} ${test_gateway} ${valid_status_code} |
Prashanth Katti | f90c474 | 2020-03-18 11:08:47 -0500 | [diff] [blame] | 828 | |
| 829 | |
| 830 | Update LDAP User Role And Delete IP Address |
| 831 | [Documentation] Update LDAP user role and delete IP address. |
| 832 | [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK} |
| 833 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login AND Delete IP Address ${test_ip} |
| 834 | |
| 835 | # Description of argument(s): |
| 836 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 837 | # group_privilege The group privilege ("Administrator", "Operator" or "ReadOnly"). |
Prashanth Katti | f90c474 | 2020-03-18 11:08:47 -0500 | [diff] [blame] | 838 | # group_name The group name of user. |
| 839 | # valid_status_code The expected valid status code. |
| 840 | |
Anves Kumar rayankula | 5bf342e | 2020-06-25 08:35:34 -0500 | [diff] [blame] | 841 | ${test_gateway}= Get BMC Default Gateway |
| 842 | |
Prashanth Katti | f90c474 | 2020-03-18 11:08:47 -0500 | [diff] [blame] | 843 | # Configure IP address before deleting via LDAP user roles. |
Anves Kumar rayankula | 5bf342e | 2020-06-25 08:35:34 -0500 | [diff] [blame] | 844 | Add IP Address ${test_ip} ${test_mask} ${test_gateway} |
Prashanth Katti | f90c474 | 2020-03-18 11:08:47 -0500 | [diff] [blame] | 845 | |
| 846 | Update LDAP Configuration with LDAP User Role And Group ${ldap_type} |
| 847 | ... ${group_privilege} ${group_name} |
| 848 | |
| 849 | Redfish.Logout |
| 850 | |
| 851 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 852 | |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 853 | Delete IP Address ${test_ip} ${valid_status_code} |
Prashanth Katti | 67e0620 | 2020-05-20 06:16:51 -0500 | [diff] [blame] | 854 | |
| 855 | |
| 856 | Update LDAP User Role And Read Network Configuration |
| 857 | [Documentation] Update LDAP user role and read network configuration. |
| 858 | [Arguments] ${ldap_type} ${group_privilege} ${group_name} ${valid_status_code}=${HTTP_OK} |
| 859 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
| 860 | |
| 861 | # Description of argument(s): |
| 862 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
kothais | 42b2e30 | 2023-11-03 06:56:08 +0000 | [diff] [blame] | 863 | # group_privilege The group privilege ("Administrator", "Operator" or "ReadOnly"). |
Prashanth Katti | 67e0620 | 2020-05-20 06:16:51 -0500 | [diff] [blame] | 864 | # group_name The group name of user. |
| 865 | # valid_status_code The expected valid status code. |
| 866 | |
| 867 | Update LDAP Configuration with LDAP User Role And Group ${ldap_type} |
| 868 | ... ${group_privilege} ${group_name} |
| 869 | |
| 870 | Redfish.Logout |
| 871 | |
| 872 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 873 | Redfish.Get ${REDFISH_NW_ETH0_URI} valid_status_codes=[${valid_status_code}] |