Skip to content

Commit c719b70

Browse files
authored
[Fix] test to check various user group access (#1034)
The existing test checks that users from different groups have different access and that this access can be setup via RHOAI User settings. What this test does: * creates a `custom-admins-group` with `TEST_USER2` user * creates a `custom-users-group` with `TEST_USER3` user * configures first group as admins in RHOAI User settings * configures second group as users in RHOAI User settings Once this was applied it tried to perform operations with three different users: * TEST_USER - expected no privileges and simple `Access permissions needed` page presented * TEST_USER2 - all privileges * TEST_USER3 - no Administration page shown Problem in this approach is that the `TEST_USER` is part of the `dedicated-admins` group, which has a `cluster-admin` role in our default cluster settings. Per this [1], such user is an admin by default. So my changes incorporates usage of the `TEST_USER4` instead of `TEST_USER`. Also, unnecessary check for the product version is removed with this commit. [1] https://access.redhat.com/documentation/en-us/red_hat_openshift_data_science/1/html-single/managing_users_and_user_resources/index#defining-openshift-data-science-admin-and-user-groups_user-mgmt ``` By default, users with cluster admin permissions and users in the dedicated-admins administrator group are OpenShift Data Science administrators, but all users authenticated in OpenShift can access OpenShift Data Science. A cluster admin is a superuser that can perform any action in any project in the OpenShift cluster. ```
1 parent c582e1c commit c719b70

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

ods_ci/tests/Tests/500__jupyterhub/jupyterhub-user-access.robot

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,15 @@ Set Custom Access Groups
103103
Check New Access Configuration Works As Expected
104104
[Documentation] Checks if the new access configuration (using two custom groups)
105105
... works as expected in JH
106-
Launch Dashboard ocp_user_name=${TEST_USER.USERNAME} ocp_user_pw=${TEST_USER.PASSWORD}
107-
... ocp_user_auth_type=${TEST_USER.AUTH_TYPE} dashboard_url=${ODH_DASHBOARD_URL}
106+
Launch Dashboard ocp_user_name=${TEST_USER_4.USERNAME} ocp_user_pw=${TEST_USER_4.PASSWORD}
107+
... ocp_user_auth_type=${TEST_USER_4.AUTH_TYPE} dashboard_url=${ODH_DASHBOARD_URL}
108108
... browser=${BROWSER.NAME} browser_options=${BROWSER.OPTIONS}
109109
... expected_page=${NONE} wait_for_cards=${FALSE}
110-
${version_check}= Is RHODS Version Greater Or Equal Than 1.20.0
111-
IF ${version_check} == True
112-
${status}= Run Keyword And Return Status Launch Jupyter From RHODS Dashboard Link
113-
Run Keyword And Continue On Failure Should Be Equal ${status} ${FALSE}
114-
Run Keyword And Continue On Failure Page Should Contain Access permissions needed
115-
Run Keyword And Continue On Failure Page Should Contain ask your administrator to adjust your permissions.
116-
ELSE
117-
Launch Jupyter From RHODS Dashboard Link
118-
Run Keyword And Continue On Failure Verify Jupyter Access Level expected_result=none
119-
END
110+
${status}= Run Keyword And Return Status Launch Jupyter From RHODS Dashboard Link
111+
Run Keyword And Continue On Failure Should Be Equal ${status} ${FALSE}
112+
Run Keyword And Continue On Failure Page Should Contain Access permissions needed
113+
Run Keyword And Continue On Failure Page Should Contain ask your administrator to adjust your permissions.
114+
120115
Capture Page Screenshot perm_denied_custom.png
121116
Logout From RHODS Dashboard
122117
Login To RHODS Dashboard ${TEST_USER_2.USERNAME} ${TEST_USER_2.PASSWORD} ${TEST_USER_2.AUTH_TYPE}

0 commit comments

Comments
 (0)