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