Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "User management" sub-menu of "Security and access". |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 6 | |
| 7 | Suite Setup Launch Browser And Login GUI |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 8 | Suite Teardown Suite Teardown Execution |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 9 | Test Setup Test Setup Execution |
| 10 | |
George Keishing | 0302e9a | 2023-10-12 21:48:35 +0530 | [diff] [blame] | 11 | Force Tags User_Management_Sub_Menu |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 12 | |
| 13 | *** Variables *** |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 14 | |
| 15 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 16 | ${xpath_user_management_heading} //h1[text()="User management"] |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 17 | ${xpath_select_user} //input[contains(@class,"custom-control-input")] |
| 18 | ${xpath_account_policy} //button[contains(text(),'Account policy settings')] |
| 19 | ${xpath_add_user} //button[contains(text(),'Add user')] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 20 | ${xpath_edit_user} //*[@data-test-id='userManagement-tableRowAction-edit-0'] |
| 21 | ${xpath_delete_user} //*[@data-test-id='userManagement-tableRowAction-delete-1'] |
| 22 | ${xpath_account_status_enabled_button} //*[@data-test-id='userManagement-radioButton-statusEnabled'] |
| 23 | ${xpath_account_status_disabled_button} //*[@data-test-id='userManagement-radioButton-statusDisabled'] |
| 24 | ${xpath_username_input_button} //*[@data-test-id='userManagement-input-username'] |
| 25 | ${xpath_privilege_list_button} //*[@data-test-id='userManagement-select-privilege'] |
| 26 | ${xpath_password_input_button} //*[@data-test-id='userManagement-input-password'] |
| 27 | ${xpath_password_confirm_button} //*[@data-test-id='userManagement-input-passwordConfirmation'] |
| 28 | ${xpath_cancel_button} //*[@data-test-id='userManagement-button-cancel'] |
| 29 | ${xpath_submit_button} //*[@data-test-id='userManagement-button-submit'] |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 30 | ${xpath_add_user_heading} //h5[contains(text(),'Add user')] |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 31 | ${xpath_policy_settings_header} //*[text()="Account policy settings"] |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 32 | ${xpath_auto_unlock} //*[@data-test-id='userManagement-radio-automaticUnlock'] |
| 33 | ${xpath_manual_unlock} //*[@data-test-id='userManagement-radio-manualUnlock'] |
| 34 | ${xpath_max_failed_login} //*[@data-test-id='userManagement-input-lockoutThreshold'] |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 35 | ${test_user_password} TestPwd1 |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 36 | @{username} admin_user readonly_user disabled_user |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 37 | |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 38 | |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 39 | *** Test Cases *** |
| 40 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 41 | Verify Navigation To User Management Page |
| 42 | [Documentation] Verify navigation to user management page. |
| 43 | [Tags] Verify_Navigation_To_User_Management_Page |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 44 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 45 | Page Should Contain Element ${xpath_user_management_heading} |
Sushma M M | 2630299 | 2020-08-31 01:15:26 -0500 | [diff] [blame] | 46 | |
| 47 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 48 | Verify Existence Of All Sections In User Management Page |
| 49 | [Documentation] Verify existence of all sections in user management page. |
| 50 | [Tags] Verify_Existence_Of_All_Sections_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 51 | |
| 52 | Page should contain View privilege role descriptions |
| 53 | |
| 54 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 55 | Verify Existence Of All Input Boxes In User Management Page |
| 56 | [Documentation] Verify existence of all sections in user managemnet page. |
| 57 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 58 | |
| 59 | Page Should Contain Checkbox ${xpath_select_user} |
| 60 | |
| 61 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 62 | Verify Existence Of All Buttons In User Management Page |
| 63 | [Documentation] Verify existence of all buttons in user management page. |
| 64 | [Tags] Verify_Existence_Of_All_Buttons_In_User_Management_Page |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 65 | |
| 66 | Page should contain Button ${xpath_account_policy} |
| 67 | Page should contain Button ${xpath_add_user} |
manashsarma | 90d91fa | 2021-04-08 07:07:16 -0500 | [diff] [blame] | 68 | Page Should Contain Element ${xpath_edit_user} |
| 69 | Page Should Contain Element ${xpath_delete_user} |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 70 | |
| 71 | |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 72 | Verify Existence Of All Button And Fields In Add User |
| 73 | [Documentation] Verify existence of all buttons and fields in add user page. |
| 74 | [Tags] Verify_Existence_Of_All_Button_And_Fields_In_Add_User |
manashsarma | 9d67d26 | 2020-10-15 11:20:48 -0500 | [diff] [blame] | 75 | [Teardown] Click Element ${xpath_cancel_button} |
manashsarma | c67f226 | 2020-09-24 08:16:08 -0500 | [diff] [blame] | 76 | |
| 77 | Click Element ${xpath_add_user} |
| 78 | Wait Until Page Contains Element ${xpath_add_user_heading} |
| 79 | Page Should Contain Element ${xpath_account_status_enabled_button} |
| 80 | Page Should Contain Element ${xpath_account_status_disabled_button} |
| 81 | Page Should Contain Element ${xpath_username_input_button} |
| 82 | Page Should Contain Element ${xpath_privilege_list_button} |
| 83 | Page Should Contain Element ${xpath_password_input_button} |
| 84 | Page Should Contain Element ${xpath_password_confirm_button} |
| 85 | Page Should Contain Element ${xpath_cancel_button} |
| 86 | Page Should Contain Element ${xpath_submit_button} |
| 87 | |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 88 | |
| 89 | Verify Existence Of All Buttons And Fields In Account Policy Settings |
| 90 | [Documentation] Verify existence of all buttons and fields in account policy settings page. |
| 91 | [Tags] Verify_Existence_Of_All_Buttons_And_Fields_In_Account_Policy_Settings |
manashsarma | 5c4a7d1 | 2020-10-21 05:21:37 -0500 | [diff] [blame] | 92 | [Teardown] Click Element ${xpath_cancel_button} |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 93 | |
| 94 | Click Element ${xpath_account_policy} |
manashsarma | 5c4a7d1 | 2020-10-21 05:21:37 -0500 | [diff] [blame] | 95 | Wait Until Page Contains Element ${xpath_policy_settings_header} |
manashsarma | 66f0384 | 2020-09-23 08:52:38 -0500 | [diff] [blame] | 96 | Page Should Contain Element ${xpath_auto_unlock} |
| 97 | Page Should Contain Element ${xpath_manual_unlock} |
| 98 | Page Should Contain Element ${xpath_max_failed_login} |
| 99 | Page Should Contain Element ${xpath_submit_button} |
| 100 | Page Should Contain Element ${xpath_cancel_button} |
| 101 | |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 102 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 103 | Verify User Access Privilege |
George Keishing | 4d4ef99 | 2021-01-28 09:56:53 -0600 | [diff] [blame] | 104 | [Documentation] Create a new user with a privilege and verify that user is created. |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 105 | [Tags] Verify_User_Access_Privilege |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 106 | [Teardown] Delete Users Via Redfish @{username} |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 107 | [Template] Create User And Verify |
| 108 | |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 109 | # username privilege_level enabled |
| 110 | ${username}[0] Administrator ${True} |
| 111 | ${username}[1] ReadOnly ${True} |
| 112 | ${username}[2] Administrator ${False} |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 113 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 114 | |
rramyasr-in | c4a5c34 | 2023-01-02 01:38:50 -0600 | [diff] [blame] | 115 | Verify Operator And No Access User Privilege |
| 116 | [Documentation] Create users with different access privilege |
| 117 | ... and verify that the user is getting created. |
| 118 | [Tags] Verify_Operator_And_No_Access_User_Privilege |
| 119 | [Template] Create User And Verify |
| 120 | |
| 121 | # username privilege_level enabled |
| 122 | operator_user Operator ${True} |
| 123 | noaccess_user NoAccess ${True} |
| 124 | |
| 125 | |
manashsarma | 165f527 | 2021-08-04 07:37:01 -0500 | [diff] [blame] | 126 | Verify User Account And Properties Saved Through Reboots |
| 127 | [Documentation] Verify that user account and properties saved through reboots. |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 128 | [Teardown] Delete Users Via Redfish my_admin_user |
manashsarma | 165f527 | 2021-08-04 07:37:01 -0500 | [diff] [blame] | 129 | [Tags] Verify_User_Account_And_Properties_Saved_Through_Reboots |
| 130 | |
| 131 | # Create an User account. |
| 132 | Create User And Verify my_admin_user Administrator ${True} |
| 133 | |
| 134 | # Reboot BMC. |
| 135 | Redfish OBMC Reboot (off) stack_mode=normal |
| 136 | |
| 137 | Click Element ${xpath_refresh_button} |
| 138 | Wait Until Page Contains my_admin_user timeout=15 |
| 139 | |
| 140 | |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 141 | *** Keywords *** |
| 142 | |
| 143 | Create User And Verify |
| 144 | [Documentation] Create a user with given user name and privilege and verify that the |
| 145 | ... user is created successfully via GUI and Redfish. |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 146 | [Arguments] ${user_name} ${user_privilege} ${enabled} |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 147 | |
| 148 | # Description of argument(s): |
| 149 | # user_name The name of the user to be created (e.g. "test", "robert", etc.). |
| 150 | # user_privilege Privilege of the user. |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 151 | # enabled If the user is enabled (e.g True if enabled, False if disabled). |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 152 | |
| 153 | Click Element ${xpath_add_user} |
| 154 | Wait Until Page Contains Element ${xpath_add_user_heading} |
| 155 | |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 156 | # Select disabled radio button if user needs to be disabled |
| 157 | Run Keyword If ${enabled} == ${False} |
manashsarma | cb646cc | 2020-11-17 03:59:04 -0600 | [diff] [blame] | 158 | ... Click Element At Coordinates ${xpath_account_status_disabled_button} 0 0 |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 159 | |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 160 | # Input username, password and privilege. |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 161 | Input Text ${xpath_username_input_button} ${user_name} |
| 162 | Select From List by Value ${xpath_privilege_list_button} ${user_privilege} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 163 | |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 164 | Input Text ${xpath_password_input_button} ${test_user_password} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 165 | |
manashsarma | cc35bad | 2020-09-30 04:19:01 -0500 | [diff] [blame] | 166 | Input Text ${xpath_password_confirm_button} ${test_user_password} |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 167 | |
| 168 | # Submit. |
| 169 | Click Element ${xpath_submit_button} |
| 170 | |
| 171 | # Refresh page and check new user is available. |
| 172 | Wait Until Page Contains Element ${xpath_add_user} |
| 173 | Click Element ${xpath_refresh_button} |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 174 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 175 | Wait Until Page Contains ${user_name} timeout=15 |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 176 | |
| 177 | # Cross check the privilege of newly added user via Redfish. |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 178 | Redfish.Login |
manashsarma | 9577741 | 2020-09-28 09:52:41 -0500 | [diff] [blame] | 179 | ${user_priv_redfish}= Redfish_Utils.Get Attribute |
manashsarma | da29e55 | 2020-10-04 12:34:01 -0500 | [diff] [blame] | 180 | ... /redfish/v1/AccountService/Accounts/${user_name} RoleId |
| 181 | Should Be Equal ${user_privilege} ${user_priv_redfish} |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 182 | Redfish.Logout |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 183 | |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 184 | # Check enable/disable status for user. |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 185 | ${status}= Run Keyword And Return Status Redfish.Login ${user_name} ${test_user_password} |
| 186 | Run Keyword If ${enabled} == ${False} |
| 187 | ... Should Be Equal ${status} ${False} |
| 188 | ... ELSE Should Be Equal ${status} ${True} |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 189 | Redfish.Logout |
manashsarma | edd6da0 | 2020-10-04 00:11:18 -0500 | [diff] [blame] | 190 | |
| 191 | |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 192 | Test Setup Execution |
| 193 | [Documentation] Do test case setup tasks. |
| 194 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 195 | # Navigate to https://xx.xx.xx.xx/#/access-control/user-management user management page. |
Sushma M M | 87a5b2d | 2020-07-31 00:58:48 -0500 | [diff] [blame] | 196 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 197 | Click Element ${xpath_secuity_and_accesss_menu} |
| 198 | Click Element ${xpath_user_management_sub_menu} |
rramyasr-in | 9e2c96f | 2023-01-24 07:59:34 -0600 | [diff] [blame] | 199 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain user-management |
| 200 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
Nandish-Matti | c4024a3 | 2023-03-13 01:59:40 -0500 | [diff] [blame] | 201 | |
| 202 | |
| 203 | Delete Users Via Redfish |
| 204 | [Documentation] Delete given users using Redfish. |
| 205 | [Arguments] @{user_list} |
| 206 | # Description of argument(s): |
| 207 | # user_list List of user name to be deleted. |
| 208 | |
| 209 | FOR ${user} IN @{user_list} |
| 210 | Redfish.Login |
| 211 | Redfish.Delete /redfish/v1/AccountService/Accounts/${user} |
| 212 | Redfish.Logout |
| 213 | END |
| 214 | |
| 215 | |
| 216 | Suite Teardown Execution |
| 217 | [Documentation] Do suite teardown tasks. |
| 218 | |
| 219 | Logout GUI |
| 220 | Close Browser |
| 221 | Redfish.Logout |