diff --git a/e2e-tests/tests/login_as_owner_with_allowed_users_owner.robot b/e2e-tests/tests/login_as_owner_with_allowed_users_owner.robot new file mode 100644 index 0000000000..d8b2fb643a --- /dev/null +++ b/e2e-tests/tests/login_as_owner_with_allowed_users_owner.robot @@ -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} diff --git a/e2e-tests/tests/login_as_specific_allowed_user.robot b/e2e-tests/tests/login_as_specific_allowed_user.robot new file mode 100644 index 0000000000..25dbb10a0d --- /dev/null +++ b/e2e-tests/tests/login_as_specific_allowed_user.robot @@ -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} diff --git a/e2e-tests/tests/login_denied_as_non_allowed_user.robot b/e2e-tests/tests/login_denied_as_non_allowed_user.robot new file mode 100644 index 0000000000..2f20e1b76f --- /dev/null +++ b/e2e-tests/tests/login_denied_as_non_allowed_user.robot @@ -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 diff --git a/e2e-tests/tests/login_denied_with_allowed_users_owner_empty.robot b/e2e-tests/tests/login_denied_with_allowed_users_owner_empty.robot new file mode 100644 index 0000000000..9ee8f4b6ec --- /dev/null +++ b/e2e-tests/tests/login_denied_with_allowed_users_owner_empty.robot @@ -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 diff --git a/e2e-tests/tests/login_with_allowed_users_all.robot b/e2e-tests/tests/login_with_allowed_users_all.robot new file mode 100644 index 0000000000..567f4be93d --- /dev/null +++ b/e2e-tests/tests/login_with_allowed_users_all.robot @@ -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