Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation This suite is for testing Open BMC user account management. |
George Keishing | b843a59 | 2016-09-21 09:48:51 -0500 | [diff] [blame] | 4 | ... The randomness of the string generated is limited to the |
| 5 | ... instance per test case however we end up running multiple |
| 6 | ... test and multiple iteration. This creates scenario where |
| 7 | ... the same previous user is generated. |
| 8 | ... As a good pratice, clean up all the users at the end of |
| 9 | ... test. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 10 | |
| 11 | Resource ../lib/rest_client.robot |
| 12 | Resource ../lib/utils.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 13 | Resource ../lib/openbmc_ffdc.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 14 | |
| 15 | Library OperatingSystem |
| 16 | Library SSHLibrary |
| 17 | Library String |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 18 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | |
Sweta Potthuri | 7855eca | 2017-08-18 04:24:43 -0500 | [diff] [blame] | 20 | Force Tags User_Management |
| 21 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 22 | *** Variables *** |
| 23 | ${RANDOM_STRING_LENGTH} ${8} |
| 24 | ${VALID_PASSWORD} abc123 |
| 25 | ${NON_EXISTING_USER} aaaaa |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 26 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 27 | *** Test Cases *** |
| 28 | |
| 29 | Create and delete user group |
| 30 | [Documentation] ***GOOD PATH*** |
| 31 | ... This testcase is for testing user group creation |
| 32 | ... and deletion in open bmc.\n |
George Keishing | c965bc1 | 2016-10-18 12:15:43 -0500 | [diff] [blame] | 33 | [Tags] Create_and_delete_user_group |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 34 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 35 | ${groupname}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 36 | ${resp}= Create UserGroup ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 37 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 38 | ${usergroup_list}= Get GroupListUsr |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 39 | Should Contain ${usergroup_list} ${groupname} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 40 | ${resp}= Delete Group ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 41 | Should Be Equal ${resp} ok |
| 42 | |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 43 | Create and delete user without group name |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 44 | [Documentation] ***GOOD PATH*** |
| 45 | ... This testcase is for testing user creation with |
| 46 | ... without groupname in open bmc.\n |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 47 | [Tags] Create_and_delete_user_without_group_name |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 48 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 49 | ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 50 | ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 51 | ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 52 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 53 | ${resp}= Create User ${comment} ${username} ${EMPTY} ${password} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 54 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 55 | ${user_list}= Get UserList |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 56 | Should Contain ${user_list} ${username} |
| 57 | |
| 58 | Login BMC ${username} ${password} |
| 59 | ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 60 | Should Be Equal ${rc} ${0} |
| 61 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 62 | ${resp}= Delete User ${username} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 63 | Should Be Equal ${resp} ok |
| 64 | |
| 65 | Create and delete user with user group name |
| 66 | [Documentation] ***GOOD PATH*** |
| 67 | ... This testcase is for testing user creation with |
| 68 | ... user name, password, comment and group name(user group) |
| 69 | ... in open bmc.\n |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 70 | [Tags] Create_and_delete_user_with_user_group_name |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 71 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 72 | ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 73 | ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 74 | ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 75 | ${groupname}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 76 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 77 | ${resp}= Create UserGroup ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 78 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 79 | ${resp}= Create User ${comment} ${username} ${groupname} ${password} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 80 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 81 | ${user_list}= Get UserList |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 82 | Should Contain ${user_list} ${username} |
| 83 | |
| 84 | Login BMC ${username} ${password} |
| 85 | ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 86 | Should Be Equal ${rc} ${0} |
| 87 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 88 | ${resp}= Delete User ${username} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 89 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 90 | ${resp}= Delete Group ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 91 | Should Be Equal ${resp} ok |
| 92 | |
| 93 | Create multiple users |
| 94 | [Documentation] ***GOOD PATH*** |
| 95 | ... This testcase is to verify that multiple users creation |
| 96 | ... in open bmc.\n |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 97 | [Tags] Create_multiple_users |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 98 | |
| 99 | : FOR ${INDEX} IN RANGE 1 10 |
| 100 | \ Log ${INDEX} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 101 | \ ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 102 | \ ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 103 | \ ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 104 | \ ${resp}= Create User ${comment} ${username} ${EMPTY} ${password} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 105 | \ Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 106 | \ ${user_list}= Get UserList |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 107 | \ Should Contain ${user_list} ${username} |
| 108 | \ Login BMC ${username} ${password} |
| 109 | \ ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 110 | \ Should Be Equal ${rc} ${0} |
| 111 | |
| 112 | Create and delete user without password |
| 113 | [Documentation] ***GOOD PATH*** |
| 114 | ... This testcase is to create and delete a user without password |
| 115 | ... in open bmc.\n |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 116 | [Tags] Create_and_delete_user_without_password |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 117 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 118 | ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 119 | ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 120 | ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 121 | ${groupname}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 122 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 123 | ${resp}= Create UserGroup ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 124 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 125 | ${resp}= Create User ${comment} ${username} ${groupname} ${EMPTY} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 126 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 127 | ${user_list}= Get UserList |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 128 | Should Contain ${user_list} ${username} |
| 129 | |
| 130 | Login BMC ${username} ${EMPTY} |
| 131 | ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 132 | Should Be Equal ${rc} ${0} |
| 133 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 134 | ${resp}= Delete User ${username} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 135 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 136 | ${resp}= Delete Group ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 137 | Should Be Equal ${resp} ok |
| 138 | |
| 139 | Set password for existing user |
| 140 | [Documentation] ***GOOD PATH*** |
| 141 | ... This testcase is for testing password set for user |
| 142 | ... in open bmc.\n |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 143 | [Tags] Set_password_for_existing_user |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 144 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 145 | ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 146 | ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 147 | ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 148 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 149 | ${resp}= Create User ${comment} ${username} ${EMPTY} ${password} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 150 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 151 | ${user_list}= Get UserList |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 152 | Should Contain ${user_list} ${username} |
| 153 | |
| 154 | Login BMC ${username} ${password} |
| 155 | ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 156 | Should Be Equal ${rc} ${0} |
| 157 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 158 | ${resp}= Change Password ${username} ${VALID_PASSWORD} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 159 | Should Be Equal ${resp} ok |
| 160 | |
| 161 | Login BMC ${username} ${VALID_PASSWORD} |
| 162 | ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 163 | Should Be Equal ${rc} ${0} |
| 164 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 165 | ${resp}= Delete User ${username} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 166 | Should Be Equal ${resp} ok |
| 167 | |
| 168 | Set password with empty password for existing |
| 169 | [Documentation] ***GOOD PATH*** |
George Keishing | b843a59 | 2016-09-21 09:48:51 -0500 | [diff] [blame] | 170 | ... This testcase is to verify that empty password can be set |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 171 | ... for a existing user.\n |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 172 | [Tags] Set_password_with_empty_password_for_existing |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 173 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 174 | ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 175 | ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 176 | ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 177 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 178 | ${resp}= Create User ${comment} ${username} ${EMPTY} ${password} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 179 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 180 | ${user_list}= Get UserList |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 181 | Should Contain ${user_list} ${username} |
| 182 | |
| 183 | Login BMC ${username} ${password} |
| 184 | ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 185 | Should Be Equal ${rc} ${0} |
| 186 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 187 | ${resp}= Change Password ${username} ${EMPTY} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 188 | Should Be Equal ${resp} ok |
| 189 | |
| 190 | Login BMC ${username} ${EMPTY} |
| 191 | ${rc}= Execute Command echo Login return_stdout=False return_rc=True |
| 192 | Should Be Equal ${rc} ${0} |
| 193 | |
| 194 | Set password for non existing user |
| 195 | [Documentation] ***BAD PATH*** |
| 196 | ... This testcase is for testing password set for non-existing user |
| 197 | ... in open bmc.\n |
George Keishing | c965bc1 | 2016-10-18 12:15:43 -0500 | [diff] [blame] | 198 | [Tags] Set_password_for_non_existing_user |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 199 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 200 | ${resp}= Change Password ${NON_EXISTING_USER} ${VALID_PASSWORD} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 201 | Should Be Equal ${resp} error |
| 202 | |
| 203 | Create existing user |
| 204 | [Documentation] ***BAD PATH*** |
| 205 | ... This testcase is for checking that user creation is not allowed |
| 206 | ... for existing user in open bmc.\n |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 207 | [Tags] Create_existing_user |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 208 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 209 | ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 210 | ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 211 | ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 212 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 213 | ${resp}= Create User ${comment} ${username} ${EMPTY} ${EMPTY} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 214 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 215 | ${resp}= Create User ${comment} ${username} ${EMPTY} ${EMPTY} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 216 | Should Be Equal ${resp} error |
| 217 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 218 | ${resp}= Delete User ${username} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 219 | Should Be Equal ${resp} ok |
| 220 | |
| 221 | Create user with no name |
| 222 | [Documentation] ***BAD PATH*** |
| 223 | ... This testcase is for checking that user creation is not allowed |
| 224 | ... with empty username in open bmc.\n |
George Keishing | c965bc1 | 2016-10-18 12:15:43 -0500 | [diff] [blame] | 225 | [Tags] Create_user_with_no_name |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 226 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 227 | ${username}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 228 | ${password}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 229 | ${comment}= Generate Random String ${RANDOM_STRING_LENGTH} |
| 230 | ${groupname}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 231 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 232 | ${resp}= Create User ${comment} ${EMPTY} ${groupname} ${password} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 233 | Should Be Equal ${resp} error |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 234 | ${user_list}= Get UserList |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 235 | Should Not Contain ${user_list} ${EMPTY} |
| 236 | |
| 237 | Create existing user group |
| 238 | [Documentation] ***BAD PATH*** |
| 239 | ... This testcase is for checking that user group creation is not allowed |
| 240 | ... for existing user group in open bmc.\n |
George Keishing | c965bc1 | 2016-10-18 12:15:43 -0500 | [diff] [blame] | 241 | [Tags] Create_existing_user_group |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 242 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 243 | ${groupname}= Generate Random String ${RANDOM_STRING_LENGTH} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 244 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 245 | ${resp}= Create UserGroup ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 246 | Should Be Equal ${resp} ok |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 247 | ${resp}= Create UserGroup ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 248 | Should Be Equal ${resp} error |
| 249 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 250 | ${resp}= Delete Group ${groupname} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 251 | Should Be Equal ${resp} ok |
| 252 | |
| 253 | Create user group with no name |
| 254 | [Documentation] ***BAD PATH*** |
| 255 | ... This testcase is for checking that user group creation is not allowed |
| 256 | ... with empty groupname in open bmc.\n |
George Keishing | c965bc1 | 2016-10-18 12:15:43 -0500 | [diff] [blame] | 257 | [Tags] Create_user_group_with_no_name |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 258 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 259 | ${resp}= Create UserGroup ${EMPTY} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 260 | Should Be Equal ${resp} error |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 261 | ${usergroup_list}= Get GroupListUsr |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 262 | Should Not Contain ${usergroup_list} ${EMPTY} |
| 263 | |
George Keishing | b843a59 | 2016-09-21 09:48:51 -0500 | [diff] [blame] | 264 | Cleanup Users List |
| 265 | [Documentation] ***GOOD PATH*** |
| 266 | ... This testcase is to clean up multiple users created by |
| 267 | ... the test so as to leave the system in cleaner state. |
| 268 | ... This is a no-op if there is no user list on the BMC. |
George Keishing | c965bc1 | 2016-10-18 12:15:43 -0500 | [diff] [blame] | 269 | [Tags] Cleanup_Users_List |
George Keishing | b843a59 | 2016-09-21 09:48:51 -0500 | [diff] [blame] | 270 | |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 271 | ${user_list}= Get UserList |
George Keishing | b843a59 | 2016-09-21 09:48:51 -0500 | [diff] [blame] | 272 | : FOR ${username} IN @{user_list} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 273 | \ ${resp}= Delete User ${username} |
George Keishing | b843a59 | 2016-09-21 09:48:51 -0500 | [diff] [blame] | 274 | \ Should Be Equal ${resp} ok |
| 275 | |
| 276 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 277 | *** Keywords *** |
| 278 | |
| 279 | Get UserList |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 280 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 281 | ${resp}= OpenBMC Post Request |
| 282 | ... ${USER_MANAGER_URI}Users/action/UserList data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 283 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 284 | ${jsondata}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 285 | [Return] ${jsondata['data']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 286 | |
| 287 | Get GroupListUsr |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 288 | ${data}= create dictionary data=@{EMPTY} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 289 | ${resp}= OpenBMC Post Request |
| 290 | ... ${USER_MANAGER_URI}/Groups/action/GroupListUsr data=${data} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 291 | should be equal as strings ${resp.status_code} ${HTTP_OK} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 292 | ${jsondata}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 293 | [Return] ${jsondata['data']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 294 | |
| 295 | Create User |
| 296 | [Arguments] ${comment} ${username} ${groupname} ${password} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 297 | @{user_list}= Create List ${comment} ${username} ${groupname} ${password} |
| 298 | ${data}= create dictionary data=@{user_list} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 299 | ${resp}= OpenBMC Post Request |
| 300 | ... ${USER_MANAGER_URI}Users/action/UserAdd data=${data} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 301 | ${jsondata}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 302 | [Return] ${jsondata['status']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 303 | |
| 304 | Change Password |
| 305 | [Arguments] ${username} ${password} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 306 | @{user_list}= Create List ${username} ${password} |
| 307 | ${data}= create dictionary data=@{user_list} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 308 | ${resp}= OpenBMC Post Request |
| 309 | ... ${USER_MANAGER_URI}User/action/Passwd data=${data} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 310 | ${jsondata}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 311 | [Return] ${jsondata['status']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 312 | |
| 313 | Create UserGroup |
| 314 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 315 | @{group_list}= Create List ${args} |
| 316 | ${data}= create dictionary data=@{group_list} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 317 | ${resp}= OpenBMC Post Request |
| 318 | ... ${USER_MANAGER_URI}Groups/action/GroupAddUsr data=${data} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 319 | ${jsondata}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 320 | [Return] ${jsondata['status']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 321 | |
| 322 | Delete Group |
| 323 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 324 | @{group_list}= Create List ${args} |
| 325 | ${data}= create dictionary data=@{group_list} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 326 | ${resp}= OpenBMC Post Request |
| 327 | ... ${USER_MANAGER_URI}Group/action/GroupDel data=${data} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 328 | ${jsondata}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 329 | [Return] ${jsondata['status']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 330 | |
| 331 | Delete User |
| 332 | [Arguments] ${args} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 333 | @{user_list}= Create List ${args} |
| 334 | ${data}= create dictionary data=@{user_list} |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 335 | ${resp}= OpenBMC Post Request |
| 336 | ... ${USER_MANAGER_URI}User/action/Userdel data=${data} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 337 | ${jsondata}= to json ${resp.content} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 338 | [Return] ${jsondata['status']} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 339 | |
| 340 | Login BMC |
| 341 | [Arguments] ${username} ${password} |
| 342 | Open connection ${OPENBMC_HOST} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 343 | ${resp}= Login ${username} ${password} |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 344 | [Return] ${resp} |