mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 15:28:35 +00:00
graphdriver: Add generic test framework for graph drivers
This adds daemon/graphdriver/graphtest/graphtest which has a few generic tests for all graph drivers, and then uses these from the btrs, devicemapper and vfs backends. I've not yet added the aufs backend, because i can't test that here atm. It should work though. Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
This commit is contained in:
@@ -5,6 +5,7 @@ package devmapper
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/dotcloud/docker/daemon/graphdriver"
|
||||
"github.com/dotcloud/docker/daemon/graphdriver/graphtest"
|
||||
"io/ioutil"
|
||||
"path"
|
||||
"runtime"
|
||||
@@ -914,3 +915,25 @@ func assertMap(t *testing.T, m map[string]bool, keys ...string) {
|
||||
t.Fatalf("Unexpected keys: %v", m)
|
||||
}
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user