Skip to content

test: Add helper function for system admin user#22901

Merged
martinpitt merged 1 commit intocockpit-project:mainfrom
Lunarequest:sudo_user
Feb 19, 2026
Merged

test: Add helper function for system admin user#22901
martinpitt merged 1 commit intocockpit-project:mainfrom
Lunarequest:sudo_user

Conversation

@Lunarequest
Copy link
Contributor

@Lunarequest Lunarequest commented Feb 19, 2026

on opensuse, sudo does not ask for the current user's password it instead asks for the root password. This adds a function to get which user will be prompted for sudo access and (get_sudo_user) and updates checks for Password for admin: to check for the expected user

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks!

@Lunarequest Lunarequest force-pushed the sudo_user branch 3 times, most recently from 3a3fa44 to e17003d Compare February 19, 2026 07:03
attr = "_testlib__" + name
return getattr(method, attr, getattr(class_, attr, default))


Copy link
Member

Choose a reason for hiding this comment

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

Spurious whitespace change

b.wait_visible('#system_information_systime_button[disabled]')

# Gain admin access
user = testlib.get_sudo_user(m.image)
Copy link
Member

Choose a reason for hiding this comment

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

This is also wrong now.

Co-authored-by: Luna D Dragon <luna.dragon@suse.com>
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good, unskips a test, and all is green 🎉

@martinpitt martinpitt merged commit 68613bd into cockpit-project:main Feb 19, 2026
35 of 92 checks passed
@Lunarequest Lunarequest deleted the sudo_user branch February 19, 2026 17:36
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.

3 participants