Fixing TestSetFilecon in selinux test step

Signed-off-by: rajasec <rajasec79@gmail.com>
This commit is contained in:
rajasec 2015-11-28 13:51:46 +05:30
parent 9f4d5340f4
commit a6614ba40f
1 changed files with 2 additions and 2 deletions

View File

@ -9,10 +9,10 @@ import (
"github.com/opencontainers/runc/libcontainer/selinux"
)
func testSetfilecon(t *testing.T) {
func TestSetfilecon(t *testing.T) {
if selinux.SelinuxEnabled() {
tmp := "selinux_test"
out, _ := os.OpenFile(tmp, os.O_WRONLY, 0)
out, _ := os.OpenFile(tmp, os.O_WRONLY|os.O_CREATE, 0)
out.Close()
err := selinux.Setfilecon(tmp, "system_u:object_r:bin_t:s0")
if err != nil {