X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Ftestsuite%2Fbasic_15-rbac_configurations.robot;h=4d45c776c76a29d48592787a9cb57b16a035255a;hb=7d7628b6b0033b2026e60bbbde7cb1d9a46f388f;hp=55e011364f80a0498cf6e3ecff8f213656db9b76;hpb=4cf45d797499817b5f639bd6245c3f84e762de14;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 55e0113..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,76 +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 - -Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_15-rbac_configurations_data.py +Resource ../lib/user_lib.resource +Resource ../lib/project_lib.resource +Resource ../lib/role_lib.resource -Force Tags basic_15 cluster_main daily regression +Test Tags basic_15 cluster_main daily regression azure 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 - - 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 - - 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 - - ${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 - - 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 - - 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 - - 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 + [Documentation] Delete user, project and role. [Tags] cleanup - - Delete User ${user_name} - Delete Project ${new_project_name} - Delete Role ${role_name} + Delete User ${USERNAME} + Delete Project ${NEW_PROJECT_NAME} + Delete Role ${ROLE_NAME} *** Keywords *** Suite Cleanup - Run Keyword If Any Tests Failed Run Keyword And Ignore Error Delete User ${user_name} - 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} + [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}