2014-08-02 15:46:15 +08:00
|
|
|
// +build linux
|
2013-11-28 11:12:51 +08:00
|
|
|
|
2013-11-14 07:35:52 +08:00
|
|
|
package devmapper
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
2014-09-25 22:57:37 +08:00
|
|
|
|
|
|
|
|
"github.com/docker/docker/daemon/graphdriver/graphtest"
|
2013-11-14 07:35:52 +08:00
|
|
|
)
|
|
|
|
|
|
2014-05-16 18:46:28 +08:00
|
|
|
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
|
2014-11-14 11:33:41 +08:00
|
|
|
if err := graphtest.InitLoopbacks(); err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
2013-11-14 07:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
2014-05-16 18:46:28 +08:00
|
|
|
// 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")
|
2013-11-14 07:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
2014-05-16 18:46:28 +08:00
|
|
|
func TestDevmapperCreateEmpty(t *testing.T) {
|
|
|
|
|
graphtest.DriverTestCreateEmpty(t, "devicemapper")
|
2013-11-14 07:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
2014-05-16 18:46:28 +08:00
|
|
|
func TestDevmapperCreateBase(t *testing.T) {
|
|
|
|
|
graphtest.DriverTestCreateBase(t, "devicemapper")
|
2013-11-14 07:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
2014-05-16 18:46:28 +08:00
|
|
|
func TestDevmapperCreateSnap(t *testing.T) {
|
|
|
|
|
graphtest.DriverTestCreateSnap(t, "devicemapper")
|
2013-11-14 07:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
2014-05-16 18:46:28 +08:00
|
|
|
func TestDevmapperTeardown(t *testing.T) {
|
|
|
|
|
graphtest.PutDriver(t)
|
2013-11-14 07:35:52 +08:00
|
|
|
}
|