Skip to content

Commit f03b7f8

Browse files
author
Mrunal Patel
committed
Merge pull request #419 from rajasec/selinux-teststepfix
make localtest failure with selinux enabled
2 parents 4fda64b + ce68f7a commit f03b7f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libcontainer/label/label_selinux_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package label
44

55
import (
6+
"os"
67
"strings"
78
"testing"
89

@@ -89,6 +90,10 @@ func TestDuplicateLabel(t *testing.T) {
8990
}
9091
func TestRelabel(t *testing.T) {
9192
testdir := "/tmp/test"
93+
if err := os.Mkdir(testdir, 0755); err != nil {
94+
t.Fatal(err)
95+
}
96+
defer os.RemoveAll(testdir)
9297
label := "system_u:system_r:svirt_sandbox_file_t:s0:c1,c2"
9398
if err := Relabel(testdir, "", true); err != nil {
9499
t.Fatal("Relabel with no label failed: %v", err)

0 commit comments

Comments
 (0)