Skip to content

Commit

Permalink
Merge pull request #2677 from ktock/zstdtest
Browse files Browse the repository at this point in the history
test: Ensure testPullZstdImage pulls zstd image
  • Loading branch information
tonistiigi authored Feb 25, 2022
2 parents b9657e3 + 35f6585 commit 6fe5f72
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2654,12 +2654,24 @@ func testPullZstdImage(t *testing.T, sb integration.Sandbox) {
"name": target,
"push": "true",
"compression": "zstd",

// containerd applier supports only zstd with oci-mediatype.
"oci-mediatypes": "true",
},
},
},
}, nil)
require.NoError(t, err)

if sb.Name() == "containerd-1.4" {
// containerd 1.4 doesn't support zstd compression
return
}
err = c.Prune(sb.Context(), nil, PruneAll)
require.NoError(t, err)

checkAllRemoved(t, c, sb)

st = llb.Scratch().File(llb.Copy(llb.Image(target), "/data", "/zdata"))

def, err = st.Marshal(sb.Context())
Expand Down
1 change: 1 addition & 0 deletions util/testutil/integration/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type Sandbox interface {
PrintLogs(*testing.T)
NewRegistry() (string, error)
Value(string) interface{} // chosen matrix value
Name() string
}

// BackendConfig is used to configure backends created by a worker.
Expand Down
6 changes: 6 additions & 0 deletions util/testutil/integration/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ type sandbox struct {
cleanup *multiCloser
mv matrixValue
ctx context.Context
name string
}

func (sb *sandbox) Name() string {
return sb.name
}

func (sb *sandbox) Context() context.Context {
Expand Down Expand Up @@ -135,6 +140,7 @@ func newSandbox(ctx context.Context, w Worker, mirror string, mv matrixValue) (s
cleanup: deferF,
mv: mv,
ctx: ctx,
name: w.Name(),
}, cl, nil
}

Expand Down

0 comments on commit 6fe5f72

Please sign in to comment.