Skip to content

[e2e] Improve su related tests#1506

Open
denisonbarbosa wants to merge 6 commits intomainfrom
fix-e2e-su-tests
Open

[e2e] Improve su related tests#1506
denisonbarbosa wants to merge 6 commits intomainfrom
fix-e2e-su-tests

Conversation

@denisonbarbosa
Copy link
Copy Markdown
Member

We used to have a separate .robot file for these tests, but going through the device authentication flow is too demanding for simple tests like these. This moves them to login.robot and updates the "su without argument" check to ensure that authenticating the root user is not an authd flow.

Since those tests are quite simple, we can add them to another test and
avoid having to go through the demanding device authentication process.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.97%. Comparing base (cd4d6ba) to head (cdc472e).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1506      +/-   ##
==========================================
+ Coverage   81.54%   86.97%   +5.42%     
==========================================
  Files          20       93      +73     
  Lines        1111     6443    +5332     
  Branches        0      111     +111     
==========================================
+ Hits          906     5604    +4698     
- Misses        205      783     +578     
- Partials        0       56      +56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@denisonbarbosa denisonbarbosa marked this pull request as ready for review May 6, 2026 12:41
@denisonbarbosa denisonbarbosa requested a review from adombeck May 6, 2026 12:41
@adombeck
Copy link
Copy Markdown
Contributor

adombeck commented May 6, 2026

The previous "sudo su" was covering a different flow. The changes in
this commit make sure we cover the cases where an empty "su" actually
goes through the PAM stack, since it tries to authenticate the root
user.
@denisonbarbosa
Copy link
Copy Markdown
Member Author

the test is failing in this job: https://authd-e2e-test-logs.adrian-dombeck.workers.dev/pr-1506/run-25435165169-1/resolute-authd-msentraid/log.html#s1-s10-t1-k12

Yeah, I forgot we disabled the root password on the test VMs. It should be fixed with the recent push.

Copy link
Copy Markdown
Contributor

@adombeck adombeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, please re-request a review once you checked that the relevant tests pass. Thanks!

@denisonbarbosa denisonbarbosa requested a review from adombeck May 6, 2026 15:34
Comment thread e2e-tests/resources/broker.resource Outdated
Comment thread e2e-tests/resources/broker.resource Outdated
Comment thread e2e-tests/tests/login.robot Outdated
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}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keyword name Try xyz suggests to me that an expected outcome is that xyz works. I suggest changing it to:

Suggested change
Try Changing Username In su Log In ${username}
Check Username Cannot Be Changed When Using su ${username}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't necessarily agree with it, but I don't have a strong opinion on the name also. I'll update the keywords.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Comment thread e2e-tests/tests/login.robot Outdated
Log In With Remote User Through CLI: Local Password ${username} ${local_password}

# Try to change username during su login, it should not be possible
Check That Username Cannot Be Changed When Using su ${username}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this is weird. It's like the CTRL_L C from "Cancel Operation" never happened

By looking at the test logs, it seems like machinectl on Noble doesn't
capture keyboard signals properly, so let's use a different approach
instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants