Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "LDAP" sub-menu of "Security and access". |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Anves Kumar rayankula | b44c957 | 2021-04-27 00:44:06 -0500 | [diff] [blame] | 6 | Resource ../../../lib/bmc_ldap_utils.robot |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 7 | |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 8 | Suite Setup Suite Setup Execution |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 9 | Suite Teardown Close Browser |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 10 | |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 14 | ${xpath_ldap_heading} //h1[text()="LDAP"] |
Sweta Potthuri | fd889f5 | 2021-08-17 02:45:12 -0500 | [diff] [blame] | 15 | ${xpath_enable_ldap_checkbox} //*[@data-test-id='ldap-checkbox-ldapAuthenticationEnabled']//following-sibling::label |
Rahul Maheshwari | 062dceb | 2021-01-19 04:16:30 -0600 | [diff] [blame] | 16 | ${xpath_secure_ldap_checkbox} //*[@data-test-id='ldap-checkbox-secureLdapEnabled'] |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 17 | ${xpath_service_radio_button} //*[@data-test-id="ldap-radio-activeDirectoryEnabled"] |
| 18 | ${xpath_add_role_group_button} //button[contains(text(),'Add role group')] |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 19 | ${xpath_ldap_url} //*[@data-test-id='ldap-input-serverUri'] |
| 20 | ${xpath_ldap_bind_dn} //*[@data-test-id='ldap-input-bindDn'] |
| 21 | ${xpath_ldap_password} //*[@id='bind-password'] |
| 22 | ${xpath_ldap_base_dn} //*[@data-test-id='ldap-input-baseDn'] |
| 23 | ${xpath_ldap_save_settings} //*[@data-test-id='ldap-button-saveSettings'] |
| 24 | ${xpath_select_refresh_button} //*[text()[contains(.,"Refresh")]] |
Anves Kumar rayankula | b44c957 | 2021-04-27 00:44:06 -0500 | [diff] [blame] | 25 | ${xpath_add_group_name} //*[@id="role-group-name"] |
| 26 | ${xpath_add_group_Privilege} //*[@id="privilege"] |
| 27 | ${xpath_add_privilege_button} //button[text()=" Add "] |
| 28 | ${xpath_delete_group_button} //*[@title="Delete"] |
| 29 | ${xpath_delete_button} //button[text()="Delete"] |
Rahul Maheshwari | 062dceb | 2021-01-19 04:16:30 -0600 | [diff] [blame] | 30 | |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 31 | |
| 32 | ${incorrect_ip} 1.2.3.4 |
Priya Sinha | c1294c9 | 2022-08-02 00:33:02 -0500 | [diff] [blame] | 33 | ${wrong_ldap_port} 135 |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 34 | |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 35 | *** Test Cases *** |
| 36 | |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 37 | Verify Navigation To LDAP Page |
| 38 | [Documentation] Verify navigation to LDAP page. |
| 39 | [Tags] Verify_Navigation_To_LDAP_Page |
| 40 | |
| 41 | Page Should Contain Element ${xpath_ldap_heading} |
| 42 | |
| 43 | |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 44 | Verify Existence Of All Sections In LDAP Page |
| 45 | [Documentation] Verify existence of all sections in LDAP page. |
| 46 | [Tags] Verify_Existence_Of_All_Sections_In_LDAP_Page |
| 47 | |
| 48 | Page Should Contain Settings |
| 49 | Page Should Contain Role groups |
| 50 | |
| 51 | |
| 52 | Verify Existence Of All Buttons In LDAP Page |
| 53 | [Documentation] Verify existence of all buttons in LDAP page. |
| 54 | [Tags] Verify_Existence_Of_All_Buttons_In_LDAP_Page |
| 55 | |
| 56 | # Buttons under settings section. |
| 57 | Page Should Contain Element ${xpath_service_radio_button} |
| 58 | Page Should Contain Element ${xpath_save_settings_button} |
| 59 | |
| 60 | # Buttons under role groups section. |
| 61 | Page Should Contain Element ${xpath_add_role_group_button} |
| 62 | |
| 63 | |
| 64 | Verify Existence Of All Checkboxes In LDAP Page |
| 65 | [Documentation] Verify existence of all checkboxes in LDAP page. |
| 66 | [Tags] Verify_Existence_Of_All_Checkboxes_In_LDAP_Page |
| 67 | |
| 68 | # Checkboxes under settings section. |
| 69 | Page Should Contain Element ${xpath_enable_ldap_checkbox} |
| 70 | Page Should Contain Element ${xpath_secure_ldap_checkbox} |
| 71 | |
| 72 | |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 73 | Verify LDAP Configurations Editable |
| 74 | [Documentation] Verify LDAP configurations are editable. |
| 75 | [Tags] Verify_LDAP_Configurations_Editable |
| 76 | |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 77 | Create LDAP Configuration ${LDAP_SERVER_URI} ${LDAP_TYPE} ${LDAP_BIND_DN} |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 78 | ... ${LDAP_BIND_DN_PASSWORD} ${LDAP_BASE_DN} |
| 79 | Wait Until Page Contains Element ${xpath_ldap_url} |
| 80 | Textfield Value Should Be ${xpath_ldap_url} ${LDAP_SERVER_URI} |
| 81 | Textfield Value Should Be ${xpath_ldap_bind_dn} ${LDAP_BIND_DN} |
| 82 | Textfield Value Should Be ${xpath_ldap_password} ${empty} |
| 83 | Textfield Value Should Be ${xpath_ldap_base_dn} ${LDAP_BASE_DN} |
| 84 | |
| 85 | |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 86 | Verify Create LDAP Configuration |
| 87 | [Documentation] Verify created LDAP configuration. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 88 | [Tags] Verify_Create_LDAP_Configuration |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 89 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 90 | |
| 91 | Create LDAP Configuration |
| 92 | Get LDAP Configuration ${LDAP_TYPE} |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 93 | Redfish.Logout |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 94 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 95 | |
| 96 | |
| 97 | Verify LDAP Config Update With Incorrect LDAP IP Address |
| 98 | [Documentation] Verify that LDAP login fails with incorrect LDAP IP Address. |
| 99 | [Tags] Verify_LDAP_Config_Update_With_Incorrect_LDAP_IP_Address |
| 100 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
| 101 | |
| 102 | Create LDAP Configuration ${incorrect_ip} ${LDAP_TYPE} ${LDAP_BIND_DN} |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 103 | ... ${LDAP_BIND_DN_PASSWORD} ${LDAP_BASE_DN} ${LDAP_MODE} |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 104 | |
| 105 | Get LDAP Configuration ${LDAP_TYPE} |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 106 | Redfish.Logout |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 107 | |
| 108 | ${resp}= Run Keyword And Return Status |
| 109 | ... Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 110 | Should Be Equal ${resp} ${False} |
| 111 | ... msg=LDAP user was able to login though the incorrect LDAP IP Address. |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 112 | |
Anves Kumar rayankula | 9575276 | 2021-04-06 05:14:55 -0500 | [diff] [blame] | 113 | |
| 114 | Verify LDAP Service Disable |
| 115 | [Documentation] Verify that LDAP user cannot login when LDAP service is disabled. |
| 116 | [Tags] Verify_LDAP_Service_Disable |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 117 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
Anves Kumar rayankula | 9575276 | 2021-04-06 05:14:55 -0500 | [diff] [blame] | 118 | |
| 119 | ${status}= Run Keyword And Return Status |
| 120 | ... Checkbox Should Be Selected ${xpath_enable_ldap_checkbox} |
| 121 | |
| 122 | Run Keyword If ${status} == ${True} |
| 123 | ... Click Element At Coordinates ${xpath_enable_ldap_checkbox} 0 0 |
| 124 | |
| 125 | Checkbox Should Not Be Selected ${xpath_enable_ldap_checkbox} |
| 126 | Click Element ${xpath_ldap_save_settings} |
| 127 | Wait Until Page Contains Successfully saved Open LDAP settings |
| 128 | Click Element ${xpath_refresh_button} |
| 129 | Wait Until Page Contains Element ${xpath_ldap_heading} |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 130 | Redfish.Logout |
Anves Kumar rayankula | 9575276 | 2021-04-06 05:14:55 -0500 | [diff] [blame] | 131 | |
Anves Kumar rayankula | 298b684 | 2021-05-24 04:25:19 -0500 | [diff] [blame] | 132 | ${resp}= Run Keyword And Return Status |
| 133 | ... Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
Anves Kumar rayankula | 9575276 | 2021-04-06 05:14:55 -0500 | [diff] [blame] | 134 | Should Be Equal ${resp} ${False} |
| 135 | ... msg=LDAP user was able to login even though the LDAP service was disabled. |
Anves Kumar rayankula | 9575276 | 2021-04-06 05:14:55 -0500 | [diff] [blame] | 136 | |
| 137 | |
Anves Kumar rayankula | b44c957 | 2021-04-27 00:44:06 -0500 | [diff] [blame] | 138 | Verify LDAP User With Admin Privilege |
| 139 | [Documentation] Verify that LDAP user with administrator privilege is able to do BMC reboot. |
| 140 | [Tags] Verify_LDAP_User_With_Admin_Privilege |
| 141 | [Teardown] Run Keywords Redfish.Login AND Delete LDAP Role Group ${GROUP_NAME} |
| 142 | |
| 143 | Update LDAP Configuration with LDAP User Role And Group ${GROUP_NAME} ${GROUP_PRIVILEGE} |
| 144 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 145 | Redfish OBMC Reboot (off) |
| 146 | Redfish.Logout |
| 147 | |
| 148 | |
Anves Kumar rayankula | 454b791 | 2021-06-21 06:54:23 -0500 | [diff] [blame] | 149 | Verify Enabling LDAP |
| 150 | [Documentation] Verify that LDAP can be enabled from disabled state. |
| 151 | [Tags] Verify_Enabling_LDAP |
| 152 | |
| 153 | Disable LDAP Configuration |
| 154 | Create LDAP Configuration |
| 155 | |
| 156 | |
Anves Kumar rayankula | 272acf4 | 2021-06-23 01:51:24 -0500 | [diff] [blame] | 157 | Read Network Configuration Via Different User Roles And Verify Using GUI |
| 158 | [Documentation] Read network configuration via different user roles and verify. |
| 159 | [Tags] Read_Network_Configuration_Via_Different_User_Roles_And_Verify_Using_GUI |
| 160 | [Template] Update LDAP User Role And Read Network Configuration Via GUI |
| 161 | |
| 162 | # group_name user_role valid_status_code |
| 163 | ${GROUP_NAME} Administrator ${HTTP_OK} |
| 164 | ${GROUP_NAME} Operator ${HTTP_OK} |
| 165 | ${GROUP_NAME} ReadOnly ${HTTP_OK} |
| 166 | ${GROUP_NAME} NoAccess ${HTTP_FORBIDDEN} |
| 167 | |
| 168 | |
Priya Sinha | c1294c9 | 2022-08-02 00:33:02 -0500 | [diff] [blame] | 169 | Verify LDAP Login Fails On Wrong LDAP Port |
| 170 | [Documentation] Verify that LDAP login fails when wrong port is entered in LDAP URL. |
| 171 | [Tags] Verify_LDAP_Login_Fails_On_Wrong_LDAP_Port |
| 172 | [Teardown] Run Keywords Redfish.Logout AND Redfish.Login |
| 173 | |
| 174 | ${ldap_uri_wrong_port}= Catenate SEPARATOR=: ${LDAP_SERVER_URI} ${wrong_ldap_port} |
| 175 | Create LDAP Configuration ${ldap_uri_wrong_port} ${LDAP_TYPE} ${LDAP_BIND_DN} |
| 176 | ... ${LDAP_BIND_DN_PASSWORD} ${LDAP_BASE_DN} ${LDAP_MODE} |
| 177 | |
| 178 | Get LDAP Configuration ${LDAP_TYPE} |
| 179 | Redfish.Logout |
| 180 | |
| 181 | ${resp}= Run Keyword And Return Status |
| 182 | ... Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 183 | Should Be Equal ${resp} ${False} |
| 184 | ... msg=LDAP user was able to login though the wrong port in LDAP URL |
| 185 | |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 186 | *** Keywords *** |
| 187 | |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 188 | Suite Setup Execution |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 189 | [Documentation] Do test case setup tasks. |
| 190 | |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 191 | Launch Browser And Login GUI |
| 192 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 193 | # Navigate to https://xx.xx.xx.xx/#/security-and-access/ldap LDAP page. |
| 194 | Click Element ${xpath_secuity_and_accesss_menu} |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 195 | Click Element ${xpath_ldap_sub_menu} |
| 196 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain ldap |
Sweta Potthuri | fd889f5 | 2021-08-17 02:45:12 -0500 | [diff] [blame] | 197 | Wait Until Element Is Enabled ${xpath_enable_ldap_checkbox} timeout=10s |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 198 | |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 199 | Valid Value LDAP_TYPE valid_values=["ActiveDirectory", "LDAP"] |
| 200 | Valid Value LDAP_USER |
| 201 | Valid Value LDAP_USER_PASSWORD |
| 202 | Valid Value GROUP_PRIVILEGE |
| 203 | Valid Value GROUP_NAME |
| 204 | Valid Value LDAP_SERVER_URI |
| 205 | Valid Value LDAP_BIND_DN_PASSWORD |
| 206 | Valid Value LDAP_BIND_DN |
| 207 | Valid Value LDAP_BASE_DN |
| 208 | Valid Value LDAP_MODE valid_values=["secure", "nonsecure"] |
| 209 | |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 210 | |
| 211 | Create LDAP Configuration |
| 212 | [Documentation] Create LDAP configuration. |
| 213 | [Arguments] ${ldap_server_uri}=${LDAP_SERVER_URI} ${ldap_servicetype}=${LDAP_TYPE} |
| 214 | ... ${ldap_bind_dn}=${LDAP_BIND_DN} ${ldap_bind_dn_password}=${LDAP_BIND_DN_PASSWORD} |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 215 | ... ${ldap_base_dn}=${LDAP_BASE_DN} ${ldap_mode}=${LDAP_MODE} |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 216 | |
| 217 | # Description of argument(s): |
| 218 | # ldap_server_uri LDAP server uri (e.g. ldap://XX.XX.XX.XX). |
| 219 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
| 220 | # ldap_bind_dn The LDAP bind distinguished name. |
| 221 | # ldap_bind_dn_password The LDAP bind distinguished name password. |
| 222 | # ldap_base_dn The LDAP base distinguished name. |
| 223 | |
Sweta Potthuri | fd889f5 | 2021-08-17 02:45:12 -0500 | [diff] [blame] | 224 | # Clearing existing LDAP configuration by disabling it. |
| 225 | Redfish.Patch ${REDFISH_BASE_URI}AccountService |
| 226 | ... body={'${LDAP_TYPE}': {'ServiceEnabled': ${False}}} |
| 227 | |
| 228 | # Wait for GUI to reflect LDAP disabled status. |
| 229 | Run Keywords Refresh GUI AND Sleep 10s |
| 230 | |
| 231 | Click Element ${xpath_enable_ldap_checkbox} |
| 232 | ${radio_buttons}= Get WebElements ${xpath_service_radio_button} |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 233 | |
Anves Kumar rayankula | 30a6245 | 2021-05-17 00:27:21 -0500 | [diff] [blame] | 234 | Run Keyword If '${ldap_service_type}' == 'LDAP' |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 235 | ... Click Element At Coordinates ${radio_buttons}[${0}] 0 0 |
| 236 | ... ELSE Click Element At Coordinates ${radio_buttons}[${1}] 0 0 |
| 237 | |
| 238 | Wait Until Page Contains Element ${xpath_ldap_url} |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 239 | Run Keyword If '${ldap_mode}' == 'secure' |
| 240 | ... Click Element At Coordinates ${xpath_secure_ldap_checkbox} 0 0 |
Anves Kumar rayankula | 010efe6 | 2021-06-09 09:00:58 -0500 | [diff] [blame] | 241 | |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 242 | Input Text ${xpath_ldap_url} ${ldap_server_uri} |
| 243 | Input Text ${xpath_ldap_bind_dn} ${ldap_bind_dn} |
| 244 | Input Text ${xpath_ldap_password} ${ldap_bind_dn_password} |
| 245 | Input Text ${xpath_ldap_base_dn} ${ldap_base_dn} |
| 246 | Click Element ${xpath_ldap_save_settings} |
| 247 | |
Anves Kumar rayankula | 30a6245 | 2021-05-17 00:27:21 -0500 | [diff] [blame] | 248 | Run Keyword If '${ldap_service_type}'=='LDAP' |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 249 | ... Wait Until Page Contains Successfully saved Open LDAP settings |
| 250 | ... ELSE |
| 251 | ... Wait Until Page Contains Successfully saved Active Directory settings |
| 252 | |
| 253 | Click Element ${xpath_refresh_button} |
| 254 | Wait Until Page Contains Element ${xpath_ldap_heading} |
| 255 | |
| 256 | |
| 257 | Get LDAP Configuration |
| 258 | [Documentation] Retrieve LDAP Configuration. |
| 259 | [Arguments] ${ldap_type} |
| 260 | |
| 261 | # Description of argument(s): |
Anves Kumar rayankula | 30a6245 | 2021-05-17 00:27:21 -0500 | [diff] [blame] | 262 | # ldap_type The LDAP type ("ActiveDirectory" or "LDAP"). |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 263 | |
| 264 | ${radio_buttons}= Get WebElements ${xpath_service_radio_button} |
| 265 | |
| 266 | ${status}= Run Keyword And Return Status |
Anves Kumar rayankula | 30a6245 | 2021-05-17 00:27:21 -0500 | [diff] [blame] | 267 | ... Run Keyword If '${ldap_type}'=='LDAP' |
Anves Kumar rayankula | 47892a2 | 2021-03-26 03:57:02 -0500 | [diff] [blame] | 268 | ... Checkbox Should Be Selected ${radio_buttons}[${0}] |
| 269 | ... ELSE |
| 270 | ... Checkbox Should Be Selected ${radio_buttons}[${1}] |
| 271 | Should Be Equal ${status} ${True} |
Anves Kumar rayankula | b44c957 | 2021-04-27 00:44:06 -0500 | [diff] [blame] | 272 | |
| 273 | |
| 274 | Update LDAP Configuration With LDAP User Role And Group |
| 275 | [Documentation] Update LDAP configuration update with LDAP user role and group. |
| 276 | [Arguments] ${group_name} ${group_privilege} |
| 277 | |
| 278 | # Description of argument(s): |
| 279 | # group_name The group name of LDAP user. |
| 280 | # group_privilege The group privilege for LDAP user |
| 281 | # (e.g. "Administrator", "Operator", "ReadOnly" or "NoAcccess"). |
| 282 | |
| 283 | Create LDAP Configuration |
| 284 | Click Element ${xpath_add_role_group_button} |
| 285 | Input Text ${xpath_add_group_name} ${group_name} |
| 286 | Select From List By Value ${xpath_add_group_Privilege} ${group_privilege} |
| 287 | Click Element ${xpath_add_privilege_button} |
| 288 | |
| 289 | # Verify group name after adding. |
| 290 | ${ldap_group_name}= Get LDAP Privilege And Group Name Via Redfish |
| 291 | List Should Contain Value ${ldap_group_name} ${group_name} |
| 292 | |
| 293 | |
| 294 | Delete LDAP Role Group |
| 295 | [Documentation] Delete LDAP role group. |
| 296 | [Arguments] ${group_name} |
| 297 | |
| 298 | # Description of argument(s): |
| 299 | # group_name The group name of LDAP user. |
| 300 | |
| 301 | # Verify given group name is exist before deleting. |
| 302 | ${ldap_group_name}= Get LDAP Privilege And Group Name Via Redfish |
| 303 | List Should Contain Value ${ldap_group_name} ${group_name} msg=${group_name} not available. |
| 304 | |
| 305 | ${get_groupname_index}= Get Index From List ${ldap_group_name} ${group_name} |
| 306 | ${delete_group_elements}= Get WebElements ${xpath_delete_group_button} |
| 307 | Click Element ${delete_group_elements}[${get_groupname_index}] |
| 308 | Click Element ${xpath_delete_button} |
| 309 | |
| 310 | # Verify group name after deleting. |
| 311 | ${ldap_group_name}= Get LDAP Privilege And Group Name Via Redfish |
| 312 | List Should Not Contain Value ${ldap_group_name} ${group_name} msg=${group_name} not available. |
Anves Kumar rayankula | 454b791 | 2021-06-21 06:54:23 -0500 | [diff] [blame] | 313 | |
| 314 | |
| 315 | Disable LDAP Configuration |
| 316 | [Documentation] Disable LDAP configuration on BMC. |
| 317 | |
| 318 | ${status}= Run Keyword And Return Status |
| 319 | ... Checkbox Should Be Selected ${xpath_enable_ldap_checkbox} |
| 320 | |
| 321 | Run Keyword If ${status} == ${True} |
| 322 | ... Click Element At Coordinates ${xpath_enable_ldap_checkbox} 0 0 |
| 323 | |
| 324 | Checkbox Should Not Be Selected ${xpath_enable_ldap_checkbox} |
| 325 | Click Element ${xpath_ldap_save_settings} |
| 326 | Wait Until Page Contains Successfully saved Open LDAP settings |
| 327 | Click Element ${xpath_refresh_button} |
| 328 | Wait Until Page Contains Element ${xpath_ldap_heading} |
| 329 | |
Anves Kumar rayankula | 272acf4 | 2021-06-23 01:51:24 -0500 | [diff] [blame] | 330 | |
| 331 | Login BMC And Navigate To LDAP Page |
| 332 | [Documentation] Login BMC and navigate to ldap page. |
| 333 | [Arguments] ${username}=${OPENBMC_USERNAME} ${password}=${OPENBMC_PASSWORD} |
| 334 | |
| 335 | # Description of argument(s): |
| 336 | # username The username to be used for login. |
| 337 | # password The password to be used for login. |
| 338 | |
| 339 | Login GUI ${username} ${password} |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 340 | # Navigate to https://xx.xx.xx.xx/#/security-and-access/ldap LDAP page. |
| 341 | Click Element ${xpath_secuity_and_accesss_menu} |
Anves Kumar rayankula | 272acf4 | 2021-06-23 01:51:24 -0500 | [diff] [blame] | 342 | Click Element ${xpath_ldap_sub_menu} |
| 343 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain ldap |
| 344 | |
| 345 | |
| 346 | Update LDAP User Role And Read Network Configuration Via GUI |
| 347 | [Documentation] Update LDAP user role and read network configuration via GUI. |
| 348 | [Arguments] ${group_name} ${user_role} ${valid_status_codes} |
| 349 | [Teardown] Run Keywords Logout GUI AND Login BMC And Navigate To LDAP Page |
| 350 | ... AND Delete LDAP Role Group ${group_name} |
| 351 | |
| 352 | # Description of argument(s): |
| 353 | # group_privilege The group privilege ("Administrator", "Operator", "ReadOnly" or "NoAccess"). |
| 354 | # group_name The group name of user. |
| 355 | # valid_status_code The expected valid status code. |
| 356 | |
| 357 | |
| 358 | Update LDAP Configuration with LDAP User Role And Group ${group_name} ${user_role} |
| 359 | Logout GUI |
| 360 | Login GUI ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 361 | Redfish.Login ${LDAP_USER} ${LDAP_USER_PASSWORD} |
| 362 | |
| 363 | Click Element ${xpath_server_configuration} |
| 364 | Click Element ${xpath_select_network_settings} |
| 365 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network-settings |
| 366 | |
| 367 | ${resp}= Redfish.Get ${REDFISH_NW_ETH0_URI} valid_status_codes=[${valid_status_codes}] |
| 368 | Return From Keyword If ${valid_status_codes} == ${HTTP_FORBIDDEN} |
| 369 | |
| 370 | ${host_name}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName |
| 371 | Textfield Value Should Be ${xpath_hostname_input} ${host_name} |
| 372 | |
| 373 | ${mac_address}= Redfish.Get Attribute ${REDFISH_NW_ETH0_URI} MACAddress |
| 374 | Textfield Value Should Be ${xpath_mac_address_input} ${mac_address} |
Priya Sinha | c1294c9 | 2022-08-02 00:33:02 -0500 | [diff] [blame] | 375 | |