Skip to content

Commit

Permalink
merge branch 'pr-1661'
Browse files Browse the repository at this point in the history
  Ensure container tests do not write on the host

LGTMs: @hqhq @cyphar
Closes #1661
  • Loading branch information
cyphar committed Nov 27, 2017
2 parents fb871d9 + 0495fec commit e8149af
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libcontainer/container_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package libcontainer

import (
"fmt"
"io/ioutil"
"os"
"testing"

Expand Down Expand Up @@ -281,8 +282,16 @@ func TestGetContainerStateAfterUpdate(t *testing.T) {
if err != nil {
t.Fatal(err)
}

rootDir, err := ioutil.TempDir("", "TestGetContainerStateAfterUpdate")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(rootDir)

container := &linuxContainer{
id: "myid",
root: rootDir,
id: "myid",
config: &configs.Config{
Namespaces: []configs.Namespace{
{Type: configs.NEWPID},
Expand Down

0 comments on commit e8149af

Please sign in to comment.