mirror of https://github.com/docker/docs.git
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
0e686fa2f4
commit
d47c18c5fb
|
@ -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…
Reference in New Issue