summaryrefslogtreecommitdiff
path: root/integration/image
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2019-09-24 13:33:03 -0500
committerSam Whited <sam@samwhited.com>2019-09-24 14:50:59 -0500
commitae0a878b863511d0455413b137d0f79b56e5d2f4 (patch)
treebbd60ba3b0cd246f6be0d111f2eea7dc7f517d0c /integration/image
parent30c5ec43652065749f8b5d87cfc3af60a619e4b3 (diff)
downloaddocker-ae0a878b863511d0455413b137d0f79b56e5d2f4.tar.gz
testutil, integration: untangle image dependency
Signed-off-by: Sam Whited <sam@samwhited.com>
Diffstat (limited to 'integration/image')
-rw-r--r--integration/image/remove_unix_test.go24
1 files changed, 22 insertions, 2 deletions
diff --git a/integration/image/remove_unix_test.go b/integration/image/remove_unix_test.go
index aad281bc6e..6f16f2d8ee 100644
--- a/integration/image/remove_unix_test.go
+++ b/integration/image/remove_unix_test.go
@@ -7,6 +7,8 @@ import (
"io"
"io/ioutil"
"os"
+ "path/filepath"
+ "runtime"
"strconv"
"strings"
"syscall"
@@ -14,6 +16,10 @@ import (
"unsafe"
"github.com/docker/docker/api/types"
+ _ "github.com/docker/docker/daemon/graphdriver/register" // register graph drivers
+ "github.com/docker/docker/daemon/images"
+ "github.com/docker/docker/layer"
+ "github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/testutil/daemon"
"github.com/docker/docker/testutil/fakecontext"
"gotest.tools/assert"
@@ -31,13 +37,27 @@ func TestRemoveImageGarbageCollector(t *testing.T) {
// Create daemon with overlay2 graphdriver because vfs uses disk differently
// and this test case would not work with it.
- d := daemon.New(t, daemon.WithStorageDriver("overlay2"), daemon.WithImageService)
+ d := daemon.New(t, daemon.WithStorageDriver("overlay2"))
d.Start(t)
defer d.Stop(t)
ctx := context.Background()
client := d.NewClientT(t)
- i := d.ImageService()
+
+ layerStores := make(map[string]layer.Store)
+ layerStores[runtime.GOOS], _ = layer.NewStoreFromOptions(layer.StoreOptions{
+ Root: d.Root,
+ MetadataStorePathTemplate: filepath.Join(d.RootDir(), "image", "%s", "layerdb"),
+ GraphDriver: d.StorageDriver(),
+ GraphDriverOptions: nil,
+ IDMapping: &idtools.IdentityMapping{},
+ PluginGetter: nil,
+ ExperimentalEnabled: false,
+ OS: runtime.GOOS,
+ })
+ i := images.NewImageService(images.ImageServiceConfig{
+ LayerStores: layerStores,
+ })
img := "test-garbage-collector"