public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Petr Lautrbach <lautrbach@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: Test semanage operation with /var/lib/selinux on NFS
Date: Fri, 11 Sep 2026 13:22:10 GMT	[thread overview]
Message-ID: <178913293045.1.10030390950320905450.tests-selinux-68d3f4d812f6@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 68d3f4d812f68981a7ce332fa75b84e7ff4ae914
            Author : Petr Lautrbach <lautrbach@redhat.com>
            Date   : 2024-11-11T13:42:47+01:00
            Stats  : +55/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/68d3f4d812f68981a7ce332fa75b84e7ff4ae914?branch=pr775-checkpolicy-revdeps

            Log:
            Test semanage operation with /var/lib/selinux on NFS

Verifies: RHEL-60503

---
diff --git a/libsemanage/semanage-root-on-nfs/main.fmf b/libsemanage/semanage-root-on-nfs/main.fmf
new file mode 100644
index 0000000..20e219d
--- /dev/null
+++ b/libsemanage/semanage-root-on-nfs/main.fmf
@@ -0,0 +1,11 @@
+summary: Test semanage operation with /var/lib/selinux on NFS
+test: ./test.sh
+framework: beakerlib
+component: libsemanage
+requires:
+  - nfs-utils
+  - policycoreutils-python-utils
+duration: 10m
+enabled: true
+link:
+  - verifies: https://issues.redhat.com/browse/RHEL-60503

diff --git a/libsemanage/semanage-root-on-nfs/test.sh b/libsemanage/semanage-root-on-nfs/test.sh
new file mode 100755
index 0000000..d7c944a
--- /dev/null
+++ b/libsemanage/semanage-root-on-nfs/test.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+STORE_ROOT=$( grep -E '^store-root' /etc/selinux/semanage.conf | tr -d ' ' | cut -d '=' -f 2 )
+if [ -z "$STORE_ROOT" ]; then
+    STORE_ROOT=/var/lib/selinux
+fi
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+        rlRun "pushd $tmp"
+        rlRun "set -o pipefail"
+        rlAssertRpm nfs-utils
+        rlAssertRpm policycoreutils-python-utils
+        rlRun "mkdir -p /srv/nfs/selinux"
+        rlRun "cp -r $STORE_ROOT /srv/selinux"
+        rlRun "mount --bind /srv/selinux /srv/nfs/selinux"
+        rlRun "sed -i 's%.*rootdir.*=.*%rootdir=/srv/nfs%' /etc/nfs.conf"
+        rlRun "systemctl enable nfs-server --now"
+        rlRun "cat > /etc/exports <<EOF
+/selinux *(rw,sync,no_root_squash)
+EOF"
+        rlRun "exportfs -a"
+        rlRun "showmount -e 127.0.0.1"
+        rlRun "mount 127.0.0.1:/selinux $STORE_ROOT"
+    rlPhaseEnd
+
+    rlPhaseStartTest "semanage root on nfs"
+        rlRun "semanage fcontext -a -e /home /tmp/testdir"
+        rlRun "semanage fcontext -d -e /home /tmp/testdir"
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "umount $STORE_ROOT"
+        rlRun "systemctl disable nfs-server --now"
+        rlRun "umount /srv/nfs/selinux"
+        rlRun "rm -rf /srv"
+        rlRun "popd"
+        rlRun "rm -r $tmp" 0 "Remove tmp directory"
+    rlPhaseEnd
+rlJournalEnd

                 reply	other threads:[~2026-09-11 13:22 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=178913293045.1.10030390950320905450.tests-selinux-68d3f4d812f6@fedoraproject.org \
    --to=lautrbach@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