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:
parent
381ce94ef4
commit
52294192b2
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue