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: Can libsepol handle users declared in modules?
Date: Fri, 11 Sep 2026 13:20:13 GMT [thread overview]
Message-ID: <178913281353.1.12538142029464766305.tests-selinux-31f776e00a01@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 31f776e00a01428b7808357eef2347f1fa43028d
Author : Petr Lautrbach <plautrba@redhat.com>
Date : 2022-10-21T15:33:30+02:00
Stats : +49/-0 in 3 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/31f776e00a01428b7808357eef2347f1fa43028d?branch=pr775-checkpolicy-revdeps
Log:
Can libsepol handle users declared in modules?
https://bugzilla.redhat.com/show_bug.cgi?id=2136212
---
diff --git a/libsepol/user-declaration-in-module/foo.te b/libsepol/user-declaration-in-module/foo.te
new file mode 100644
index 0000000..74ee9c9
--- /dev/null
+++ b/libsepol/user-declaration-in-module/foo.te
@@ -0,0 +1,8 @@
+module foo 0.0.1;
+require {
+ role staff_r;
+ sensitivity s0;
+ category c0;
+ category c1023;
+}
+user foo_u roles staff_r level s0 range s0 - s0:c0.c1023;
diff --git a/libsepol/user-declaration-in-module/main.fmf b/libsepol/user-declaration-in-module/main.fmf
new file mode 100644
index 0000000..73aad74
--- /dev/null
+++ b/libsepol/user-declaration-in-module/main.fmf
@@ -0,0 +1,12 @@
+summary: Can libsepol handle users declared in modules?
+test: ./test.sh
+framework: beakerlib
+component:
+ - libsepol
+require:
+ - libsepol-devel
+ - selinux-policy-devel
+tier: 1
+enabled: true
+link:
+ - https://bugzilla.redhat.com/show_bug.cgi?id=2136212
diff --git a/libsepol/user-declaration-in-module/test.sh b/libsepol/user-declaration-in-module/test.sh
new file mode 100755
index 0000000..90ab796
--- /dev/null
+++ b/libsepol/user-declaration-in-module/test.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# SPDX-License-Identifier: GPLv2
+# Copyright (c) 2022 Red Hat, Inc.
+# Author: Petr Lautrbach <plautrba@redhat.com>
+
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+ rlRun "cp foo.te $tmp"
+ rlRun "pushd $tmp"
+ rlRun "set -o pipefail"
+ rlAssertRpm "libsepol"
+ rlAssertRpm "selinux-policy-devel"
+ rlPhaseEnd
+
+ rlPhaseStartTest
+ rlRun "make -f /usr/share/selinux/devel/Makefile foo.pp" 0 "Build a module with user declaration"
+ rlRun "semodule -i foo.pp" 0
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlRun "semodule -r foo" 0
+ rlRun "popd"
+ rlRun "rm -r $tmp" 0 "Remove tmp directory"
+ rlPhaseEnd
+rlJournalEnd
reply other threads:[~2026-09-11 13:20 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=178913281353.1.12538142029464766305.tests-selinux-31f776e00a01@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