selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selinux-testsuite: don't break the system after running the cgroups_label tests
@ 2019-09-04 22:03 Paul Moore
  2019-09-05 12:24 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Moore @ 2019-09-04 22:03 UTC (permalink / raw)
  To: selinux

From: Paul Moore <paul@paul-moore.com>

Commit be0ca8feeb9b ("selinux-testsuite: ensure the cgroups_label
tests works on old and new systems"), and perhaps an earlier related
commit, broke systems after the tests were run by operating on
/sys/fs/cgroup/unified directly and not a sub-directory.  Fix this
by restoring the old (sub-directory) behavior.

Reported-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 0 files changed

diff --git a/tests/cgroupfs_label/test b/tests/cgroupfs_label/test
index 13f0434..3accca0 100755
--- a/tests/cgroupfs_label/test
+++ b/tests/cgroupfs_label/test
@@ -6,8 +6,11 @@ BEGIN { plan tests => 2 }
 my $ret;
 
 # Older systems use /sys/fs/cgroup/unified, newer use /sys/fs/cgroup.
-my $dir = "/sys/fs/cgroup/unified";
-if ( !-d $dir ) {
+my $dir;
+if ( -d "/sys/fs/cgroup/unified" ) {
+    $dir = "/sys/fs/cgroup/unified/selinuxtest";
+}
+else {
     $dir = "/sys/fs/cgroup/selinuxtest";
 }
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-05 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 22:03 [PATCH] selinux-testsuite: don't break the system after running the cgroups_label tests Paul Moore
2019-09-05 12:24 ` Stephen Smalley
2019-09-05 20:23   ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).