From 37751ea5b5e71e84119e256136b8bf90aa9ae22f Mon Sep 17 00:00:00 2001 From: Yiqiao Pu Date: Thu, 31 May 2018 21:47:27 +0800 Subject: Use go-selinux for selinux check Use function in opencontainers/selinux/go-selinux to check the selinux status in our test. Signed-off-by: Yiqiao Pu Closes: #837 Approved by: rhatdan --- test/e2e/run_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 5f2bccdac..a581b36fb 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -10,6 +10,7 @@ import ( "github.com/mrunalp/fileutils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/opencontainers/selinux/go-selinux" ) var _ = Describe("Podman run", func() { @@ -51,8 +52,7 @@ var _ = Describe("Podman run", func() { }) It("podman run selinux grep test", func() { - selinux := podmanTest.SystemExec("ls", []string{"/usr/sbin/selinuxenabled"}) - if selinux.ExitCode() != 0 { + if !selinux.GetEnabled() { Skip("SELinux not enabled") } session := podmanTest.Podman([]string{"run", "-it", "--security-opt", "label=level:s0:c1,c2", ALPINE, "cat", "/proc/self/attr/current"}) -- cgit v1.2.3-54-g00ecf