Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile, libimage: test-unit must cover libimage/manifests_test.go #1671

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test: test-unit

.PHONY: test-unit
test-unit: netavark-testplugin
go test --tags $(BUILDTAGS) -v ./libimage
go test --tags $(BUILDTAGS) -v ./libimage/...
go test --tags $(BUILDTAGS) -v ./libnetwork/...
go test --tags $(BUILDTAGS) -v ./pkg/...
go test --tags remote,seccomp,$(BUILDTAGS) -v ./pkg/...
Expand Down
6 changes: 5 additions & 1 deletion libimage/manifests/manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/containers/common/pkg/manifests"
cp "github.com/containers/image/v5/copy"
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/pkg/compression"
"github.com/containers/image/v5/transports/alltransports"
"github.com/containers/image/v5/types"
"github.com/containers/storage"
Expand Down Expand Up @@ -258,7 +259,7 @@ func TestReference(t *testing.T) {
assert.NotNilf(t, listRef, "list.Reference(saved)")
}

func TestPush(t *testing.T) {
func TestPushManifest(t *testing.T) {
if unshare.IsRootless() {
t.Skip("Test can only run as root")
}
Expand Down Expand Up @@ -335,10 +336,13 @@ func TestPush(t *testing.T) {
assert.Nilf(t, err, "list.Push(four specified)")

options.AddCompression = []string{"zstd"}
options.ImageListSelection = cp.CopyAllImages
_, _, err = list.Push(ctx, destRef, options)
assert.NoError(t, err, "list.Push(with replication for zstd specified)")

options.ForceCompressionFormat = true
options.ImageListSelection = cp.CopyAllImages
options.SystemContext.CompressionFormat = &compression.Gzip
_, _, err = list.Push(ctx, destRef, options)
assert.NoError(t, err, "list.Push(with ForceCompressionFormat: true)")
}