blob: 4e5893c114ca8b6ca487335ffff0e639ede932b8 [file] [log] [blame]
garciaaledce1fa82020-07-22 22:14:08 +00001# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10# See the License for the specific language governing permissions and
11# limitations under the License.
12
13*** Variables ***
14${success_return_code} 0
15
16
17*** Keywords ***
18Create User
19 [Arguments] ${user_name} ${user_password}
20
21 Should Not Be Empty ${user_name}
22 Should Not Be Empty ${user_password}
23 ${rc} ${stdout}= Run and Return RC and Output osm user-create ${user_name} --password ${user_password}
24 Log ${stdout}
25 Should Be Equal As Integers ${rc} ${success_return_code}
garciadeblasf4ebaa82022-06-23 13:33:26 +020026 [Return] ${stdout}
garciaaledce1fa82020-07-22 22:14:08 +000027
28
selvi.j89d03cf2023-06-22 07:32:46 +000029Update User Password
30 [Arguments] ${user_name} ${user_password} ${user_new_password}
31
32 Should Not Be Empty ${user_name}
33 Should Not Be Empty ${user_password}
34 Should Not Be Empty ${user_new_password}
35 ${rc} ${stdout}= Run and Return RC and Output osm user-update ${user_name} --current-password ${user_password} --new-password ${user_new_password}
36 Log ${stdout}
37 Should Be Equal As Integers ${rc} ${success_return_code}
38
39
garciaaledce1fa82020-07-22 22:14:08 +000040Update User Role
41 [Arguments] ${user_name} ${project_name} ${role_name}
42
43 Should Not Be Empty ${user_name}
44 Should Not Be Empty ${project_name}
45 Should Not Be Empty ${role_name}
46 ${rc} ${stdout}= Run and Return RC and Output osm user-update --add-project-role '${project_name},${role_name}' ${user_name}
47 Log ${stdout}
48 Should Be Equal As Integers ${rc} ${success_return_code}
49
50
51Check If User Exists
garciadeblasf4ebaa82022-06-23 13:33:26 +020052 [Arguments] ${user_name}
garciaaledce1fa82020-07-22 22:14:08 +000053
54 Should Not Be Empty ${user_name}
55 ${rc} ${stdout}= Run And Return RC And Output osm user-list | awk 'NR>3 {print $2}' | grep "${user_name}"
56 Log ${stdout}
57 Should Be Equal As Integers ${rc} ${success_return_code}
58
59
60Delete User
garciadeblasf4ebaa82022-06-23 13:33:26 +020061 [Arguments] ${user_name}
garciaaledce1fa82020-07-22 22:14:08 +000062
63 ${rc} ${stdout}= Run and Return RC and Output osm user-delete ${user_name}
64 Log ${stdout}
65 Should Be Equal As Integers ${rc} ${success_return_code}