1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Reuse a single DeviceSetDM for all the tests

We wrap the "real" DeviceSet for each test so that we get only
a single device-mapper pool and loopback mounts, but still
separate out the IDs in the tests. This makes the test run
much faster.
This commit is contained in:
Alexander Larsson 2013-09-06 14:38:47 +02:00 committed by Tianon Gravi
parent 381ce94ef4
commit 52294192b2
2 changed files with 3 additions and 3 deletions

View file

@ -457,7 +457,7 @@ func TestRestore(t *testing.T) {
// Here are are simulating a docker restart - that is, reloading all containers
// from scratch
runtime2, err := NewRuntimeFromDirectory(runtime1.root, devmapper.NewDeviceSetDM(runtime1.root), false)
runtime2, err := NewRuntimeFromDirectory(runtime1.root, runtime1.deviceSet, false)
if err != nil {
t.Fatal(err)
}

View file

@ -2,7 +2,7 @@ package docker
import (
"github.com/dotcloud/docker/utils"
"github.com/dotcloud/docker/devmapper"
"path/filepath"
"io"
"io/ioutil"
"os"
@ -43,7 +43,7 @@ func newTestRuntime() (*Runtime, error) {
return nil, err
}
runtime, err := NewRuntimeFromDirectory(root, devmapper.NewDeviceSetDM(root), false)
runtime, err := NewRuntimeFromDirectory(root, NewDeviceSetWrapper (globalRuntime.deviceSet, filepath.Base(root)), false)
if err != nil {
return nil, err
}