public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: Does `sepolicy generate --application` detect writeable locations?
@ 2026-09-11 13:20 Petr Lautrbach
  0 siblings, 0 replies; only message in thread
From: Petr Lautrbach @ 2026-09-11 13:20 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 91109dac9f6185d0e3968db2812b8708a44a35d2
            Author : Petr Lautrbach <lautrbach@redhat.com>
            Date   : 2023-08-09T10:57:04+00:00
            Stats  : +47/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/91109dac9f6185d0e3968db2812b8708a44a35d2?branch=pr775-checkpolicy-revdeps

            Log:
            Does `sepolicy generate --application` detect writeable locations?

Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>

---
diff --git a/policycoreutils/sepolicy-generate-application/main.fmf b/policycoreutils/sepolicy-generate-application/main.fmf
new file mode 100644
index 0000000..5e1cb37
--- /dev/null
+++ b/policycoreutils/sepolicy-generate-application/main.fmf
@@ -0,0 +1,11 @@
+summary: Does `sepolicy generate --application ...` detect writeable locations?
+test: ./test.sh
+framework: beakerlib
+component:
+  - policycoreutils
+require:
+  - policycoreutils
+  - policycoreutils-devel
+  - mariadb-server
+  - abrt
+tier: '3'

diff --git a/policycoreutils/sepolicy-generate-application/test.sh b/policycoreutils/sepolicy-generate-application/test.sh
new file mode 100755
index 0000000..4e8c868
--- /dev/null
+++ b/policycoreutils/sepolicy-generate-application/test.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+        rlRun "pushd $tmp"
+        rlRun "set -o pipefail"
+    rlPhaseEnd
+
+    rlPhaseStartTest "/usr/bin/mysqld_safe"
+        rlRun "mkdir policy"
+        rlRun "sepolicy generate -p policy --application /usr/bin/mysqld_safe"
+        rlRun "cat policy/*fc"
+        for dir in `rpm -ql --dump mariadb-server | sed -n -E '\%\/var\/(log|run|lib)[[:graph:]]* [[:alnum:]]* [[:alnum:]]* [[:alnum:]]* 04.*%s%^([^ ]*).*%\1%p'`; do
+            rlRun "grep $dir policy/*.fc"
+        done
+        rlRun "rm -rf policy"
+    rlPhaseEnd
+
+    rlPhaseStartTest "/usr/sbin/abrtd"
+        rlRun "mkdir policy"
+        rlRun "sepolicy generate -p policy --application /usr/sbin/abrtd"
+        rlRun "cat policy/*fc"
+        for dir in `rpm -ql --dump abrt | sed -n -E '\%\/var\/(log|run|lib)[[:graph:]]* [[:alnum:]]* [[:alnum:]]* [[:alnum:]]* 04.*%s%^([^ ]*).*%\1%p'`; do
+            rlRun "grep $dir policy/*.fc"
+        done
+        rlRun "rm -rf policy"
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "popd"
+        rlRun "rm -r $tmp" 0 "Remove tmp directory"
+    rlPhaseEnd
+rlJournalEnd

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

only message in thread, other threads:[~2026-09-11 13:20 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:20 [tests/selinux] pr775-checkpolicy-revdeps: Does `sepolicy generate --application` detect writeable locations? Petr Lautrbach

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