fix unit tests for idmapping support

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
docker-19.03
Tonis Tiigi 2019-04-02 19:47:58 -07:00
parent 5e3ba9c2f8
commit 894da35fed
6 changed files with 21 additions and 21 deletions

View File

@ -49,7 +49,7 @@ func TestChecksumHardlinks(t *testing.T) {
ref := createRef(t, cm, ch)
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
dgst, err := cc.Checksum(context.TODO(), ref, "abc/foo", false)
@ -67,7 +67,7 @@ func TestChecksumHardlinks(t *testing.T) {
// validate same results with handleChange
ref2 := createRef(t, cm, nil)
cc2, err := newCacheContext(ref2.Metadata())
cc2, err := newCacheContext(ref2.Metadata(), nil)
require.NoError(t, err)
err = emit(cc2.HandleChange, changeStream(ch))
@ -138,7 +138,7 @@ func TestChecksumWildcard(t *testing.T) {
ref := createRef(t, cm, ch)
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
dgst, err := cc.ChecksumWildcard(context.TODO(), ref, "f*o", false)
@ -189,7 +189,7 @@ func TestSymlinksNoFollow(t *testing.T) {
ref := createRef(t, cm, ch)
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
expectedSym := digest.Digest("sha256:a2ba571981f48ec34eb79c9a3ab091b6491e825c2f7e9914ea86e8e958be7fae")
@ -251,7 +251,7 @@ func TestChecksumBasicFile(t *testing.T) {
// for the digest values, the actual values are not important in development
// phase but consistency is
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
_, err = cc.Checksum(context.TODO(), ref, "nosuch", true)
@ -312,7 +312,7 @@ func TestChecksumBasicFile(t *testing.T) {
ref = createRef(t, cm, ch)
cc, err = newCacheContext(ref.Metadata())
cc, err = newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
dgst, err = cc.Checksum(context.TODO(), ref, "/", true)
@ -331,7 +331,7 @@ func TestChecksumBasicFile(t *testing.T) {
ref = createRef(t, cm, ch)
cc, err = newCacheContext(ref.Metadata())
cc, err = newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
dgst, err = cc.Checksum(context.TODO(), ref, "/", true)
@ -357,7 +357,7 @@ func TestChecksumBasicFile(t *testing.T) {
ref = createRef(t, cm, ch)
cc, err = newCacheContext(ref.Metadata())
cc, err = newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
dgst, err = cc.Checksum(context.TODO(), ref, "abc/aa/foo", true)
@ -401,7 +401,7 @@ func TestHandleChange(t *testing.T) {
// for the digest values, the actual values are not important in development
// phase but consistency is
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
err = emit(cc.HandleChange, changeStream(ch))
@ -477,7 +477,7 @@ func TestHandleRecursiveDir(t *testing.T) {
ref := createRef(t, cm, nil)
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
err = emit(cc.HandleChange, changeStream(ch))
@ -524,7 +524,7 @@ func TestChecksumUnorderedFiles(t *testing.T) {
ref := createRef(t, cm, nil)
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
err = emit(cc.HandleChange, changeStream(ch))
@ -544,7 +544,7 @@ func TestChecksumUnorderedFiles(t *testing.T) {
ref = createRef(t, cm, nil)
cc, err = newCacheContext(ref.Metadata())
cc, err = newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
err = emit(cc.HandleChange, changeStream(ch))
@ -731,7 +731,7 @@ func TestSymlinkInPathHandleChange(t *testing.T) {
ref := createRef(t, cm, nil)
cc, err := newCacheContext(ref.Metadata())
cc, err := newCacheContext(ref.Metadata(), nil)
require.NoError(t, err)
err = emit(cc.HandleChange, changeStream(ch))
@ -848,7 +848,7 @@ func setupCacheManager(t *testing.T, tmpdir string, snapshotter snapshots.Snapsh
require.NoError(t, err)
cm, err := cache.NewManager(cache.ManagerOpt{
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter),
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter, nil),
MetadataStore: md,
})
require.NoError(t, err)

View File

@ -374,7 +374,7 @@ func getCacheManager(t *testing.T, tmpdir string, snapshotter snapshots.Snapshot
require.NoError(t, err)
cm, err := NewManager(ManagerOpt{
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter),
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter, nil),
MetadataStore: md,
})
require.NoError(t, err, fmt.Sprintf("error: %+v", err))

View File

@ -297,7 +297,7 @@ func setupGitSource(t *testing.T, tmpdir string) source.Source {
assert.NoError(t, err)
cm, err := cache.NewManager(cache.ManagerOpt{
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter),
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter, nil),
MetadataStore: md,
})
assert.NoError(t, err)

View File

@ -315,7 +315,7 @@ func newHTTPSource(tmpdir string) (source.Source, error) {
}
cm, err := cache.NewManager(cache.ManagerOpt{
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter),
Snapshotter: snapshot.FromContainerdSnapshotter(snapshotter, nil),
MetadataStore: md,
})
if err != nil {

6
vendor/modules.txt vendored
View File

@ -94,9 +94,9 @@ github.com/containerd/continuity/fs
github.com/containerd/continuity/syscallx
github.com/containerd/continuity
github.com/containerd/continuity/fs/fstest
github.com/containerd/continuity/pathdriver
github.com/containerd/continuity/devices
github.com/containerd/continuity/driver
github.com/containerd/continuity/pathdriver
github.com/containerd/continuity/proto
# github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260
github.com/containerd/fifo
@ -116,6 +116,7 @@ github.com/docker/cli/cli/config/types
github.com/docker/distribution/reference
github.com/docker/distribution/digestset
# github.com/docker/docker v1.14.0-0.20190319215453-e7b5f7dbe98c
github.com/docker/docker/pkg/idtools
github.com/docker/docker/pkg/locker
github.com/docker/docker/pkg/reexec
github.com/docker/docker/builder/dockerignore
@ -124,15 +125,14 @@ github.com/docker/docker/pkg/signal
github.com/docker/docker/api/types/container
github.com/docker/docker/pkg/archive
github.com/docker/docker/pkg/chrootarchive
github.com/docker/docker/pkg/system
github.com/docker/docker/pkg/fileutils
github.com/docker/docker/pkg/ioutils
github.com/docker/docker/api/types/blkiodev
github.com/docker/docker/api/types/mount
github.com/docker/docker/pkg/homedir
github.com/docker/docker/pkg/idtools
github.com/docker/docker/pkg/longpath
github.com/docker/docker/pkg/pools
github.com/docker/docker/pkg/system
github.com/docker/docker/pkg/mount
# github.com/docker/docker-credential-helpers v0.6.0
github.com/docker/docker-credential-helpers/client

View File

@ -39,7 +39,7 @@ func newWorkerOpt(t *testing.T, processMode oci.ProcessMode) (base.WorkerOpt, fu
},
}
rootless := false
workerOpt, err := NewWorkerOpt(tmpdir, snFactory, rootless, processMode, nil)
workerOpt, err := NewWorkerOpt(tmpdir, snFactory, rootless, processMode, nil, nil)
require.NoError(t, err)
return workerOpt, cleanup