Skip to content
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

Two rhel-8 ws container scenario fixes #21223

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/verify/check-static-login
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ account required pam_succeed_if.so user ingroup %s""" % m.get_admin_group
'.*Sorry, passwords do not match.')
self.allow_restart_journal_messages()

@testlib.skipImage("FIXME: asks for password again instead of mock-pam-conv", "rhel-8-10")
@testlib.skipWsContainer("mock-pam-conv from cockpit-tests not installed")
def testConversation(self):
m = self.machine
b = self.browser
conf = "/etc/pam.d/cockpit"
if m.ws_container:
if m.ostree_image:
conf = "/etc/pam.d/sshd"
self.restore_dir("/etc/ssh", restart_unit=self.sshd_service)
m.execute("sed -i 's/.*ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/' "
Expand Down Expand Up @@ -476,7 +476,6 @@ account required pam_succeed_if.so user ingroup %s""" % m.get_admin_group

@testlib.skipImage("No SELinux", "debian-*", "ubuntu-*", "arch")
@testlib.skipOstree("No semanage")
@testlib.skipImage("FIXME: Authentication failed: unknown-host", "rhel-8-10")
def testSELinuxRestrictedUser(self):
m = self.machine
b = self.browser
Expand Down Expand Up @@ -509,6 +508,10 @@ account required pam_succeed_if.so user ingroup %s""" % m.get_admin_group
self.allow_journal_messages('.*type=1400.*avc: denied { connectto } .* path="/run/user/.*/bus" scontext=user_u:user_r:user_t:s0.*')

# sysadm_u
# not allowed by default in RHEL 8
if m.image.startswith("rhel-8"):
m.execute("setsebool -P ssh_sysadm_login 1")
self.addCleanup(m.execute, "setsebool -P ssh_sysadm_login 0")
m.execute("useradd priv; echo 'priv:foobar' | chpasswd")
m.execute("usermod -aG wheel priv")
m.execute("semanage login -a -s sysadm_u priv")
Expand Down