Revert "Feature 11001: Robot framework linting for E2E tests"
[osm/tests.git] / robot-systest / testsuite / basic_15-rbac_configurations.robot
index 4d45c77..c57b11c 100644 (file)
@@ -1,4 +1,3 @@
-*** 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
@@ -11,7 +10,6 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-
 *** Settings ***
 Documentation   [BASIC-15] RBAC Configurations.
 
@@ -19,75 +17,78 @@ Library   OperatingSystem
 Library   String
 Library   Collections
 
-Resource   ../lib/user_lib.resource
-Resource   ../lib/project_lib.resource
-Resource   ../lib/role_lib.resource
+Resource   %{ROBOT_DEVOPS_FOLDER}/lib/user_lib.robot
+Resource   %{ROBOT_DEVOPS_FOLDER}/lib/project_lib.robot
+Resource   %{ROBOT_DEVOPS_FOLDER}/lib/role_lib.robot
 
-Test Tags   basic_15   cluster_main   daily   regression   azure
+Force Tags   basic_15   cluster_main   daily   regression   azure
 
 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
 
 
 *** Variables ***
 # 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
+${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
 
 
 *** Test Cases ***
 Create And Validate User
-    [Documentation]   Create a user in OSM.
-    Create User   ${USERNAME}   ${USER_PASSWORD}
-    Check If User Exists   ${USERNAME}
+
+    Create User   ${user_name}   ${user_password}
+    Check If User Exists   ${user_name}
+
 
 Assign Role To User
-    [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}
+
+    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}
+
 
 Run Action As User
-    [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}
+
+    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}
+
 
 Create And Update Project
-    [Documentation]   Create a project and update its name.
-    Create Project   ${PROJECT_NAME}
-    Update Project Name   ${PROJECT_NAME}   ${NEW_PROJECT_NAME}
+
+    Create Project   ${project_name}
+    Update Project Name   ${project_name}   ${new_project_name}
+
 
 Create And Validate Role
-    [Documentation]   Create a role and check that exists in OSM.
-    Create Role   ${ROLE_NAME}
-    Check If Role Exists   ${ROLE_NAME}
+
+    Create Role   ${role_name}
+    Check If Role Exists   ${role_name}
+
 
 Update Role Information
-    [Documentation]   Update a role with a capability.
-    Update Role   ${ROLE_NAME}   add='vims: true'
-    Check If Role Exists   ${ROLE_NAME}
+
+    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   ${USERNAME}
-    Delete Project   ${NEW_PROJECT_NAME}
-    Delete Role   ${ROLE_NAME}
+
+    Delete User   ${user_name}
+    Delete Project   ${new_project_name}
+    Delete Role   ${role_name}
 
 
 *** Keywords ***
 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}
+    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}