X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Ftestsuite%2Fbasic_15-rbac_configurations.robot;h=ce6216886300df7941fde7d2295fdc76c761d1e5;hb=HEAD;hp=56cddc0acab0ac22bae5f8cd83d1d685f99e6f8a;hpb=dce1fa815ef9b08b39cf878f13445898c262764c;p=osm%2Ftests.git diff --git a/robot-systest/testsuite/basic_15-rbac_configurations.robot b/robot-systest/testsuite/basic_15-rbac_configurations.robot index 56cddc0..4d45c77 100644 --- a/robot-systest/testsuite/basic_15-rbac_configurations.robot +++ b/robot-systest/testsuite/basic_15-rbac_configurations.robot @@ -1,3 +1,4 @@ +*** Comments *** # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -10,80 +11,83 @@ # See the License for the specific language governing permissions and # limitations under the License. + *** Settings *** -Documentation [BASIC-15] RBAC Configurations. +Documentation [BASIC-15] RBAC Configurations. Library OperatingSystem Library String Library Collections -Resource %{ROBOT_DEVOPS_FOLDER}/lib/user_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/project_lib.robot -Resource %{ROBOT_DEVOPS_FOLDER}/lib/role_lib.robot +Resource ../lib/user_lib.resource +Resource ../lib/project_lib.resource +Resource ../lib/role_lib.resource -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_15-rbac_configurations_data.py +Test Tags basic_15 cluster_main daily regression azure -Suite Teardown Run Keyword And Ignore Error Test Cleanup +Suite Teardown Run Keyword And Ignore Error Suite Cleanup *** Variables *** -${success_return_code} 0 +# User, project and roles to use +${USERNAME} basic_15_test_user +${USER_PASSWORD} Basic_15_user_pass +${USER_NEW_PASSWORD} Basic_15_new_pass +${USER_ROLE} project_user +${USER_PROJECT} admin +${PROJECT_NAME} basic_15_test_project +${NEW_PROJECT_NAME} basic_15_project_test +${ROLE_NAME} test_role +${SUCCESS_RETURN_CODE} 0 + *** Test Cases *** Create And Validate User - [Tags] rbac_configurations sanity regression - - Create User ${user_name} ${user_password} - Check If User Exists ${user_name} - + [Documentation] Create a user in OSM. + Create User ${USERNAME} ${USER_PASSWORD} + Check If User Exists ${USERNAME} Assign Role To User - [Tags] rbac_configurations sanity regression - - Update User Role ${user_name} ${user_project} ${user_role} - Check If User Is Assigned To Project ${user_name} ${user_project} - Check If User Has Role ${user_name} ${user_role} ${user_project} - + [Documentation] Assign a user to a project with a role + Update User Role ${USERNAME} ${USER_PROJECT} ${USER_ROLE} + Check If User Is Assigned To Project ${USERNAME} ${USER_PROJECT} + Check If User Has Role ${USERNAME} ${USER_ROLE} ${USER_PROJECT} Run Action As User - [Tags] rbac_configurations sanity regression - - ${rc} ${stdout}= Run And Return RC And Output OSM_USER=${user_name} OSM_PROJECT=${user_project} OSM_PASSWORD=${user_password} osm ns-list - Should Be Equal As Integers ${rc} ${success_return_code} - + [Documentation] Update the password of the user. + Update User Password ${USERNAME} ${USER_PASSWORD} ${USER_NEW_PASSWORD} + ${rc} ${stdout}= Run And Return RC And Output OSM_USER=${USERNAME} OSM_PROJECT=${USER_PROJECT} OSM_PASSWORD=${USER_NEW_PASSWORD} osm ns-list + Log ${rc} + Log ${stdout} + Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE} Create And Update Project - [Tags] rbac_configurations sanity regression - - Create Project ${project_name} - Update Project Name ${project_name} ${new_project_name} - + [Documentation] Create a project and update its name. + Create Project ${PROJECT_NAME} + Update Project Name ${PROJECT_NAME} ${NEW_PROJECT_NAME} Create And Validate Role - [Tags] rbac_configurations sanity regression - - Create Role ${role_name} - Check If Role Exists ${role_name} - + [Documentation] Create a role and check that exists in OSM. + Create Role ${ROLE_NAME} + Check If Role Exists ${ROLE_NAME} Update Role Information - [Tags] rbac_configurations sanity regression - - Update Role ${role_name} add='vims: true' - Check If Role Exists ${role_name} - + [Documentation] Update a role with a capability. + Update Role ${ROLE_NAME} add='vims: true' + Check If Role Exists ${ROLE_NAME} Delete Allocated Resources - [Tags] rbac_configurations sanity regression cleanup - - Delete User ${user_name} - Delete Project ${new_project_name} - Delete Role ${role_name} + [Documentation] Delete user, project and role. + [Tags] cleanup + Delete User ${USERNAME} + Delete Project ${NEW_PROJECT_NAME} + Delete Role ${ROLE_NAME} *** Keywords *** -Test Cleanup - Run Keyword If Test Failed Run Keyword And Ignore Error Delete User ${user_name} - Run Keyword If Test Failed Run Keyword And Ignore Error Delete Role ${role_name} - Run Keyword If Test Failed Run Keyword And Ignore Error Delete Project ${project_name} - Run Keyword If Test Failed Run Keyword And Ignore Error Delete Project ${new_project_name} +Suite Cleanup + [Documentation] Test Suite Cleanup: Deleting users, roles and projects. + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete User ${USERNAME} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Role ${ROLE_NAME} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${PROJECT_NAME} + Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete Project ${NEW_PROJECT_NAME}