| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 2 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | # you may not use this file except in compliance with the License. |
| 4 | # You may obtain a copy of the License at |
| 5 | # |
| 6 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | # |
| 8 | # Unless required by applicable law or agreed to in writing, software |
| 9 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | # See the License for the specific language governing permissions and |
| 12 | # limitations under the License. |
| 13 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 14 | |
| 15 | *** Settings *** |
| 16 | Documentation Library providing keywords for CRUD operations over Network Slice Templates with OSM client. |
| 17 | Library OperatingSystem |
| 18 | |
| 19 | |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 20 | *** Variables *** |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 21 | ${SUCCESS_RETURN_CODE} 0 |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 22 | |
| 23 | |
| 24 | *** Keywords *** |
| 25 | Create User |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 26 | [Documentation] Create a user in OSM with the name and password passed as arguments, and return the user id. |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 27 | [Arguments] ${user_name} ${user_password} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 28 | Should Not Be Empty ${user_name} |
| 29 | Should Not Be Empty ${user_password} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 30 | ${rc} ${stdout}= Run And Return Rc And Output osm user-create ${user_name} --password ${user_password} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 31 | Log ${stdout} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 32 | Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE} |
| 33 | RETURN ${stdout} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 34 | |
| selvi.j | 89d03cf | 2023-06-22 07:32:46 +0000 | [diff] [blame] | 35 | Update User Password |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 36 | [Documentation] Update the password of a user in OSM. |
| selvi.j | 89d03cf | 2023-06-22 07:32:46 +0000 | [diff] [blame] | 37 | [Arguments] ${user_name} ${user_password} ${user_new_password} |
| selvi.j | 89d03cf | 2023-06-22 07:32:46 +0000 | [diff] [blame] | 38 | Should Not Be Empty ${user_name} |
| 39 | Should Not Be Empty ${user_password} |
| 40 | Should Not Be Empty ${user_new_password} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 41 | ${rc} ${stdout}= Run And Return Rc And Output osm user-update ${user_name} --current-password ${user_password} --new-password ${user_new_password} |
| selvi.j | 89d03cf | 2023-06-22 07:32:46 +0000 | [diff] [blame] | 42 | Log ${stdout} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 43 | Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE} |
| selvi.j | 89d03cf | 2023-06-22 07:32:46 +0000 | [diff] [blame] | 44 | |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 45 | Update User Role |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 46 | [Documentation] Update the role of a user in a project in OSM. |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 47 | [Arguments] ${user_name} ${project_name} ${role_name} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 48 | Should Not Be Empty ${user_name} |
| 49 | Should Not Be Empty ${project_name} |
| 50 | Should Not Be Empty ${role_name} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 51 | ${rc} ${stdout}= Run And Return Rc And Output osm user-update --add-project-role '${project_name},${role_name}' ${user_name} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 52 | Log ${stdout} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 53 | Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 54 | |
| 55 | Check If User Exists |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 56 | [Documentation] Check if a user exists in OSM. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 57 | [Arguments] ${user_name} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 58 | Should Not Be Empty ${user_name} |
| 59 | ${rc} ${stdout}= Run And Return RC And Output osm user-list | awk 'NR>3 {print $2}' | grep "${user_name}" |
| 60 | Log ${stdout} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 61 | Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 62 | |
| 63 | Delete User |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 64 | [Documentation] Delete from OSM the user passed as argument. |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 65 | [Arguments] ${user_name} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 66 | ${rc} ${stdout}= Run And Return Rc And Output osm user-delete ${user_name} |
| garciaale | dce1fa8 | 2020-07-22 22:14:08 +0000 | [diff] [blame] | 67 | Log ${stdout} |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 68 | Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE} |