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