github.com/afein/docker@v1.8.2/daemon/graphdriver/devmapper/devmapper_test.go (about)

     1  // +build linux
     2  
     3  package devmapper
     4  
     5  import (
     6  	"testing"
     7  
     8  	"github.com/docker/docker/daemon/graphdriver/graphtest"
     9  )
    10  
    11  func init() {
    12  	// Reduce the size the the base fs and loopback for the tests
    13  	DefaultDataLoopbackSize = 300 * 1024 * 1024
    14  	DefaultMetaDataLoopbackSize = 200 * 1024 * 1024
    15  	DefaultBaseFsSize = 300 * 1024 * 1024
    16  	DefaultUdevSyncOverride = true
    17  	if err := graphtest.InitLoopbacks(); err != nil {
    18  		panic(err)
    19  	}
    20  }
    21  
    22  // This avoids creating a new driver for each test if all tests are run
    23  // Make sure to put new tests between TestDevmapperSetup and TestDevmapperTeardown
    24  func TestDevmapperSetup(t *testing.T) {
    25  	graphtest.GetDriver(t, "devicemapper")
    26  }
    27  
    28  func TestDevmapperCreateEmpty(t *testing.T) {
    29  	graphtest.DriverTestCreateEmpty(t, "devicemapper")
    30  }
    31  
    32  func TestDevmapperCreateBase(t *testing.T) {
    33  	graphtest.DriverTestCreateBase(t, "devicemapper")
    34  }
    35  
    36  func TestDevmapperCreateSnap(t *testing.T) {
    37  	graphtest.DriverTestCreateSnap(t, "devicemapper")
    38  }
    39  
    40  func TestDevmapperTeardown(t *testing.T) {
    41  	graphtest.PutDriver(t)
    42  }