From a6614ba40ff76e11504334c2257546a94ff65264 Mon Sep 17 00:00:00 2001 From: rajasec Date: Sat, 28 Nov 2015 13:51:46 +0530 Subject: [PATCH] Fixing TestSetFilecon in selinux test step Signed-off-by: rajasec --- libcontainer/selinux/selinux_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/selinux/selinux_test.go b/libcontainer/selinux/selinux_test.go index cd61d43c..a4143079 100644 --- a/libcontainer/selinux/selinux_test.go +++ b/libcontainer/selinux/selinux_test.go @@ -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 {