From ce68f7aef70964304657a0473e5aaf8e4a58a456 Mon Sep 17 00:00:00 2001 From: rajasec Date: Tue, 24 Nov 2015 23:24:30 +0530 Subject: [PATCH] make localtest failure with selinux enabled Signed-off-by: rajasec --- libcontainer/label/label_selinux_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcontainer/label/label_selinux_test.go b/libcontainer/label/label_selinux_test.go index 43328a3a..c2a19f5b 100644 --- a/libcontainer/label/label_selinux_test.go +++ b/libcontainer/label/label_selinux_test.go @@ -3,6 +3,7 @@ package label import ( + "os" "strings" "testing" @@ -89,6 +90,10 @@ func TestDuplicateLabel(t *testing.T) { } func TestRelabel(t *testing.T) { testdir := "/tmp/test" + if err := os.Mkdir(testdir, 0755); err != nil { + t.Fatal(err) + } + defer os.RemoveAll(testdir) label := "system_u:system_r:svirt_sandbox_file_t:s0:c1,c2" if err := Relabel(testdir, "", true); err != nil { t.Fatal("Relabel with no label failed: %v", err)