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