StorageDriver: Test case for #1698

Signed-off-by: Arthur Baars <arthur@semmle.com>
This commit is contained in:
Arthur Baars
2016-05-06 10:46:37 +01:00
parent 4ecea4b311
commit 1d782c38f2
4 changed files with 92 additions and 19 deletions

View File

@@ -16,7 +16,7 @@ import (
_ "github.com/docker/distribution/registry/auth/silly"
"github.com/docker/distribution/registry/storage"
memorycache "github.com/docker/distribution/registry/storage/cache/memory"
"github.com/docker/distribution/registry/storage/driver/inmemory"
"github.com/docker/distribution/registry/storage/driver/testdriver"
)
// TestAppDispatcher builds an application with a test dispatcher and ensures
@@ -24,7 +24,7 @@ import (
// This only tests the dispatch mechanism. The underlying dispatchers must be
// tested individually.
func TestAppDispatcher(t *testing.T) {
driver := inmemory.New()
driver := testdriver.New()
ctx := context.Background()
registry, err := storage.NewRegistry(ctx, driver, storage.BlobDescriptorCacheProvider(memorycache.NewInMemoryBlobDescriptorCacheProvider()), storage.EnableDelete, storage.EnableRedirect)
if err != nil {
@@ -142,7 +142,7 @@ func TestNewApp(t *testing.T) {
ctx := context.Background()
config := configuration.Configuration{
Storage: configuration.Storage{
"inmemory": nil,
"testdriver": nil,
},
Auth: configuration.Auth{
// For now, we simply test that new auth results in a viable