diff --git a/cgroups/fs/devices_test.go b/cgroups/fs/devices_test.go index d87d0924..18bb1274 100644 --- a/cgroups/fs/devices_test.go +++ b/cgroups/fs/devices_test.go @@ -25,7 +25,7 @@ func TestDevicesSetAllow(t *testing.T) { defer helper.cleanup() helper.writeFileContents(map[string]string{ - "device.deny": "a", + "devices.deny": "a", }) helper.CgroupData.c.AllowAllDevices = false @@ -35,8 +35,6 @@ func TestDevicesSetAllow(t *testing.T) { t.Fatal(err) } - // FIXME: this doesn't make sence, the file devices.allow under real cgroupfs - // is not allowed to read. Our test path don't have cgroupfs mounted. value, err := getCgroupParamString(helper.CgroupPath, "devices.allow") if err != nil { t.Fatalf("Failed to parse devices.allow - %s", err) diff --git a/cgroups/fs/util_test.go b/cgroups/fs/util_test.go index e0c1262d..37bf5157 100644 --- a/cgroups/fs/util_test.go +++ b/cgroups/fs/util_test.go @@ -6,9 +6,9 @@ Creates a mock of the cgroup filesystem for the duration of the test. package fs import ( - "fmt" "io/ioutil" "os" + "path/filepath" "testing" "github.com/docker/libcontainer/configs" @@ -31,12 +31,12 @@ func NewCgroupTestUtil(subsystem string, t *testing.T) *cgroupTestUtil { d := &data{ c: &configs.Cgroup{}, } - tempDir, err := ioutil.TempDir("", fmt.Sprintf("%s_cgroup_test", subsystem)) + tempDir, err := ioutil.TempDir("", "cgroup_test") if err != nil { t.Fatal(err) } d.root = tempDir - testCgroupPath, err := d.path(subsystem) + testCgroupPath := filepath.Join(d.root, subsystem) if err != nil { t.Fatal(err) }