X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Ftests.git;a=blobdiff_plain;f=robot-systest%2Ftestsuite%2Fbasic_15-rbac_configurations.robot;fp=robot-systest%2Ftestsuite%2Fbasic_15-rbac_configurations.robot;h=4d45c776c76a29d48592787a9cb57b16a035255a;hp=c57b11c40a7385180d7fd1acbde654dde9377f3b;hb=5e001f506b744021d5ef25999c9da28cf56d8fbc;hpb=b0db4577db692b0d6c9210099c58c808cbc993c1 diff --git a/robot-systest/testsuite/basic_15-rbac_configurations.robot b/robot-systest/testsuite/basic_15-rbac_configurations.robot index c57b11c..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,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + *** Settings *** Documentation [BASIC-15] RBAC Configurations. @@ -17,78 +19,75 @@ 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 -Force Tags basic_15 cluster_main daily regression azure +Test Tags basic_15 cluster_main daily regression azure Suite Teardown Run Keyword And Ignore Error Suite Cleanup *** Variables *** # User, project and roles to use -${user_name} 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 +${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 - - Update User Password ${user_name} ${user_password} ${user_new_password} - ${rc} ${stdout}= Run And Return RC And Output OSM_USER=${user_name} OSM_PROJECT=${user_project} OSM_PASSWORD=${user_new_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}