DeviceMapper must be explicitly selected because the Docker binary might not be linked to the right devmapper library. With this change, Docker fails fast if the driver detection finds the devicemapper directory but the driver is not the default option. The option `override_udev_sync_check` doesn't make sense anymore, since the user must be explicit to select devicemapper, so it's being removed. Docker fails to use devicemapper only if Docker has been built statically unless the option was explicit. Signed-off-by: David Calavera <david.calavera@gmail.com> Upstream-commit: 0a376291b2213699f986a7bca1cc8c4f4ed00f8d Component: engine
42 lines
1003 B
Go
42 lines
1003 B
Go
// +build linux
|
|
|
|
package devmapper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/docker/docker/daemon/graphdriver/graphtest"
|
|
)
|
|
|
|
func init() {
|
|
// Reduce the size the the base fs and loopback for the tests
|
|
DefaultDataLoopbackSize = 300 * 1024 * 1024
|
|
DefaultMetaDataLoopbackSize = 200 * 1024 * 1024
|
|
DefaultBaseFsSize = 300 * 1024 * 1024
|
|
if err := graphtest.InitLoopbacks(); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// This avoids creating a new driver for each test if all tests are run
|
|
// Make sure to put new tests between TestDevmapperSetup and TestDevmapperTeardown
|
|
func TestDevmapperSetup(t *testing.T) {
|
|
graphtest.GetDriver(t, "devicemapper")
|
|
}
|
|
|
|
func TestDevmapperCreateEmpty(t *testing.T) {
|
|
graphtest.DriverTestCreateEmpty(t, "devicemapper")
|
|
}
|
|
|
|
func TestDevmapperCreateBase(t *testing.T) {
|
|
graphtest.DriverTestCreateBase(t, "devicemapper")
|
|
}
|
|
|
|
func TestDevmapperCreateSnap(t *testing.T) {
|
|
graphtest.DriverTestCreateSnap(t, "devicemapper")
|
|
}
|
|
|
|
func TestDevmapperTeardown(t *testing.T) {
|
|
graphtest.PutDriver(t)
|
|
}
|