public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: policycoreutils: Do the D-bus interfaces/methods of /org/selinux/object work?
@ 2026-09-11 13:17 Petr Lautrbach
0 siblings, 0 replies; only message in thread
From: Petr Lautrbach @ 2026-09-11 13:17 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 85ca1add8f4209869aae8733920aec4e76e56829
Author : Petr Lautrbach <plautrba@redhat.com>
Date : 2019-12-05T08:08:05+00:00
Stats : +127/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/85ca1add8f4209869aae8733920aec4e76e56829?branch=pr775-checkpolicy-revdeps
Log:
policycoreutils: Do the D-bus interfaces/methods of /org/selinux/object work?
Tested interfaces:
"org.selinux.semodule_list"
"org.selinux.customized"
"org.selinux.setenforce"
"org.selinux.relabel_on_boot"
"org.selinux.restorecon"
"org.selinux.semanage"
"org.selinux.change_default_policy"
"org.selinux.change_default_mode"
Original author: Milos Malik <mmalik@redhat.com>
---
diff --git a/policycoreutils/org-selinux-dbus-interfaces/main.fmf b/policycoreutils/org-selinux-dbus-interfaces/main.fmf
new file mode 100644
index 0000000..b916480
--- /dev/null
+++ b/policycoreutils/org-selinux-dbus-interfaces/main.fmf
@@ -0,0 +1,8 @@
+path: /policycoreutils/org-selinux-dbus-interfaces
+summary: Do the D-bus interfaces/methods of /org/selinux/object work as expected?
+description: |
+ Do the D-bus interfaces/methods of /org/selinux/object work as expected?
+relevancy:
+ - "distro = rhel-4, rhel-5, rhel-6, rhel-7: False"
+component: [ policycoreutils ]
+#requires: [ policycoreutils-dbus, selinux-policy-targeted]
diff --git a/policycoreutils/org-selinux-dbus-interfaces/runtest.sh b/policycoreutils/org-selinux-dbus-interfaces/runtest.sh
new file mode 100755
index 0000000..8c1a879
--- /dev/null
+++ b/policycoreutils/org-selinux-dbus-interfaces/runtest.sh
@@ -0,0 +1,119 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /CoreOS/policycoreutils/Sanity/org-selinux-dbus-interfaces
+# Description: Do the D-bus interfaces/methods of /org/selinux/object work as expected?
+# Author: Milos Malik <mmalik@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2017 Red Hat, Inc.
+#
+# 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/bin/rhts-environment.sh || exit 1
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+PACKAGE="policycoreutils"
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlAssertRpm ${PACKAGE}
+ rlAssertRpm ${PACKAGE}-gui
+ rlFileBackup /etc/selinux/config
+ rlRun "gdbus introspect --system -d org.selinux -o /"
+ rlRun "gdbus introspect --system -d org.selinux -o /org"
+ rlRun "gdbus introspect --system -d org.selinux -o /org/selinux"
+ rlRun "gdbus introspect --system -d org.selinux -o /org/selinux/object"
+ rlRun "ps -efZ | grep -v grep | grep ':semanage_t:.*selinux_server'"
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.semodule_list"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.semodule_list"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.semodule_list int64:0" 1
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.customized"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.customized"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.customized int64:0" 1
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.setenforce"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.setenforce" 1
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.setenforce int64:0"
+ rlRun "getenforce | grep -i Permissive"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.setenforce int64:0"
+ rlRun "getenforce | grep -i Permissive"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.setenforce int64:1"
+ rlRun "getenforce | grep -i Enforcing"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.setenforce int64:1"
+ rlRun "getenforce | grep -i Enforcing"
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.relabel_on_boot"
+ rlLog "bz#1415988 + bz#1754873"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.relabel_on_boot" 1
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.relabel_on_boot int64:1"
+ rlRun "ls -Z /.autorelabel"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.relabel_on_boot int64:1"
+ rlRun "ls -Z /.autorelabel"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.relabel_on_boot int64:0"
+ rlRun "ls -Z /.autorelabel" 2
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.relabel_on_boot int64:0"
+ rlRun "ls -Z /.autorelabel" 2
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.restorecon"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.restorecon" 1
+ # TODO restorecon(in s path);
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.semanage"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.semanage" 1
+ # TODO semanage(in s buf);
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.change_default_policy"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_policy" 1
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_policy string:minimum"
+ rlRun "grep SELINUXTYPE=minimum /etc/selinux/config"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_policy string:mls"
+ rlRun "grep SELINUXTYPE=mls /etc/selinux/config"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_policy string:targeted"
+ rlRun "grep SELINUXTYPE=targeted /etc/selinux/config"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_policy string:xyz" 1
+ rlPhaseEnd
+
+ rlPhaseStartTest "org.selinux.change_default_mode"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_mode" 1
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_mode string:disabled"
+ rlRun "grep SELINUX=disabled /etc/selinux/config"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_mode string:permissive"
+ rlRun "grep SELINUX=permissive /etc/selinux/config"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_mode string:enforcing"
+ rlRun "grep SELINUX=enforcing /etc/selinux/config"
+ rlRun "dbus-send --system --print-reply --dest=org.selinux /org/selinux/object org.selinux.change_default_mode string:xyz" 1
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlFileRestore
+ rlPhaseEnd
+rlJournalPrintText
+rlJournalEnd
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:17 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:17 [tests/selinux] pr775-checkpolicy-revdeps: policycoreutils: Do the D-bus interfaces/methods of /org/selinux/object work? Petr Lautrbach
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox