public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: policycoreutils/semanage-login: test range of added login
Date: Fri, 11 Sep 2026 13:17:33 GMT	[thread overview]
Message-ID: <178913265353.1.10563355893242949785.tests-selinux-2e70fcdec80d@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 2e70fcdec80ddba975f9750e023053134e264dd8
            Author : Petr Lautrbach <plautrba@redhat.com>
            Date   : 2019-09-03T17:47:03+02:00
            Stats  : +10/-0 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/2e70fcdec80ddba975f9750e023053134e264dd8?branch=pr775-checkpolicy-revdeps

            Log:
            policycoreutils/semanage-login: test range of added login

When a new login mapping is added, default range should be same as the range of
used SELinux user.

Covers: https://bugzilla.redhat.com/show_bug.cgi?id=1312283

---
diff --git a/policycoreutils/semanage-login/runtest.sh b/policycoreutils/semanage-login/runtest.sh
index daf074c..a69d21a 100755
--- a/policycoreutils/semanage-login/runtest.sh
+++ b/policycoreutils/semanage-login/runtest.sh
@@ -60,6 +60,16 @@ rlJournalStart
         rlRun "userdel -rf xyz"
     rlPhaseEnd
 
+    rlPhaseStartTest "SELinux range of added login should be same as the user's range"
+        rlRun "useradd zyx"
+        rlRun "semanage login -a -s staff_u zyx"
+        loginrange=$(semanage login -l | grep zyx | awk '{print $3}')
+        userrange=$(semanage user -l | grep staff_u | awk '{print $4}')
+        rlAssertEquals "Is zyx login SELinux range same as staff_u SELinux user range" "$loginrange" "$userrange"
+        rlRun "semanage login -d -s staff_u zyx"
+        rlRun "userdel -rf zyx"
+    rlPhaseEnd
+
     rlPhaseStartCleanup
     rlPhaseEnd
 rlJournalPrintText

                 reply	other threads:[~2026-09-11 13:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178913265353.1.10563355893242949785.tests-selinux-2e70fcdec80d@fedoraproject.org \
    --to=plautrba@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox