Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test Redfish user account. |
| 3 | |
| 4 | Resource ../../lib/resource.robot |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/openbmc_ffdc.robot |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 7 | Resource ../../lib/bmc_redfish_utils.robot |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 8 | |
manashsarma | 654cbc1 | 2021-09-23 02:28:12 -0500 | [diff] [blame] | 9 | Library SSHLibrary |
| 10 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 11 | Test Setup Redfish.Login |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 12 | Test Teardown Test Teardown Execution |
| 13 | |
Sandhya Somashekar | 37122b6 | 2019-06-18 06:02:02 -0500 | [diff] [blame] | 14 | *** Variables *** |
| 15 | |
| 16 | ${account_lockout_duration} ${30} |
| 17 | ${account_lockout_threshold} ${3} |
| 18 | |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 19 | ** Test Cases ** |
| 20 | |
| 21 | Verify AccountService Available |
Sivas SRR | fa6831c | 2019-02-22 00:12:00 -0600 | [diff] [blame] | 22 | [Documentation] Verify Redfish account service is available. |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 23 | [Tags] Verify_AccountService_Available |
| 24 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 25 | ${resp} = Redfish_utils.Get Attribute /redfish/v1/AccountService ServiceEnabled |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 26 | Should Be Equal As Strings ${resp} ${True} |
| 27 | |
Rahul Maheshwari | d0aa72b | 2022-08-23 06:44:07 -0500 | [diff] [blame] | 28 | |
| 29 | Verify Redfish Admin User Persistence After Reboot |
| 30 | [Documentation] Verify Redfish admin user persistence after reboot. |
| 31 | [Tags] Verify_Redfish_Admin_User_Persistence_After_Reboot |
| 32 | [Setup] Run Keywords Redfish.Login AND |
| 33 | ... Redfish Create User admin_user TestPwd123 Administrator ${True} |
| 34 | [Teardown] Run Keywords Redfish.Delete /redfish/v1/AccountService/Accounts/admin_user |
| 35 | ... AND Test Teardown Execution |
Sandhya Somashekar | a83fb47 | 2019-08-29 02:26:21 -0500 | [diff] [blame] | 36 | |
| 37 | # Reboot BMC. |
| 38 | Redfish OBMC Reboot (off) stack_mode=normal |
Sandhya Somashekar | a83fb47 | 2019-08-29 02:26:21 -0500 | [diff] [blame] | 39 | |
| 40 | # Verify users after reboot. |
| 41 | Redfish Verify User admin_user TestPwd123 Administrator ${True} |
Rahul Maheshwari | d0aa72b | 2022-08-23 06:44:07 -0500 | [diff] [blame] | 42 | |
| 43 | |
| 44 | Verify Redfish Operator User Persistence After Reboot |
| 45 | [Documentation] Verify Redfish operator user persistence after reboot. |
| 46 | [Tags] Verify_Redfish_Operator_User_Persistence_After_Reboot |
| 47 | [Setup] Run Keywords Redfish.Login AND |
| 48 | ... Redfish Create User operator_user TestPwd123 Operator ${True} |
| 49 | [Teardown] Run Keywords Redfish.Delete /redfish/v1/AccountService/Accounts/operator_user |
| 50 | ... AND Test Teardown Execution |
| 51 | |
| 52 | # Reboot BMC. |
| 53 | Redfish OBMC Reboot (off) stack_mode=normal |
| 54 | |
| 55 | # Verify users after reboot. |
Sandhya Somashekar | a83fb47 | 2019-08-29 02:26:21 -0500 | [diff] [blame] | 56 | Redfish Verify User operator_user TestPwd123 Operator ${True} |
Rahul Maheshwari | d0aa72b | 2022-08-23 06:44:07 -0500 | [diff] [blame] | 57 | |
| 58 | |
| 59 | Verify Redfish Readonly User Persistence After Reboot |
| 60 | [Documentation] Verify Redfish readonly user persistence after reboot. |
| 61 | [Tags] Verify_Redfish_Readonly_User_Persistence_After_Reboot |
| 62 | [Setup] Run Keywords Redfish.Login AND |
| 63 | ... Redfish Create User readonly_user TestPwd123 ReadOnly ${True} |
| 64 | [Teardown] Run Keywords Redfish.Delete /redfish/v1/AccountService/Accounts/readonly_user |
| 65 | ... AND Test Teardown Execution |
| 66 | |
| 67 | # Reboot BMC. |
| 68 | Redfish OBMC Reboot (off) stack_mode=normal |
| 69 | |
| 70 | # Verify users after reboot. |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 71 | Redfish Verify User readonly_user TestPwd123 ReadOnly ${True} |
Sandhya Somashekar | a83fb47 | 2019-08-29 02:26:21 -0500 | [diff] [blame] | 72 | |
Sandhya Somashekar | a83fb47 | 2019-08-29 02:26:21 -0500 | [diff] [blame] | 73 | |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 74 | Redfish Create and Verify Admin User |
| 75 | [Documentation] Create a Redfish user with administrator role and verify. |
George Keishing | f517690 | 2022-05-12 04:23:59 -0500 | [diff] [blame] | 76 | [Tags] Redfish_Create_and_Verify_Admin_User |
Sandhya Somashekar | 00f59cc | 2019-03-05 03:39:47 -0600 | [diff] [blame] | 77 | [Template] Redfish Create And Verify User |
| 78 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 79 | #username password role_id enabled |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 80 | admin_user TestPwd123 Administrator ${True} |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 81 | |
| 82 | |
| 83 | Redfish Create and Verify Operator User |
| 84 | [Documentation] Create a Redfish user with operator role and verify. |
| 85 | [Tags] Redfish_Create_and_Verify_Operator_User |
| 86 | [Template] Redfish Create And Verify User |
| 87 | |
| 88 | #username password role_id enabled |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 89 | operator_user TestPwd123 Operator ${True} |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 90 | |
| 91 | |
| 92 | Redfish Create and Verify Readonly User |
| 93 | [Documentation] Create a Redfish user with readonly role and verify. |
| 94 | [Tags] Redfish_Create_and_Verify_Readonly_User |
| 95 | [Template] Redfish Create And Verify User |
| 96 | |
| 97 | #username password role_id enabled |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 98 | readonly_user TestPwd123 ReadOnly ${True} |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 99 | |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 100 | |
| 101 | Verify Redfish Admin User With Wrong Password |
| 102 | [Documentation] Verify Redfish admin user with wrong password. |
| 103 | [Tags] Verify_Redfish_Admin_User_With_Wrong_Password |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 104 | [Template] Verify Redfish User with Wrong Password |
| 105 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 106 | #username password role_id enabled wrong_password |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 107 | admin_user TestPwd123 Administrator ${True} alskjhfwurh |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 108 | |
| 109 | |
| 110 | Verify Redfish Operator User with Wrong Password |
| 111 | [Documentation] Verify Redfish operator user with wrong password. |
| 112 | [Tags] Verify_Redfish_Operator_User_with_Wrong_Password |
| 113 | [Template] Verify Redfish User with Wrong Password |
| 114 | |
| 115 | #username password role_id enabled wrong_password |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 116 | operator_user TestPwd123 Operator ${True} 12j8a8uakjhdaosiruf024 |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 117 | |
| 118 | |
| 119 | Verify Redfish Readonly User With Wrong Password |
| 120 | [Documentation] Verify Redfish readonly user with wrong password. |
| 121 | [Tags] Verify_Redfish_Readonly_User_With_Wrong_Password |
| 122 | [Template] Verify Redfish User with Wrong Password |
| 123 | |
| 124 | #username password role_id enabled wrong_password |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 125 | readonly_user TestPwd123 ReadOnly ${True} 12 |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 126 | |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 127 | |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 128 | Verify Login with Deleted Redfish Admin User |
| 129 | [Documentation] Verify login with deleted Redfish admin user. |
| 130 | [Tags] Verify_Login_with_Deleted_Redfish_Admin_User |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 131 | [Template] Verify Login with Deleted Redfish User |
| 132 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 133 | #username password role_id enabled |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 134 | admin_user TestPwd123 Administrator ${True} |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 135 | |
| 136 | |
| 137 | Verify Login with Deleted Redfish Operator User |
| 138 | [Documentation] Verify login with deleted Redfish operator user. |
| 139 | [Tags] Verify_Login_with_Deleted_Redfish_Operator_User |
| 140 | [Template] Verify Login with Deleted Redfish User |
| 141 | |
| 142 | #username password role_id enabled |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 143 | operator_user TestPwd123 Operator ${True} |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 144 | |
| 145 | |
| 146 | Verify Login with Deleted Redfish Readonly User |
| 147 | [Documentation] Verify login with deleted Redfish readonly user. |
| 148 | [Tags] Verify_Login_with_Deleted_Redfish_Readonly_User |
| 149 | [Template] Verify Login with Deleted Redfish User |
| 150 | |
| 151 | #username password role_id enabled |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 152 | readonly_user TestPwd123 ReadOnly ${True} |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 153 | |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 154 | |
| 155 | Verify Admin User Creation Without Enabling It |
| 156 | [Documentation] Verify admin user creation without enabling it. |
| 157 | [Tags] Verify_Admin_User_Creation_Without_Enabling_It |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 158 | [Template] Verify Create User Without Enabling |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 159 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 160 | #username password role_id enabled |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 161 | admin_user TestPwd123 Administrator ${False} |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 162 | |
| 163 | |
| 164 | Verify Operator User Creation Without Enabling It |
| 165 | [Documentation] Verify operator user creation without enabling it. |
| 166 | [Tags] Verify_Operator_User_Creation_Without_Enabling_It |
| 167 | [Template] Verify Create User Without Enabling |
| 168 | |
| 169 | #username password role_id enabled |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 170 | operator_user TestPwd123 Operator ${False} |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 171 | |
| 172 | |
| 173 | Verify Readonly User Creation Without Enabling It |
| 174 | [Documentation] Verify readonly user creation without enabling it. |
| 175 | [Tags] Verify_Readonly_User_Creation_Without_Enabling_It |
| 176 | [Template] Verify Create User Without Enabling |
| 177 | |
| 178 | #username password role_id enabled |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 179 | readonly_user TestPwd123 ReadOnly ${False} |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 180 | |
Rahul Maheshwari | cbc4c0b | 2022-04-25 05:29:25 -0500 | [diff] [blame] | 181 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 182 | Verify User Creation With Invalid Role Id |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 183 | [Documentation] Verify user creation with invalid role ID. |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 184 | [Tags] Verify_User_Creation_With_Invalid_Role_Id |
| 185 | |
| 186 | # Make sure the user account in question does not already exist. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 187 | Redfish.Delete /redfish/v1/AccountService/Accounts/test_user |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 188 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}] |
| 189 | |
| 190 | # Create specified user. |
| 191 | ${payload}= Create Dictionary |
| 192 | ... UserName=test_user Password=TestPwd123 RoleId=wrongroleid Enabled=${True} |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 193 | Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload} |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 194 | ... valid_status_codes=[${HTTP_BAD_REQUEST}] |
| 195 | |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 196 | Verify Error Upon Creating Same Users With Different Privileges |
| 197 | [Documentation] Verify error upon creating same users with different privileges. |
| 198 | [Tags] Verify_Error_Upon_Creating_Same_Users_With_Different_Privileges |
| 199 | |
| 200 | Redfish Create User test_user TestPwd123 Administrator ${True} |
| 201 | |
| 202 | # Create specified user. |
| 203 | ${payload}= Create Dictionary |
| 204 | ... UserName=test_user Password=TestPwd123 RoleId=Operator Enabled=${True} |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 205 | Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload} |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 206 | ... valid_status_codes=[${HTTP_BAD_REQUEST}] |
| 207 | |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 208 | Redfish.Delete /redfish/v1/AccountService/Accounts/test_user |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 209 | |
Rahul Maheshwari | 124ebef | 2022-08-23 12:06:59 -0500 | [diff] [blame] | 210 | |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 211 | Verify Modifying User Attributes |
| 212 | [Documentation] Verify modifying user attributes. |
| 213 | [Tags] Verify_Modifying_User_Attributes |
Rahul Maheshwari | 124ebef | 2022-08-23 12:06:59 -0500 | [diff] [blame] | 214 | |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 215 | # Create Redfish users. |
| 216 | Redfish Create User admin_user TestPwd123 Administrator ${True} |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 217 | Redfish Create User readonly_user TestPwd123 ReadOnly ${True} |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 218 | |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 219 | # Make sure the new user account does not already exist. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 220 | Redfish.Delete /redfish/v1/AccountService/Accounts/newadmin_user |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 221 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}] |
| 222 | |
| 223 | # Update admin_user username using Redfish. |
| 224 | ${payload}= Create Dictionary UserName=newadmin_user |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 225 | Redfish.Patch /redfish/v1/AccountService/Accounts/admin_user body=&{payload} |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 226 | |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 227 | # Update readonly_user role using Redfish. |
Rahul Maheshwari | 124ebef | 2022-08-23 12:06:59 -0500 | [diff] [blame] | 228 | ${payload}= Create Dictionary RoleId=Administrator |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 229 | Redfish.Patch /redfish/v1/AccountService/Accounts/readonly_user body=&{payload} |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 230 | |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 231 | # Verify users after updating |
| 232 | Redfish Verify User newadmin_user TestPwd123 Administrator ${True} |
Rahul Maheshwari | 124ebef | 2022-08-23 12:06:59 -0500 | [diff] [blame] | 233 | Redfish Verify User readonly_user TestPwd123 Administrator ${True} |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 234 | |
| 235 | # Delete created users. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 236 | Redfish.Delete /redfish/v1/AccountService/Accounts/newadmin_user |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 237 | Redfish.Delete /redfish/v1/AccountService/Accounts/readonly_user |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 238 | |
Rahul Maheshwari | 124ebef | 2022-08-23 12:06:59 -0500 | [diff] [blame] | 239 | |
| 240 | Verify Modifying Operator User Attributes |
| 241 | [Documentation] Verify modifying operator user attributes. |
| 242 | [Tags] Verify_Modifying_Operator_User_Attributes |
| 243 | [Setup] Run Keywords Redfish.Login AND |
| 244 | ... Redfish Create User operator_user TestPwd123 Operator ${True} |
| 245 | [Teardown] Run Keywords Redfish.Delete /redfish/v1/AccountService/Accounts/operator_user |
| 246 | ... AND Test Teardown Execution |
| 247 | |
| 248 | # Update operator_user password using Redfish. |
| 249 | ${payload}= Create Dictionary Password=NewTestPwd123 |
| 250 | Redfish.Patch /redfish/v1/AccountService/Accounts/operator_user body=&{payload} |
| 251 | |
| 252 | # Verify users after updating |
| 253 | Redfish Verify User operator_user NewTestPwd123 Operator ${True} |
| 254 | |
| 255 | |
Sandhya Somashekar | 37122b6 | 2019-06-18 06:02:02 -0500 | [diff] [blame] | 256 | Verify User Account Locked |
| 257 | [Documentation] Verify user account locked upon trying with invalid password. |
| 258 | [Tags] Verify_User_Account_Locked |
| 259 | |
| 260 | Redfish Create User admin_user TestPwd123 Administrator ${True} |
| 261 | |
Joy Onyerikwu | 1483ce0 | 2019-06-26 14:56:36 -0500 | [diff] [blame] | 262 | ${payload}= Create Dictionary AccountLockoutThreshold=${account_lockout_threshold} |
| 263 | ... AccountLockoutDuration=${account_lockout_duration} |
| 264 | Redfish.Patch ${REDFISH_ACCOUNTS_SERVICE_URI} body=${payload} |
Sandhya Somashekar | 37122b6 | 2019-06-18 06:02:02 -0500 | [diff] [blame] | 265 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 266 | Redfish.Logout |
| 267 | |
Sandhya Somashekar | 37122b6 | 2019-06-18 06:02:02 -0500 | [diff] [blame] | 268 | # Make ${account_lockout_threshold} failed login attempts. |
| 269 | Repeat Keyword ${account_lockout_threshold} times |
| 270 | ... Run Keyword And Expect Error InvalidCredentialsError* Redfish.Login admin_user abc123 |
| 271 | |
| 272 | # Verify that legitimate login fails due to lockout. |
| 273 | Run Keyword And Expect Error InvalidCredentialsError* |
| 274 | ... Redfish.Login admin_user TestPwd123 |
| 275 | |
| 276 | # Wait for lockout duration to expire and then verify that login works. |
| 277 | Sleep ${account_lockout_duration}s |
| 278 | Redfish.Login admin_user TestPwd123 |
| 279 | |
| 280 | Redfish.Logout |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 281 | |
Sandhya Somashekar | 7a23747 | 2019-07-15 02:06:39 -0500 | [diff] [blame] | 282 | Redfish.Login |
| 283 | |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 284 | Redfish.Delete /redfish/v1/AccountService/Accounts/admin_user |
Sandhya Somashekar | 7a23747 | 2019-07-15 02:06:39 -0500 | [diff] [blame] | 285 | |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 286 | Verify Admin User Privilege |
| 287 | [Documentation] Verify admin user privilege. |
| 288 | [Tags] Verify_Admin_User_Privilege |
| 289 | |
| 290 | Redfish Create User admin_user TestPwd123 Administrator ${True} |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 291 | Redfish Create User readonly_user TestPwd123 ReadOnly ${True} |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 292 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 293 | Redfish.Logout |
| 294 | |
Rahul Maheshwari | 3bc0864 | 2022-08-23 12:49:48 -0500 | [diff] [blame] | 295 | Redfish.Login admin_user TestPwd123 |
| 296 | |
| 297 | # Change password of 'readonly' user with admin user. |
| 298 | Redfish.Patch /redfish/v1/AccountService/Accounts/readonly_user body={'Password': 'NewTestPwd123'} |
| 299 | |
| 300 | # Verify modified user. |
| 301 | Redfish Verify User readonly_user NewTestPwd123 ReadOnly ${True} |
| 302 | |
| 303 | # Note: Delete user would work here because a root login is |
| 304 | # performed as part of "Redfish Verify User" keyword's teardown. |
| 305 | Redfish.Delete /redfish/v1/AccountService/Accounts/admin_user |
| 306 | Redfish.Delete /redfish/v1/AccountService/Accounts/readonly_user |
| 307 | |
| 308 | |
| 309 | Verify Operator User Role Change Using Admin Privilege User |
| 310 | [Documentation] Verify operator user role change using admin privilege user |
| 311 | [Tags] Verify_Operator_User_Role_Change_Using_Admin_Privilege_User |
| 312 | |
| 313 | Redfish Create User admin_user TestPwd123 Administrator ${True} |
| 314 | Redfish Create User operator_user TestPwd123 Operator ${True} |
| 315 | |
| 316 | Redfish.Logout |
| 317 | |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 318 | # Change role ID of operator user with admin user. |
| 319 | # Login with admin user. |
| 320 | Redfish.Login admin_user TestPwd123 |
| 321 | |
| 322 | # Modify Role ID of Operator user. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 323 | Redfish.Patch /redfish/v1/AccountService/Accounts/operator_user body={'RoleId': 'Administrator'} |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 324 | |
| 325 | # Verify modified user. |
| 326 | Redfish Verify User operator_user TestPwd123 Administrator ${True} |
| 327 | |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 328 | Redfish.Delete /redfish/v1/AccountService/Accounts/admin_user |
| 329 | Redfish.Delete /redfish/v1/AccountService/Accounts/operator_user |
Rahul Maheshwari | 3bc0864 | 2022-08-23 12:49:48 -0500 | [diff] [blame] | 330 | |
Sandhya Somashekar | 7a23747 | 2019-07-15 02:06:39 -0500 | [diff] [blame] | 331 | |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 332 | Verify Operator User Privilege |
| 333 | [Documentation] Verify operator user privilege. |
George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 334 | [Tags] Verify_Operator_User_Privilege |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 335 | |
| 336 | Redfish Create User admin_user TestPwd123 Administrator ${True} |
| 337 | Redfish Create User operator_user TestPwd123 Operator ${True} |
| 338 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 339 | Redfish.Logout |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 340 | # Login with operator user. |
| 341 | Redfish.Login operator_user TestPwd123 |
| 342 | |
George Keishing | 093c1bd | 2020-02-10 09:47:34 -0600 | [diff] [blame] | 343 | # Verify BMC reset. |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 344 | Run Keyword And Expect Error ValueError* Redfish BMC Reset Operation |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 345 | |
| 346 | # Attempt to change password of admin user with operator user. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 347 | Redfish.Patch /redfish/v1/AccountService/Accounts/admin_user body={'Password': 'NewTestPwd123'} |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 348 | ... valid_status_codes=[${HTTP_FORBIDDEN}] |
| 349 | |
| 350 | Redfish.Logout |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 351 | |
Sandhya Somashekar | 7a23747 | 2019-07-15 02:06:39 -0500 | [diff] [blame] | 352 | Redfish.Login |
| 353 | |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 354 | Redfish.Delete /redfish/v1/AccountService/Accounts/admin_user |
| 355 | Redfish.Delete /redfish/v1/AccountService/Accounts/operator_user |
Sandhya Somashekar | 7a23747 | 2019-07-15 02:06:39 -0500 | [diff] [blame] | 356 | |
| 357 | |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 358 | Verify ReadOnly User Privilege |
| 359 | [Documentation] Verify ReadOnly user privilege. |
| 360 | [Tags] Verify_ReadOnly_User_Privilege |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 361 | |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 362 | Redfish Create User readonly_user TestPwd123 ReadOnly ${True} |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 363 | Redfish.Logout |
| 364 | |
| 365 | # Login with read_only user. |
| 366 | Redfish.Login readonly_user TestPwd123 |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 367 | |
| 368 | # Read system level data. |
| 369 | ${system_model}= Redfish_Utils.Get Attribute |
| 370 | ... ${SYSTEM_BASE_URI} Model |
| 371 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 372 | Redfish.Logout |
Sandhya Somashekar | 7a23747 | 2019-07-15 02:06:39 -0500 | [diff] [blame] | 373 | Redfish.Login |
Anusha Dathatri | 4062b44 | 2020-02-03 04:39:15 -0600 | [diff] [blame] | 374 | Redfish.Delete ${REDFISH_ACCOUNTS_URI}readonly_user |
Sandhya Somashekar | 7a23747 | 2019-07-15 02:06:39 -0500 | [diff] [blame] | 375 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 376 | |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 377 | Verify Minimum Password Length For Redfish User |
| 378 | [Documentation] Verify minimum password length for new and existing user. |
| 379 | [Tags] Verify_Minimum_Password_Length_For_Redfish_User |
| 380 | |
| 381 | ${user_name}= Set Variable testUser |
| 382 | |
| 383 | # Make sure the user account in question does not already exist. |
| 384 | Redfish.Delete /redfish/v1/AccountService/Accounts/${user_name} |
| 385 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}] |
| 386 | |
| 387 | # Try to create a user with invalid length password. |
| 388 | ${payload}= Create Dictionary |
| 389 | ... UserName=${user_name} Password=UserPwd RoleId=Administrator Enabled=${True} |
| 390 | Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload} |
| 391 | ... valid_status_codes=[${HTTP_BAD_REQUEST}] |
| 392 | |
| 393 | # Create specified user with valid length password. |
| 394 | Set To Dictionary ${payload} Password UserPwd1 |
| 395 | Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload} |
| 396 | ... valid_status_codes=[${HTTP_CREATED}] |
| 397 | |
| 398 | # Try to change to an invalid password. |
| 399 | Redfish.Patch /redfish/v1/AccountService/Accounts/${user_name} body={'Password': 'UserPwd'} |
| 400 | ... valid_status_codes=[${HTTP_BAD_REQUEST}] |
| 401 | |
| 402 | # Change to a valid password. |
| 403 | Redfish.Patch /redfish/v1/AccountService/Accounts/${user_name} body={'Password': 'UserPwd1'} |
| 404 | |
| 405 | # Verify login. |
| 406 | Redfish.Logout |
| 407 | Redfish.Login ${user_name} UserPwd1 |
| 408 | Redfish.Logout |
| 409 | Redfish.Login |
| 410 | Redfish.Delete /redfish/v1/AccountService/Accounts/${user_name} |
| 411 | |
| 412 | |
Tony Lee | 94335f4 | 2021-02-04 15:16:39 +0800 | [diff] [blame] | 413 | Verify Standard User Roles Defined By Redfish |
| 414 | [Documentation] Verify standard user roles defined by Redfish. |
| 415 | [Tags] Verify_Standard_User_Roles_Defined_By_Redfish |
| 416 | |
| 417 | ${member_list}= Redfish_Utils.Get Member List |
| 418 | ... /redfish/v1/AccountService/Roles |
| 419 | |
| 420 | @{roles}= Create List |
| 421 | ... /redfish/v1/AccountService/Roles/Administrator |
| 422 | ... /redfish/v1/AccountService/Roles/Operator |
| 423 | ... /redfish/v1/AccountService/Roles/ReadOnly |
| 424 | |
| 425 | List Should Contain Sub List ${member_list} ${roles} |
| 426 | |
| 427 | # The standard roles are: |
| 428 | |
| 429 | # | Role name | Assigned privileges | |
| 430 | # | Administrator | Login, ConfigureManager, ConfigureUsers, ConfigureComponents, ConfigureSelf | |
| 431 | # | Operator | Login, ConfigureComponents, ConfigureSelf | |
| 432 | # | ReadOnly | Login, ConfigureSelf | |
| 433 | |
| 434 | @{admin}= Create List Login ConfigureManager ConfigureUsers ConfigureComponents ConfigureSelf |
| 435 | @{operator}= Create List Login ConfigureComponents ConfigureSelf |
| 436 | @{readOnly}= Create List Login ConfigureSelf |
| 437 | |
| 438 | ${roles_dict}= create dictionary admin_privileges=${admin} operator_privileges=${operator} |
| 439 | ... readOnly_privileges=${readOnly} |
| 440 | |
| 441 | ${resp}= redfish.Get /redfish/v1/AccountService/Roles/Administrator |
| 442 | List Should Contain Sub List ${resp.dict['AssignedPrivileges']} ${roles_dict['admin_privileges']} |
| 443 | |
| 444 | ${resp}= redfish.Get /redfish/v1/AccountService/Roles/Operator |
| 445 | List Should Contain Sub List ${resp.dict['AssignedPrivileges']} ${roles_dict['operator_privileges']} |
| 446 | |
| 447 | ${resp}= redfish.Get /redfish/v1/AccountService/Roles/ReadOnly |
| 448 | List Should Contain Sub List ${resp.dict['AssignedPrivileges']} ${roles_dict['readOnly_privileges']} |
| 449 | |
| 450 | |
manashsarma | 4910aa2 | 2021-07-26 09:12:36 -0500 | [diff] [blame] | 451 | Verify Error While Deleting Root User |
| 452 | [Documentation] Verify error while deleting root user. |
| 453 | [Tags] Verify_Error_While_Deleting_Root_User |
| 454 | |
| 455 | Redfish.Delete /redfish/v1/AccountService/Accounts/root valid_status_codes=[${HTTP_FORBIDDEN}] |
| 456 | |
| 457 | |
manashsarma | 654cbc1 | 2021-09-23 02:28:12 -0500 | [diff] [blame] | 458 | Verify SSH Login Access With Admin User |
| 459 | [Documentation] Verify that admin user does not have SSH login access. |
| 460 | [Tags] Verify_SSH_Login_Access_With_Admin_User |
| 461 | |
| 462 | # Create an admin User. |
| 463 | Redfish Create User new_admin TestPwd1 Administrator ${True} |
| 464 | |
| 465 | # Attempt SSH login with admin user. |
| 466 | SSHLibrary.Open Connection ${OPENBMC_HOST} |
| 467 | ${status}= Run Keyword And Return Status SSHLibrary.Login new_admin TestPwd1 |
| 468 | Should Be Equal ${status} ${False} |
| 469 | |
| 470 | |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 471 | *** Keywords *** |
| 472 | |
Sivas SRR | 6aa101f | 2019-02-19 22:31:55 -0600 | [diff] [blame] | 473 | Test Teardown Execution |
| 474 | [Documentation] Do the post test teardown. |
| 475 | |
Anusha Dathatri | db76970 | 2020-02-12 01:02:30 -0600 | [diff] [blame] | 476 | Run Keyword And Ignore Error Redfish.Logout |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 477 | FFDC On Test Case Fail |
| 478 | |
Sandhya Somashekar | 00f59cc | 2019-03-05 03:39:47 -0600 | [diff] [blame] | 479 | |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 480 | Redfish Create User |
| 481 | [Documentation] Redfish create user. |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 482 | [Arguments] ${username} ${password} ${role_id} ${enabled} ${login_check}=${True} |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 483 | |
| 484 | # Description of argument(s): |
| 485 | # username The username to be created. |
| 486 | # password The password to be assigned. |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 487 | # role_id The role ID of the user to be created |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 488 | # (e.g. "Administrator", "Operator", etc.). |
| 489 | # enabled Indicates whether the username being created |
| 490 | # should be enabled (${True}, ${False}). |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 491 | # login_check Checks user login for created user. |
| 492 | # (e.g. ${True}, ${False}). |
Sandhya Somashekar | 8c5b249 | 2019-05-16 05:19:03 -0500 | [diff] [blame] | 493 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 494 | # Make sure the user account in question does not already exist. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 495 | Redfish.Delete /redfish/v1/AccountService/Accounts/${userName} |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 496 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NOT_FOUND}] |
| 497 | |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 498 | # Create specified user. |
| 499 | ${payload}= Create Dictionary |
| 500 | ... UserName=${username} Password=${password} RoleId=${role_id} Enabled=${enabled} |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 501 | Redfish.Post /redfish/v1/AccountService/Accounts/ body=&{payload} |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 502 | ... valid_status_codes=[${HTTP_CREATED}] |
| 503 | |
Rahul Maheshwari | 9928b1d | 2021-07-19 04:59:55 -0500 | [diff] [blame] | 504 | # Resetting faillock count as a workaround for issue |
Anusha Dathatri | f7268b5 | 2020-02-19 01:03:49 -0600 | [diff] [blame] | 505 | # openbmc/phosphor-user-manager#4 |
nagarjunb22 | 61267e9 | 2022-03-30 21:04:16 +0530 | [diff] [blame] | 506 | ${cmd}= Catenate test -f /usr/sbin/faillock && /usr/sbin/faillock --user USER --reset |
| 507 | ... || /usr/sbin/pam_tally2 -u ${username} --reset |
Anusha Dathatri | f7268b5 | 2020-02-19 01:03:49 -0600 | [diff] [blame] | 508 | Bmc Execute Command ${cmd} |
| 509 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 510 | # Verify login with created user. |
| 511 | ${status}= Run Keyword If '${login_check}' == '${True}' |
| 512 | ... Verify Redfish User Login ${username} ${password} |
| 513 | Run Keyword If '${login_check}' == '${True}' Should Be Equal ${status} ${enabled} |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 514 | |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 515 | # Validate Role ID of created user. |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 516 | ${role_config}= Redfish_Utils.Get Attribute |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 517 | ... /redfish/v1/AccountService/Accounts/${username} RoleId |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 518 | Should Be Equal ${role_id} ${role_config} |
| 519 | |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 520 | |
| 521 | Redfish Verify User |
| 522 | [Documentation] Redfish user verification. |
| 523 | [Arguments] ${username} ${password} ${role_id} ${enabled} |
| 524 | |
| 525 | # Description of argument(s): |
| 526 | # username The username to be created. |
| 527 | # password The password to be assigned. |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 528 | # role_id The role ID of the user to be created |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 529 | # (e.g. "Administrator", "Operator", etc.). |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 530 | # enabled Indicates whether the username being created |
| 531 | # should be enabled (${True}, ${False}). |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 532 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 533 | ${status}= Verify Redfish User Login ${username} ${password} |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 534 | # Doing a check of the returned status. |
| 535 | Should Be Equal ${status} ${enabled} |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 536 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 537 | # Validate Role Id of user. |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 538 | ${role_config}= Redfish_Utils.Get Attribute |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 539 | ... /redfish/v1/AccountService/Accounts/${username} RoleId |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 540 | Should Be Equal ${role_id} ${role_config} |
| 541 | |
| 542 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 543 | Verify Redfish User Login |
| 544 | [Documentation] Verify Redfish login with given user id. |
| 545 | [Teardown] Run Keywords Run Keyword And Ignore Error Redfish.Logout AND Redfish.Login |
| 546 | [Arguments] ${username} ${password} |
| 547 | |
| 548 | # Description of argument(s): |
| 549 | # username Login username. |
| 550 | # password Login password. |
| 551 | |
| 552 | # Logout from current Redfish session. |
George Keishing | 1cf2a42 | 2021-02-02 22:59:29 -0600 | [diff] [blame] | 553 | # We don't really care if the current session is flushed out since we are going to login |
| 554 | # with new credential in next. |
| 555 | Run Keyword And Ignore Error Redfish.Logout |
| 556 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 557 | ${status}= Run Keyword And Return Status Redfish.Login ${username} ${password} |
| 558 | [Return] ${status} |
| 559 | |
| 560 | |
Sandhya Somashekar | 00f59cc | 2019-03-05 03:39:47 -0600 | [diff] [blame] | 561 | Redfish Create And Verify User |
| 562 | [Documentation] Redfish create and verify user. |
| 563 | [Arguments] ${username} ${password} ${role_id} ${enabled} |
| 564 | |
| 565 | # Description of argument(s): |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 566 | # username The username to be created. |
| 567 | # password The password to be assigned. |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 568 | # role_id The role ID of the user to be created |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 569 | # (e.g. "Administrator", "Operator", etc.). |
| 570 | # enabled Indicates whether the username being created |
| 571 | # should be enabled (${True}, ${False}). |
Sandhya Somashekar | 00f59cc | 2019-03-05 03:39:47 -0600 | [diff] [blame] | 572 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 573 | # Example: |
| 574 | #{ |
| 575 | #"@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount", |
| 576 | #"@odata.id": "/redfish/v1/AccountService/Accounts/test1", |
| 577 | #"@odata.type": "#ManagerAccount.v1_0_3.ManagerAccount", |
| 578 | #"Description": "User Account", |
| 579 | #"Enabled": true, |
| 580 | #"Id": "test1", |
| 581 | #"Links": { |
| 582 | # "Role": { |
| 583 | # "@odata.id": "/redfish/v1/AccountService/Roles/Administrator" |
| 584 | # } |
| 585 | #}, |
| 586 | |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 587 | Redfish Create User ${username} ${password} ${role_id} ${enabled} |
Sandhya Somashekar | 00f59cc | 2019-03-05 03:39:47 -0600 | [diff] [blame] | 588 | |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 589 | Redfish Verify User ${username} ${password} ${role_id} ${enabled} |
Sandhya Somashekar | 00f59cc | 2019-03-05 03:39:47 -0600 | [diff] [blame] | 590 | |
| 591 | # Delete Specified User |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 592 | Redfish.Delete /redfish/v1/AccountService/Accounts/${username} |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 593 | |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 594 | Verify Redfish User with Wrong Password |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 595 | [Documentation] Verify Redfish User with Wrong Password. |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 596 | [Arguments] ${username} ${password} ${role_id} ${enabled} ${wrong_password} |
| 597 | |
| 598 | # Description of argument(s): |
| 599 | # username The username to be created. |
| 600 | # password The password to be assigned. |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 601 | # role_id The role ID of the user to be created |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 602 | # (e.g. "Administrator", "Operator", etc.). |
| 603 | # enabled Indicates whether the username being created |
| 604 | # should be enabled (${True}, ${False}). |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 605 | # wrong_password Any invalid password. |
| 606 | |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 607 | Redfish Create User ${username} ${password} ${role_id} ${enabled} |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 608 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 609 | Redfish.Logout |
| 610 | |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 611 | # Attempt to login with created user with invalid password. |
| 612 | Run Keyword And Expect Error InvalidCredentialsError* |
| 613 | ... Redfish.Login ${username} ${wrong_password} |
| 614 | |
| 615 | Redfish.Login |
| 616 | |
| 617 | # Delete newly created user. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 618 | Redfish.Delete /redfish/v1/AccountService/Accounts/${username} |
Sandhya Somashekar | 33aa48c | 2019-03-13 05:54:49 -0500 | [diff] [blame] | 619 | |
| 620 | |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 621 | Verify Login with Deleted Redfish User |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 622 | [Documentation] Verify Login with Deleted Redfish User. |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 623 | [Arguments] ${username} ${password} ${role_id} ${enabled} |
| 624 | |
| 625 | # Description of argument(s): |
| 626 | # username The username to be created. |
| 627 | # password The password to be assigned. |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 628 | # role_id The role ID of the user to be created |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 629 | # (e.g. "Administrator", "Operator", etc.). |
| 630 | # enabled Indicates whether the username being created |
| 631 | # should be enabled (${True}, ${False}). |
| 632 | |
Sandhya Somashekar | aa280aa | 2019-04-01 04:15:06 -0500 | [diff] [blame] | 633 | Redfish Create User ${username} ${password} ${role_id} ${enabled} |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 634 | |
| 635 | # Delete newly created user. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 636 | Redfish.Delete /redfish/v1/AccountService/Accounts/${userName} |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 637 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 638 | Redfish.Logout |
| 639 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 640 | # Attempt to login with deleted user account. |
| 641 | Run Keyword And Expect Error InvalidCredentialsError* |
| 642 | ... Redfish.Login ${username} ${password} |
| 643 | |
| 644 | Redfish.Login |
| 645 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 646 | |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 647 | Verify Create User Without Enabling |
| 648 | [Documentation] Verify Create User Without Enabling. |
| 649 | [Arguments] ${username} ${password} ${role_id} ${enabled} |
| 650 | |
| 651 | # Description of argument(s): |
| 652 | # username The username to be created. |
| 653 | # password The password to be assigned. |
Sandhya Somashekar | d7d46c0 | 2019-06-26 05:10:25 -0500 | [diff] [blame] | 654 | # role_id The role ID of the user to be created |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 655 | # (e.g. "Administrator", "Operator", etc.). |
| 656 | # enabled Indicates whether the username being created |
| 657 | # should be enabled (${True}, ${False}). |
| 658 | |
Anusha Dathatri | e0dddcf | 2020-06-18 05:23:16 -0500 | [diff] [blame] | 659 | Redfish Create User ${username} ${password} ${role_id} ${enabled} ${False} |
Sandhya Somashekar | e92b1e6 | 2019-04-25 05:27:45 -0500 | [diff] [blame] | 660 | |
| 661 | Redfish.Logout |
| 662 | |
| 663 | # Login with created user. |
| 664 | Run Keyword And Expect Error InvalidCredentialsError* |
| 665 | ... Redfish.Login ${username} ${password} |
| 666 | |
| 667 | Redfish.Login |
Sandhya Somashekar | af402ca | 2019-03-18 05:59:19 -0500 | [diff] [blame] | 668 | |
| 669 | # Delete newly created user. |
Anusha Dathatri | 466816f | 2020-01-30 05:12:36 -0600 | [diff] [blame] | 670 | Redfish.Delete /redfish/v1/AccountService/Accounts/${username} |
George Keishing | 07fb41f | 2020-06-16 08:09:19 -0500 | [diff] [blame] | 671 | |