Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions e2e-tests/tests/login_as_owner_with_allowed_users_owner.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
*** Settings ***
Resource resources/utils.resource
Resource resources/authd.resource

Resource resources/broker.resource

# Test Tags robot:exit-on-failure

Test Setup utils.Test Setup snapshot=%{BROKER}-installed
Test Teardown utils.Test Teardown


*** Variables ***
${username} %{E2E_USER}
${local_password} qwer1234


*** Test Cases ***
Test that owner can log in with allowed_users set to OWNER
[Documentation] This test verifies that when allowed_users is set to OWNER and the owner is set to the test user, the user can log in successfully and the broker configuration remains unchanged.

Log In

# Set allowed_users to OWNER and owner to the test user
Change allowed_users In Broker Configuration OWNER
Change Broker Configuration owner ${username}

# Log in with remote user with device authentication
Open Terminal
Log In With Remote User Through CLI: QR Code ${username} ${local_password}
Log Out From Terminal Session
Close Focused Window

# Verify that the broker configuration was not changed
Open Terminal In Sudo Mode
Check Configuration Value owner owner = ${username}
35 changes: 35 additions & 0 deletions e2e-tests/tests/login_as_specific_allowed_user.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
*** Settings ***
Resource resources/utils.resource
Resource resources/authd.resource

Resource resources/broker.resource

# Test Tags robot:exit-on-failure

Test Setup utils.Test Setup snapshot=%{BROKER}-installed
Test Teardown utils.Test Teardown


*** Variables ***
${username} %{E2E_USER}
${local_password} qwer1234


*** Test Cases ***
Test that user can log in with allowed_users set to their username
[Documentation] This test verifies that when allowed_users is set to the test user's username, the user can log in successfully and the broker configuration remains unchanged.

Log In

# Set allowed_users to the test user's username
Change allowed_users In Broker Configuration ${username}

# Log in with remote user with device authentication
Open Terminal
Log In With Remote User Through CLI: QR Code ${username} ${local_password}
Log Out From Terminal Session
Close Focused Window

# Verify that the broker configuration was not changed
Open Terminal In Sudo Mode
Check Configuration Value allowed_users allowed_users = ${username}
31 changes: 31 additions & 0 deletions e2e-tests/tests/login_denied_as_non_allowed_user.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
*** Settings ***
Resource resources/utils.resource
Resource resources/authd.resource

Resource resources/broker.resource

# Test Tags robot:exit-on-failure

Test Setup utils.Test Setup snapshot=%{BROKER}-installed
Test Teardown utils.Test Teardown


*** Variables ***
${username} %{E2E_USER}


*** Test Cases ***
Test that login fails when user is not in allowed_users list
[Documentation] This test verifies that when allowed_users is set to a different user, the test user cannot log in and receives a permission denied error.

Log In

# Set allowed_users to a different user that is not the test user
Change allowed_users In Broker Configuration different-user

# Attempt to log in with remote user
Open Terminal
Start Log In With Remote User Through CLI: QR Code ${username}
Select Provider
Continue Log In With Remote User: Authenticate In External Browser
Check That Remote User Is Not Allowed To Log In
32 changes: 32 additions & 0 deletions e2e-tests/tests/login_denied_with_allowed_users_owner_empty.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*** Settings ***
Resource resources/utils.resource
Resource resources/authd.resource

Resource resources/broker.resource

# Test Tags robot:exit-on-failure

Test Setup utils.Test Setup snapshot=%{BROKER}-installed
Test Teardown utils.Test Teardown


*** Variables ***
${username} %{E2E_USER}


*** Test Cases ***
Test that login fails with allowed_users set to OWNER and empty owner
[Documentation] This test verifies that when allowed_users is set to OWNER and owner is explicitly set to an empty value, login fails with permission denied because no user can match an empty owner.

Log In

# Set allowed_users to OWNER and owner to empty value
Change allowed_users In Broker Configuration OWNER
Change Broker Configuration owner ${EMPTY}

# Attempt to log in with remote user
Open Terminal
Start Log In With Remote User Through CLI: QR Code ${username}
Select Provider
Continue Log In With Remote User: Authenticate In External Browser
Check That Remote User Is Not Allowed To Log In
35 changes: 35 additions & 0 deletions e2e-tests/tests/login_with_allowed_users_all.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
*** Settings ***
Resource resources/utils.resource
Resource resources/authd.resource

Resource resources/broker.resource

# Test Tags robot:exit-on-failure

Test Setup utils.Test Setup snapshot=%{BROKER}-installed
Test Teardown utils.Test Teardown


*** Variables ***
${username} %{E2E_USER}
${local_password} qwer1234


*** Test Cases ***
Test that any user can log in with allowed_users set to ALL
[Documentation] This test verifies that when allowed_users is set to ALL, any user can log in successfully and the broker configuration remains unchanged.

Log In

# Set allowed_users to ALL to allow any user
Change allowed_users In Broker Configuration ALL

# Log in with remote user with device authentication
Open Terminal
Log In With Remote User Through CLI: QR Code ${username} ${local_password}
Log Out From Terminal Session
Close Focused Window

# Verify that the broker configuration was not changed
Open Terminal In Sudo Mode
Check Configuration Value allowed_users allowed_users = ALL
Loading