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: libselinux: add UTF-8 local file-context regression test
Date: Fri, 11 Sep 2026 13:23:57 GMT [thread overview]
Message-ID: <178913303751.1.10762097279686215273.tests-selinux-da9aa8c2bdaa@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : da9aa8c2bdaacbbbe3740ad0d89138922f817234
Author : Petr Lautrbach <lautrbach@redhat.com>
Date : 2026-09-07T18:33:44+02:00
Stats : +71/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/da9aa8c2bdaacbbbe3740ad0d89138922f817234?branch=pr775-checkpolicy-revdeps
Log:
libselinux: add UTF-8 local file-context regression test
Add a new beakerlib test that verifies semanage fcontext and restorecon
work correctly with non-ASCII (UTF-8) paths. The test creates a UTF-8
directory name, applies a local file-context rule, restores labels, and
checks labeling with matchpathcon.
Related: rhbz#2427550
---
diff --git a/libselinux/UTF-8-file-contexts/main.fmf b/libselinux/UTF-8-file-contexts/main.fmf
new file mode 100644
index 0000000..5607d64
--- /dev/null
+++ b/libselinux/UTF-8-file-contexts/main.fmf
@@ -0,0 +1,19 @@
+summary: Verify UTF-8 paths in local file contexts
+description: |+
+ Verify that semanage fcontext can add and use a local file-context rule
+ for a path containing UTF-8 characters.
+
+contact: Petr Lautrbach <lautrbach@redhat.com>
+component:
+ - libselinux
+require:
+ - libselinux-utils
+ - policycoreutils
+ - policycoreutils-python-utils
+enabled: true
+duration: 5m
+tier: 1
+tag:
+ - CI-Tier-1
+link:
+ - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2427550
diff --git a/libselinux/UTF-8-file-contexts/runtest.sh b/libselinux/UTF-8-file-contexts/runtest.sh
new file mode 100755
index 0000000..42743bd
--- /dev/null
+++ b/libselinux/UTF-8-file-contexts/runtest.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /CoreOS/libselinux/Sanity/UTF-8-file-contexts
+# Description: Verify UTF-8 paths in local file contexts
+# Author: Petr Lautrbach <lautrbach@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+FCONTEXT_TYPE="etc_t"
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlAssertRpm libselinux-utils
+ rlAssertRpm policycoreutils
+ rlAssertRpm policycoreutils-python-utils
+ rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
+ rlRun "UTF8_PATH='${TmpDir}/Öffentlich'"
+ rlRun "mkdir -p '${UTF8_PATH}/subdir'"
+ rlRun "touch '${UTF8_PATH}/subdir/file'"
+ rlPhaseEnd
+
+ rlPhaseStartTest
+ rlRun "semanage fcontext -a -t ${FCONTEXT_TYPE} '${UTF8_PATH}(/.*)?'"
+
+ rlRun -s "semanage fcontext -l -C"
+ rlAssertGrep "${UTF8_PATH}" "$rlRun_LOG"
+
+ rlRun -s "restorecon -RFvv '${UTF8_PATH}'"
+ rlAssertNotGrep "Non-ASCII characters found" "$rlRun_LOG"
+
+ rlRun -s "matchpathcon '${UTF8_PATH}'"
+ rlAssertGrep ":${FCONTEXT_TYPE}:" "$rlRun_LOG"
+
+ rlRun -s "matchpathcon '${UTF8_PATH}/subdir/file'"
+ rlAssertGrep ":${FCONTEXT_TYPE}:" "$rlRun_LOG"
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlRun "semanage fcontext -d '${UTF8_PATH}(/.*)?'"
+ rlPhaseEnd
+
+ # Cleanup phase: Remove test directory
+ rlPhaseStartCleanup
+ rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
+ rlPhaseEnd
+
+rlJournalPrintText
+rlJournalEnd
reply other threads:[~2026-09-11 13:23 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=178913303751.1.10762097279686215273.tests-selinux-da9aa8c2bdaa@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