Skip to content

Commit

Permalink
test: Check VM lifecycle with a sysadm_u user
Browse files Browse the repository at this point in the history
By default, users are `unconfined_u`.

First step in https://bugzilla.redhat.com/show_bug.cgi?id=2328030
  • Loading branch information
martinpitt authored and mvollmer committed Jan 15, 2025
1 parent 239cfd4 commit de52680
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/check-machines-lifecycle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class TestMachinesLifecycle(machineslib.VirtualMachinesCase):
user = self.createUser(user_group='libvirt')
self._testBasic(user, superuser=False)

@testlib.skipImage("No SELinux", "debian-*", "ubuntu-*", "arch", "opensuse*")
def testBasicSysadmU(self):
user = self.createUser(user_group='libvirt')
self.machine.execute(f"semanage login -a -s sysadm_u {user}")
self.addCleanup(self.machine.execute, f"semanage login -d -s sysadm_u {user}")
self._testBasic(user, superuser=False)

def testBasicAdminUser(self):
# The group in debian based distro should be sudo
if "ubuntu" in self.machine.image or "debian" in self.machine.image:
Expand Down

0 comments on commit de52680

Please sign in to comment.