blob: 8047c3347311973090a1f18f11bd27540e24dd8a [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}
26 [Return] ${stdout}
27
28
29Update User Role
30 [Arguments] ${user_name} ${project_name} ${role_name}
31
32 Should Not Be Empty ${user_name}
33 Should Not Be Empty ${project_name}
34 Should Not Be Empty ${role_name}
35 ${rc} ${stdout}= Run and Return RC and Output osm user-update --add-project-role '${project_name},${role_name}' ${user_name}
36 Log ${stdout}
37 Should Be Equal As Integers ${rc} ${success_return_code}
38
39
40Check If User Exists
41 [Arguments] ${user_name}
42
43 Should Not Be Empty ${user_name}
44 ${rc} ${stdout}= Run And Return RC And Output osm user-list | awk 'NR>3 {print $2}' | grep "${user_name}"
45 Log ${stdout}
46 Should Be Equal As Integers ${rc} ${success_return_code}
47
48
49Delete User
50 [Arguments] ${user_name}
51
52 ${rc} ${stdout}= Run and Return RC and Output osm user-delete ${user_name}
53 Log ${stdout}
54 Should Be Equal As Integers ${rc} ${success_return_code}