public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: delete the test user and the base.cil file
@ 2026-09-11 13:18 Milos Malik
  0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:18 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 5ff9ff4d44d78c6c11de5f5291bd4311aa40339f
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2021-01-08T10:44:56+01:00
            Stats  : +3/-1 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/5ff9ff4d44d78c6c11de5f5291bd4311aa40339f?branch=pr775-checkpolicy-revdeps

            Log:
            delete the test user and the base.cil file

Repeated run of the TC in the same location revealed 2 issues:
the test user (toor) and the base.cil (modified policy module) file
were not deleted, which lead to unnecessary failures.
Both issues should be fixed now.

---
diff --git a/selinux-policy/perf_event-and-related/runtest.sh b/selinux-policy/perf_event-and-related/runtest.sh
index d71422f..a971635 100755
--- a/selinux-policy/perf_event-and-related/runtest.sh
+++ b/selinux-policy/perf_event-and-related/runtest.sh
@@ -41,6 +41,7 @@ rlJournalStart
         rlAssertRpm ${PACKAGE}-targeted
         rlAssertRpm perf
 
+        rlRun "rm -f base.cil"
         rlRun "semodule -c -E base"
         if grep -q perf_event base.cil ; then
             rlLog "current SELinux policy already defines the perf_event class"
@@ -74,6 +75,7 @@ rlJournalStart
         rlRun "grep -i permit /etc/ssh/sshd_config"
         rlFileBackup /etc/ssh/sshd_config
         rlRun "sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config"
+        rlRun "sed -i 's/^.*PasswordAuthentication.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config"
         rlRun "service sshd restart"
         rlRun "setsebool ssh_sysadm_login on"
         USER_NAME="toor"
@@ -81,7 +83,7 @@ rlJournalStart
         rlRun "useradd -o -u 0 -g 0 -Z sysadm_u ${USER_NAME}"
         rlRun "echo ${USER_SECRET} | passwd --stdin ${USER_NAME}"
         rlRun "./ssh.exp ${USER_NAME}/sysadm_r ${USER_SECRET} localhost perf record -o /dev/null echo test"
-        rlRun "userdel -Z ${USER_NAME}"
+        rlRun "userdel -rfZ ${USER_NAME}"
         rlRun "setsebool ssh_sysadm_login off"
         rlFileRestore
         rlRun "service sshd restart"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:18 [tests/selinux] pr775-checkpolicy-revdeps: delete the test user and the base.cil file Milos Malik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox