diff --git a/e2e-tests/resources/broker.resource b/e2e-tests/resources/broker.resource index 9d98d5402a..ceedefb59f 100644 --- a/e2e-tests/resources/broker.resource +++ b/e2e-tests/resources/broker.resource @@ -108,19 +108,23 @@ Log In With Remote User Through CLI: Local Password Match Text ${username}@ubuntu:~$ 120 -Try Changing Username In sudo su Log In - Hid.Type String sudo su +Check That su To Local User Goes To Local Broker + Hid.Type String su ubuntu Hid.Keys Combo Return - Try Navigating Back to User Selection - Cancel Operation + Match Text Password: 120 + Hid.Type String ubuntu # The password for the local user is the same as the username in our test setup + Hid.Keys Combo Return + Match Text ubuntu@ubuntu:~$ 120 -Try Changing Username In su Log In +Check That Username Cannot Be Changed When Using su [Arguments] ${username} Hid.Type String su ${username} Hid.Keys Combo Return Try Navigating Back to User Selection Cancel Operation + Match Text su: Critical error - immediate abort 120 + Try Navigating Back to User Selection # First screen is the autoselected local password mode diff --git a/e2e-tests/resources/utils.resource b/e2e-tests/resources/utils.resource index 79823dd778..bfea9941f6 100644 --- a/e2e-tests/resources/utils.resource +++ b/e2e-tests/resources/utils.resource @@ -118,6 +118,11 @@ Close Terminal In Sudo Mode Close Focused Window +Clear Terminal + Hid.Type String clear + Hid.Keys Combo Return + + Log Out From Terminal Session Match Text @ubuntu 120 # We are in a machinectl session, so we need to ^] thrice to exit properly @@ -176,7 +181,7 @@ Launch App Cancel Operation - Hid.Keys Combo Control_L C + Hid.Keys Combo Control_L c Match Text @ubuntu 15 diff --git a/e2e-tests/tests/login.robot b/e2e-tests/tests/login.robot index 3d9c491021..25352bcc8f 100644 --- a/e2e-tests/tests/login.robot +++ b/e2e-tests/tests/login.robot @@ -33,3 +33,13 @@ Test login with CLI # Log in with remote user with local password Open Terminal In Sudo Mode Log In With Remote User Through CLI: Local Password ${username} ${local_password} + Log Out From Terminal Session + Close Terminal In Sudo Mode + + # Try to change username during su login, it should not be possible + Open Terminal + Check That Username Cannot Be Changed When Using su ${username} + Clear Terminal + + # Check that `su` to a local user goes to the local broker, not authd. + Check That su To Local User Goes To Local Broker diff --git a/e2e-tests/tests/su_login.robot b/e2e-tests/tests/su_login.robot deleted file mode 100644 index ca38e53697..0000000000 --- a/e2e-tests/tests/su_login.robot +++ /dev/null @@ -1,40 +0,0 @@ -*** 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 su login - [Documentation] Test login functionality with su command for remote users. - - # Log in with local user - Log In - - # Log in with remote user with device authentication - Open Terminal - Log In With Remote User Through CLI: QR Code ${username} ${local_password} - # Check remote user is properly added to the system - Check If User Was Added Properly ${username} - Log Out From Terminal Session - Close Focused Window - - # Log in with remote user with local password - Open Terminal In Sudo Mode - Log In With Remote User Through CLI: Local Password ${username} ${local_password} - - # Try to change username during su login, it should not be possible - Try Changing Username In su Log In ${username} - - # Try to change username during su login with sudo, it should not be possible - Try Changing Username In sudo su Log In