Skip to content

Commit e8149af

Browse files
committed
merge branch 'pr-1661'
Ensure container tests do not write on the host LGTMs: @hqhq @cyphar Closes #1661
2 parents fb871d9 + 0495fec commit e8149af

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libcontainer/container_linux_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package libcontainer
44

55
import (
66
"fmt"
7+
"io/ioutil"
78
"os"
89
"testing"
910

@@ -281,8 +282,16 @@ func TestGetContainerStateAfterUpdate(t *testing.T) {
281282
if err != nil {
282283
t.Fatal(err)
283284
}
285+
286+
rootDir, err := ioutil.TempDir("", "TestGetContainerStateAfterUpdate")
287+
if err != nil {
288+
t.Fatal(err)
289+
}
290+
defer os.RemoveAll(rootDir)
291+
284292
container := &linuxContainer{
285-
id: "myid",
293+
root: rootDir,
294+
id: "myid",
286295
config: &configs.Config{
287296
Namespaces: []configs.Namespace{
288297
{Type: configs.NEWPID},

0 commit comments

Comments
 (0)