Skip to content

Commit 749928a

Browse files
author
Mrunal Patel
committed
Merge pull request #421 from rajasec/selinux-compileflag
Adding selinux label
2 parents f03b7f8 + a6614ba commit 749928a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libcontainer/selinux/selinux_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build linux
1+
// +build linux,selinux
22

33
package selinux_test
44

@@ -9,10 +9,10 @@ import (
99
"github.com/opencontainers/runc/libcontainer/selinux"
1010
)
1111

12-
func testSetfilecon(t *testing.T) {
12+
func TestSetfilecon(t *testing.T) {
1313
if selinux.SelinuxEnabled() {
1414
tmp := "selinux_test"
15-
out, _ := os.OpenFile(tmp, os.O_WRONLY, 0)
15+
out, _ := os.OpenFile(tmp, os.O_WRONLY|os.O_CREATE, 0)
1616
out.Close()
1717
err := selinux.Setfilecon(tmp, "system_u:object_r:bin_t:s0")
1818
if err != nil {

0 commit comments

Comments
 (0)