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 {