mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
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 <ypu@redhat.com> Closes: #837 Approved by: rhatdan
This commit is contained in:
@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/mrunalp/fileutils"
|
"github.com/mrunalp/fileutils"
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
"github.com/opencontainers/selinux/go-selinux"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Podman run", func() {
|
var _ = Describe("Podman run", func() {
|
||||||
@ -51,8 +52,7 @@ var _ = Describe("Podman run", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run selinux grep test", func() {
|
It("podman run selinux grep test", func() {
|
||||||
selinux := podmanTest.SystemExec("ls", []string{"/usr/sbin/selinuxenabled"})
|
if !selinux.GetEnabled() {
|
||||||
if selinux.ExitCode() != 0 {
|
|
||||||
Skip("SELinux not enabled")
|
Skip("SELinux not enabled")
|
||||||
}
|
}
|
||||||
session := podmanTest.Podman([]string{"run", "-it", "--security-opt", "label=level:s0:c1,c2", ALPINE, "cat", "/proc/self/attr/current"})
|
session := podmanTest.Podman([]string{"run", "-it", "--security-opt", "label=level:s0:c1,c2", ALPINE, "cat", "/proc/self/attr/current"})
|
||||||
|
Reference in New Issue
Block a user