-
Notifications
You must be signed in to change notification settings - Fork 36
e2e-tests: Add tests for allowed_users broker property
#1469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nooreldeenmansour
wants to merge
5
commits into
main
Choose a base branch
from
e2e-tests-allowed-users
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f801191
e2e-tests: Add test for owner login with `allowed_users=OWNER`
nooreldeenmansour 43b8492
e2e-tests: Add test for denied login with empty `owner`
nooreldeenmansour 563cf33
e2e-tests: Add test for login with `allowed_users=ALL`
nooreldeenmansour 3a964d1
e2e-tests: Add test for login with matching `allowed_users`
nooreldeenmansour 02dc55e
e2e-tests: Add test for denied login with mismatched `allowed_users`
nooreldeenmansour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
e2e-tests/tests/login_as_owner_with_allowed_users_owner.robot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
32
e2e-tests/tests/login_denied_with_allowed_users_owner_empty.robot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The device auth is the most time consuming and most fragile part of our e2e-tests currently. This PR adds five new tests which all perform device auth. How about we instead add a single new test which performs device auth once and then subsequently tests the various
allowed_usersvalues and for each uses local password authentication to test it.