public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Milos Malik <mmalik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: test how semanage handles spaces in fcontext patterns
Date: Fri, 11 Sep 2026 13:20:05 GMT [thread overview]
Message-ID: <178913280584.1.13315743466388396395.tests-selinux-01e114b092f2@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 01e114b092f2cbd82ba6dacf3f42d9fc3ae94e2b
Author : Milos Malik <mmalik@redhat.com>
Date : 2022-07-15T13:27:05+00:00
Stats : +164/-0 in 4 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/01e114b092f2cbd82ba6dacf3f42d9fc3ae94e2b?branch=pr775-checkpolicy-revdeps
Log:
test how semanage handles spaces in fcontext patterns
The semanage tool refuses (for some time already) fcontext patterns
which contain spaces. The TC checks if other whitespace characters
are treated the same way.
The TC covers BZ#1893545.
---
diff --git a/policycoreutils/spaces-in-fcontext-patterns/Makefile b/policycoreutils/spaces-in-fcontext-patterns/Makefile
new file mode 100644
index 0000000..b39090e
--- /dev/null
+++ b/policycoreutils/spaces-in-fcontext-patterns/Makefile
@@ -0,0 +1,66 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Makefile of /CoreOS/policycoreutils/Regression/spaces-in-fcontext-patterns
+# Description: Does semanage accept spaces in fcontext patterns?
+# Author: Milos Malik <mmalik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+export TEST=/CoreOS/policycoreutils/Regression/spaces-in-fcontext-patterns
+export TESTVERSION=1.0
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile PURPOSE
+
+.PHONY: all install download clean
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ chmod a+x runtest.sh
+ chcon -t bin_t runtest.sh
+
+clean:
+ rm -f *~ $(BUILT_FILES)
+
+include /usr/share/rhts/lib/rhts-make.include
+
+$(METADATA): Makefile
+ @echo "Owner: Milos Malik <mmalik@redhat.com>" > $(METADATA)
+ @echo "Name: $(TEST)" >> $(METADATA)
+ @echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
+ @echo "Path: $(TEST_DIR)" >> $(METADATA)
+ @echo "Description: Does semanage accept spaces in fcontext patterns?" >> $(METADATA)
+ @echo "Type: Regression" >> $(METADATA)
+ @echo "TestTime: 10m" >> $(METADATA)
+ @echo "RunFor: policycoreutils" >> $(METADATA)
+ @echo "Requires: audit libselinux libselinux-utils policycoreutils selinux-policy selinux-policy-targeted /usr/sbin/semanage" >> $(METADATA)
+ @echo "Priority: Normal" >> $(METADATA)
+ @echo "License: GPLv2" >> $(METADATA)
+ @echo "Confidential: no" >> $(METADATA)
+ @echo "Destructive: no" >> $(METADATA)
+ @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA)
+ @echo "Bug: 1893545" >> $(METADATA) # Fedora 32
+
+ rhts-lint $(METADATA)
+
diff --git a/policycoreutils/spaces-in-fcontext-patterns/PURPOSE b/policycoreutils/spaces-in-fcontext-patterns/PURPOSE
new file mode 100644
index 0000000..db31d4a
--- /dev/null
+++ b/policycoreutils/spaces-in-fcontext-patterns/PURPOSE
@@ -0,0 +1,5 @@
+PURPOSE of /CoreOS/policycoreutils/Regression/spaces-in-fcontext-patterns
+Author: Milos Malik <mmalik@redhat.com>
+
+Description: Does semanage accept spaces in fcontext patterns?
+
diff --git a/policycoreutils/spaces-in-fcontext-patterns/main.fmf b/policycoreutils/spaces-in-fcontext-patterns/main.fmf
new file mode 100644
index 0000000..ad152e7
--- /dev/null
+++ b/policycoreutils/spaces-in-fcontext-patterns/main.fmf
@@ -0,0 +1,37 @@
+summary: Does semanage accept spaces in fcontext patterns?
+description: |+
+ Does semanage accept spaces in fcontext patterns?
+
+contact: Milos Malik <mmalik@redhat.com>
+component:
+ - policycoreutils
+test: ./runtest.sh
+framework: beakerlib
+recommend:
+ - audit
+ - libselinux
+ - libselinux-utils
+ - policycoreutils
+ - selinux-policy
+ - selinux-policy-targeted
+ - /usr/sbin/semanage
+environment:
+ AVC_ERROR: +no_avc_check
+duration: 10m
+enabled: true
+tag:
+ - CI-Tier-1
+ - NoRHEL4
+ - NoRHEL5
+ - NoRHEL6
+ - NoRHEL7
+ - Tier1
+ - Tier1se
+ - targeted
+tier: '1'
+link:
+ - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1893545
+adjust:
+ - enabled: false
+ when: distro == rhel-4, rhel-5, rhel-6, rhel-7
+ continue: false
diff --git a/policycoreutils/spaces-in-fcontext-patterns/runtest.sh b/policycoreutils/spaces-in-fcontext-patterns/runtest.sh
new file mode 100755
index 0000000..ea57c89
--- /dev/null
+++ b/policycoreutils/spaces-in-fcontext-patterns/runtest.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /CoreOS/policycoreutils/Regression/spaces-in-fcontext-patterns
+# Description: Does semanage accept spaces in fcontext patterns?
+# Author: Milos Malik <mmalik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include Beaker environment
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+PACKAGE="policycoreutils"
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlAssertRpm ${PACKAGE}
+ rlRun "rpm -qf `which semanage`"
+ rlPhaseEnd
+
+ rlPhaseStartTest "bz#1893545"
+ rlRun "semanage fcontext -l -C"
+ rlRun "semanage fcontext -a -t public_content_t '/mnt/media/My\ Dir(/.*)?'" 1
+ rlRun "semanage fcontext -a -t public_content_t '/mnt/media/My Dir(/.*)?'" 1
+ rlRun "semanage fcontext -a -t public_content_t '/mnt/media/My\rDir(/.*)?'" 1
+ rlRun "semanage fcontext -l -C"
+ rlRun "semanage fcontext -d -t public_content_t '/mnt/media/My\ Dir(/.*)?'" 1
+ rlRun "semanage fcontext -d -t public_content_t '/mnt/media/My Dir(/.*)?'" 1
+ rlRun "semanage fcontext -d -t public_content_t '/mnt/media/My\rDir(/.*)?'" 1
+ rlRun "semanage fcontext -l -C"
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlPhaseEnd
+rlJournalPrintText
+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=178913280584.1.13315743466388396395.tests-selinux-01e114b092f2@fedoraproject.org \
--to=mmalik@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