소스 검색

grapdriver: Skip tests on non-supported backends

For now this means the btrfs backend is skipped when run
inside make test. You can however run it manually if you want.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Alexander Larsson 11 년 전
부모
커밋
55cd7dd7f9
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      daemon/graphdriver/graphtest/graphtest.go

+ 4 - 1
daemon/graphdriver/graphtest/graphtest.go

@@ -31,6 +31,9 @@ func newDriver(t *testing.T, name string) *Driver {
 
 	d, err := graphdriver.GetDriver(name, root)
 	if err != nil {
+		if err == graphdriver.ErrNotSupported {
+			t.Skip("Driver %s not supported", name)
+		}
 		t.Fatal(err)
 	}
 	return &Driver{d, root, 1}
@@ -54,7 +57,7 @@ func GetDriver(t *testing.T, name string) graphdriver.Driver {
 
 func PutDriver(t *testing.T) {
 	if drv == nil {
-		t.Fatal("No driver to put!")
+		t.Skip("No driver to put!")
 	}
 	drv.refCount--
 	if drv.refCount == 0 {