mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
feat(test): added image builder for use in tests (#1583)
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
+30
-37
@@ -1503,13 +1503,13 @@ func runDisplayIndexTests(baseURL string) {
|
||||
actual := strings.TrimSpace(str)
|
||||
// Actual cli output should be something similar to (order of images may differ):
|
||||
// REPOSITORY TAG OS/ARCH DIGEST SIGNED SIZE
|
||||
// repo multi-arch * 0f844b3e false 1.5kB
|
||||
// linux/amd64 2ab1a275 false 634B
|
||||
// windows/arm64/v6 55fdd23a false 444B
|
||||
// repo multi-arch * 28665f71 false 1.5kB
|
||||
// linux/amd64 02e0ac42 false 644B
|
||||
// windows/arm64/v6 5e09b7f9 false 444B
|
||||
So(actual, ShouldContainSubstring, "REPOSITORY TAG OS/ARCH DIGEST SIGNED SIZE")
|
||||
So(actual, ShouldContainSubstring, "repo multi-arch * 0f844b3e false 1.5kB ")
|
||||
So(actual, ShouldContainSubstring, "linux/amd64 2ab1a275 false 634B ")
|
||||
So(actual, ShouldContainSubstring, "windows/arm64/v6 55fdd23a false 501B")
|
||||
So(actual, ShouldContainSubstring, "repo multi-arch * 28665f71 false 1.5kB ")
|
||||
So(actual, ShouldContainSubstring, "linux/amd64 02e0ac42 false 644B ")
|
||||
So(actual, ShouldContainSubstring, "windows/arm64/v6 5e09b7f9 false 506B")
|
||||
})
|
||||
|
||||
Convey("Test Image Index Verbose", func() {
|
||||
@@ -1531,18 +1531,18 @@ func runDisplayIndexTests(baseURL string) {
|
||||
actual := strings.TrimSpace(str)
|
||||
// Actual cli output should be something similar to (order of images may differ):
|
||||
// REPOSITORY TAG OS/ARCH DIGEST CONFIG SIGNED LAYERS SIZE
|
||||
// repo multi-arch * 0f844b3e false 1.5kB
|
||||
// linux/amd64 2ab1a275 58cc9abe false 634B
|
||||
// repo multi-arch * 28665f71 false 1.5kB
|
||||
// linux/amd64 02e0ac42 58cc9abe false 644B
|
||||
// cbb5b121 4B
|
||||
// a00291e8 4B
|
||||
// windows/arm64/v6 55fdd23a 5132a1cd false 501B
|
||||
// windows/arm64/v6 5e09b7f9 5132a1cd false 506B
|
||||
// 7d08ce29 4B
|
||||
So(actual, ShouldContainSubstring, "REPOSITORY TAG OS/ARCH DIGEST CONFIG SIGNED LAYERS SIZE")
|
||||
So(actual, ShouldContainSubstring, "repo multi-arch * 0f844b3e false 1.5kB")
|
||||
So(actual, ShouldContainSubstring, "linux/amd64 2ab1a275 58cc9abe false 634B")
|
||||
So(actual, ShouldContainSubstring, "repo multi-arch * 28665f71 false 1.5kB")
|
||||
So(actual, ShouldContainSubstring, "linux/amd64 02e0ac42 58cc9abe false 644B")
|
||||
So(actual, ShouldContainSubstring, "cbb5b121 4B")
|
||||
So(actual, ShouldContainSubstring, "a00291e8 4B")
|
||||
So(actual, ShouldContainSubstring, "windows/arm64/v6 55fdd23a 5132a1cd false 501B")
|
||||
So(actual, ShouldContainSubstring, "windows/arm64/v6 5e09b7f9 5132a1cd false 506B")
|
||||
So(actual, ShouldContainSubstring, "7d08ce29 4B")
|
||||
})
|
||||
}
|
||||
@@ -1552,42 +1552,35 @@ func uploadTestMultiarch(baseURL string) {
|
||||
layer11 := []byte{11, 12, 13, 14}
|
||||
layer12 := []byte{16, 17, 18, 19}
|
||||
|
||||
image1, err := test.GetImageWithComponents(
|
||||
ispec.Image{
|
||||
Platform: ispec.Platform{
|
||||
OS: "linux",
|
||||
Architecture: "amd64",
|
||||
},
|
||||
},
|
||||
[][]byte{
|
||||
image1 := test.CreateImageWith().
|
||||
LayerBlobs([][]byte{
|
||||
layer11,
|
||||
layer12,
|
||||
},
|
||||
)
|
||||
So(err, ShouldBeNil)
|
||||
}).
|
||||
ImageConfig(
|
||||
ispec.Image{
|
||||
Platform: ispec.Platform{OS: "linux", Architecture: "amd64"},
|
||||
},
|
||||
).Build()
|
||||
|
||||
// ------ Define Image2
|
||||
layer21 := []byte{21, 22, 23, 24}
|
||||
|
||||
image2, err := test.GetImageWithComponents(
|
||||
ispec.Image{
|
||||
Platform: ispec.Platform{
|
||||
OS: "windows",
|
||||
Architecture: "arm64",
|
||||
Variant: "v6",
|
||||
},
|
||||
},
|
||||
[][]byte{
|
||||
image2 := test.CreateImageWith().
|
||||
LayerBlobs([][]byte{
|
||||
layer21,
|
||||
},
|
||||
)
|
||||
So(err, ShouldBeNil)
|
||||
}).
|
||||
ImageConfig(
|
||||
ispec.Image{
|
||||
Platform: ispec.Platform{OS: "windows", Architecture: "arm64", Variant: "v6"},
|
||||
},
|
||||
).Build()
|
||||
|
||||
// ------- Upload The multiarch image
|
||||
|
||||
multiarch := test.GetMultiarchImageForImages("multi-arch", []test.Image{image1, image2})
|
||||
multiarch := test.GetMultiarchImageForImages([]test.Image{image1, image2})
|
||||
|
||||
err = test.UploadMultiarchImage(multiarch, baseURL, "repo")
|
||||
err := test.UploadMultiarchImageWithRef(multiarch, baseURL, "repo", "multi-arch")
|
||||
So(err, ShouldBeNil)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
ispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
|
||||
"zotregistry.io/zot/pkg/api"
|
||||
@@ -205,36 +204,26 @@ func TestReferrerCLI(t *testing.T) {
|
||||
defer cm.StopServer()
|
||||
|
||||
repo := repoName
|
||||
image, err := test.GetRandomImage("tag")
|
||||
So(err, ShouldBeNil)
|
||||
imgDigest, err := image.Digest()
|
||||
image := test.CreateRandomImage()
|
||||
|
||||
err := test.UploadImageWithRef(image, baseURL, repo, "tag")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
err = test.UploadImage(image, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
ref1 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
RandomConfig().
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
// add referrers
|
||||
ref1, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref1.Reference = ""
|
||||
ref2 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
ArtifactConfig(customArtTypeV1).
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
ref1Digest, err := ref1.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ref2, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref2.Reference = ""
|
||||
ref2.Manifest.Config.MediaType = customArtTypeV1
|
||||
ref2Digest, err := ref2.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ref3, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref3.Manifest.ArtifactType = customArtTypeV2
|
||||
ref3.Manifest.Config = ispec.DescriptorEmptyJSON
|
||||
ref3.Reference = ""
|
||||
ref3Digest, err := ref3.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
ref3 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
RandomConfig().
|
||||
ArtifactType(customArtTypeV2).
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
err = test.UploadImage(ref1, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
@@ -245,7 +234,7 @@ func TestReferrerCLI(t *testing.T) {
|
||||
err = test.UploadImage(ref3, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
args := []string{"reftest", "--subject", repo + "@" + imgDigest.String()}
|
||||
args := []string{"reftest", "--subject", repo + "@" + image.DigestStr()}
|
||||
|
||||
configPath := makeConfigFile(fmt.Sprintf(`{"configs":[{"_name":"reftest","url":"%s","showspinner":false}]}`,
|
||||
baseURL))
|
||||
@@ -262,9 +251,9 @@ func TestReferrerCLI(t *testing.T) {
|
||||
space := regexp.MustCompile(`\s+`)
|
||||
str := strings.TrimSpace(space.ReplaceAllString(buff.String(), " "))
|
||||
So(str, ShouldContainSubstring, "ARTIFACT TYPE SIZE DIGEST")
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 557 B "+ref1Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v1 547 B "+ref2Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v2 610 B "+ref3Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 563 B "+ref1.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v1 551 B "+ref2.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v2 611 B "+ref3.DigestStr())
|
||||
|
||||
fmt.Println(buff.String())
|
||||
|
||||
@@ -286,9 +275,9 @@ func TestReferrerCLI(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
str = strings.TrimSpace(space.ReplaceAllString(buff.String(), " "))
|
||||
So(str, ShouldContainSubstring, "ARTIFACT TYPE SIZE DIGEST")
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 557 B "+ref1Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v1 547 B "+ref2Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v2 610 B "+ref3Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 563 B "+ref1.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v1 551 B "+ref2.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v2 611 B "+ref3.DigestStr())
|
||||
|
||||
fmt.Println(buff.String())
|
||||
})
|
||||
@@ -312,48 +301,38 @@ func TestReferrerCLI(t *testing.T) {
|
||||
defer cm.StopServer()
|
||||
|
||||
repo := repoName
|
||||
image, err := test.GetRandomImage("tag")
|
||||
So(err, ShouldBeNil)
|
||||
imgDigest, err := image.Digest()
|
||||
image := test.CreateRandomImage()
|
||||
|
||||
err := test.UploadImageWithRef(image, baseURL, repo, "tag")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
err = test.UploadImage(image, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
ref1 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
RandomConfig().
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
// add referrers
|
||||
ref1, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref1Digest, err := ref1.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
ref2 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
ArtifactConfig(customArtTypeV1).
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
ref2, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref2.Manifest.Config.MediaType = customArtTypeV1
|
||||
ref2Digest, err := ref2.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
ref3 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
RandomConfig().
|
||||
ArtifactType(customArtTypeV2).
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
ref3, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref3.Manifest.ArtifactType = customArtTypeV2
|
||||
ref3.Manifest.Config = ispec.DescriptorEmptyJSON
|
||||
|
||||
ref3Digest, err := ref3.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ref1.Reference = ""
|
||||
err = test.UploadImage(ref1, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ref2.Reference = ""
|
||||
err = test.UploadImage(ref2, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ref3.Reference = ""
|
||||
err = test.UploadImage(ref3, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
// get referrers by digest
|
||||
args := []string{"reftest", "--subject", repo + "@" + imgDigest.String()}
|
||||
args := []string{"reftest", "--subject", repo + "@" + image.DigestStr()}
|
||||
|
||||
configPath := makeConfigFile(fmt.Sprintf(`{"configs":[{"_name":"reftest","url":"%s","showspinner":false}]}`,
|
||||
baseURL))
|
||||
@@ -369,9 +348,9 @@ func TestReferrerCLI(t *testing.T) {
|
||||
space := regexp.MustCompile(`\s+`)
|
||||
str := strings.TrimSpace(space.ReplaceAllString(buff.String(), " "))
|
||||
So(str, ShouldContainSubstring, "ARTIFACT TYPE SIZE DIGEST")
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 557 B "+ref1Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v1 547 B "+ref2Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v2 610 B "+ref3Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 563 B "+ref1.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v1 551 B "+ref2.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v2 611 B "+ref3.DigestStr())
|
||||
fmt.Println(buff.String())
|
||||
|
||||
os.Remove(configPath)
|
||||
@@ -390,9 +369,9 @@ func TestReferrerCLI(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
str = strings.TrimSpace(space.ReplaceAllString(buff.String(), " "))
|
||||
So(str, ShouldContainSubstring, "ARTIFACT TYPE SIZE DIGEST")
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 557 B "+ref1Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v1 547 B "+ref2Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/custom.art.type.v2 610 B "+ref3Digest.String())
|
||||
So(str, ShouldContainSubstring, "application/vnd.oci.image.config.v1+json 563 B "+ref1.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v1 551 B "+ref2.DigestStr())
|
||||
So(str, ShouldContainSubstring, "custom.art.type.v2 611 B "+ref3.DigestStr())
|
||||
fmt.Println(buff.String())
|
||||
})
|
||||
}
|
||||
@@ -417,41 +396,39 @@ func TestFormatsReferrersCLI(t *testing.T) {
|
||||
defer cm.StopServer()
|
||||
|
||||
repo := repoName
|
||||
image, err := test.GetRandomImage("tag")
|
||||
So(err, ShouldBeNil)
|
||||
imgDigest, err := image.Digest()
|
||||
So(err, ShouldBeNil)
|
||||
image := test.CreateRandomImage()
|
||||
|
||||
err = test.UploadImage(image, baseURL, repo)
|
||||
err := test.UploadImageWithRef(image, baseURL, repo, "tag")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
// add referrers
|
||||
ref1, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref1 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
RandomConfig().
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
ref2, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref2.Manifest.Config.MediaType = customArtTypeV1
|
||||
ref2 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
ArtifactConfig(customArtTypeV1).
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
ref3, err := test.GetImageWithSubject(imgDigest, ispec.MediaTypeImageManifest)
|
||||
So(err, ShouldBeNil)
|
||||
ref3.Manifest.ArtifactType = customArtTypeV2
|
||||
ref3.Manifest.Config = ispec.DescriptorEmptyJSON
|
||||
ref3 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
RandomConfig().
|
||||
ArtifactType(customArtTypeV2).
|
||||
Subject(image.DescriptorRef()).Build()
|
||||
|
||||
ref1.Reference = ""
|
||||
err = test.UploadImage(ref1, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ref2.Reference = ""
|
||||
err = test.UploadImage(ref2, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ref3.Reference = ""
|
||||
err = test.UploadImage(ref3, baseURL, repo)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
Convey("JSON format", func() {
|
||||
args := []string{"reftest", "--output", "json", "--subject", repo + "@" + imgDigest.String()}
|
||||
args := []string{"reftest", "--output", "json", "--subject", repo + "@" + image.DigestStr()}
|
||||
|
||||
configPath := makeConfigFile(fmt.Sprintf(`{"configs":[{"_name":"reftest","url":"%s","showspinner":false}]}`,
|
||||
baseURL))
|
||||
@@ -469,7 +446,7 @@ func TestFormatsReferrersCLI(t *testing.T) {
|
||||
fmt.Println(buff.String())
|
||||
})
|
||||
Convey("YAML format", func() {
|
||||
args := []string{"reftest", "--output", "yaml", "--subject", repo + "@" + imgDigest.String()}
|
||||
args := []string{"reftest", "--output", "yaml", "--subject", repo + "@" + image.DigestStr()}
|
||||
|
||||
configPath := makeConfigFile(fmt.Sprintf(`{"configs":[{"_name":"reftest","url":"%s","showspinner":false}]}`,
|
||||
baseURL))
|
||||
@@ -487,7 +464,7 @@ func TestFormatsReferrersCLI(t *testing.T) {
|
||||
fmt.Println(buff.String())
|
||||
})
|
||||
Convey("Invalid format", func() {
|
||||
args := []string{"reftest", "--output", "invalid_format", "--subject", repo + "@" + imgDigest.String()}
|
||||
args := []string{"reftest", "--output", "invalid_format", "--subject", repo + "@" + image.DigestStr()}
|
||||
|
||||
configPath := makeConfigFile(fmt.Sprintf(`{"configs":[{"_name":"reftest","url":"%s","showspinner":false}]}`,
|
||||
baseURL))
|
||||
|
||||
+20
-24
@@ -105,26 +105,24 @@ func TestSearchCLI(t *testing.T) {
|
||||
r3tag2 = "repo3tag2"
|
||||
)
|
||||
|
||||
image1, err := test.GetImageWithConfig(ispec.Image{
|
||||
Platform: ispec.Platform{
|
||||
OS: "Os",
|
||||
Architecture: "Arch",
|
||||
},
|
||||
})
|
||||
So(err, ShouldBeNil)
|
||||
img1Digest, err := image1.Digest()
|
||||
formatterDigest1 := img1Digest.Encoded()[:8]
|
||||
So(err, ShouldBeNil)
|
||||
image1 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
ImageConfig(ispec.Image{
|
||||
Created: test.DefaultTimeRef(),
|
||||
Platform: ispec.Platform{OS: "Os", Architecture: "Arch"},
|
||||
}).
|
||||
Build()
|
||||
formatterDigest1 := image1.Digest().Encoded()[:8]
|
||||
|
||||
image2, err := test.GetRandomImage("")
|
||||
So(err, ShouldBeNil)
|
||||
img2Digest, err := image2.Digest()
|
||||
formatterDigest2 := img2Digest.Encoded()[:8]
|
||||
So(err, ShouldBeNil)
|
||||
image2 := test.CreateImageWith().
|
||||
RandomLayers(1, 10).
|
||||
DefaultConfig().
|
||||
Build()
|
||||
formatterDigest2 := image2.Digest().Encoded()[:8]
|
||||
|
||||
// repo1
|
||||
image1.Reference = r1tag1
|
||||
err = test.UploadImage(image1, baseURL, repo1)
|
||||
err := test.UploadImage(image1, baseURL, repo1)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
image2.Reference = r1tag2
|
||||
@@ -168,7 +166,7 @@ func TestSearchCLI(t *testing.T) {
|
||||
space := regexp.MustCompile(`\s+`)
|
||||
str := strings.TrimSpace(space.ReplaceAllString(buff.String(), " "))
|
||||
So(str, ShouldContainSubstring, "NAME SIZE LAST UPDATED DOWNLOADS STARS PLATFORMS")
|
||||
So(str, ShouldContainSubstring, "repo/test/alpine 1.1kB 0001-01-01 00:00:00 +0000 UTC 0 0")
|
||||
So(str, ShouldContainSubstring, "repo/test/alpine 1.1kB 2010-01-01 01:01:01 +0000 UTC 0 0")
|
||||
So(str, ShouldContainSubstring, "Os/Arch")
|
||||
So(str, ShouldContainSubstring, "linux/amd64")
|
||||
|
||||
@@ -193,8 +191,8 @@ func TestSearchCLI(t *testing.T) {
|
||||
So(err, ShouldBeNil)
|
||||
str = strings.TrimSpace(space.ReplaceAllString(buff.String(), " "))
|
||||
So(str, ShouldContainSubstring, "REPOSITORY TAG OS/ARCH DIGEST SIGNED SIZE")
|
||||
So(str, ShouldContainSubstring, "repo/alpine repo2tag1 Os/Arch "+formatterDigest1+" false 577B")
|
||||
So(str, ShouldContainSubstring, "repo/alpine repo2tag2 linux/amd64 "+formatterDigest2+" false 524B")
|
||||
So(str, ShouldContainSubstring, "repo/alpine repo2tag1 Os/Arch "+formatterDigest1+" false 525B")
|
||||
So(str, ShouldContainSubstring, "repo/alpine repo2tag2 linux/amd64 "+formatterDigest2+" false 552B")
|
||||
|
||||
fmt.Println("\n", buff.String())
|
||||
})
|
||||
@@ -233,15 +231,13 @@ func TestFormatsSearchCLI(t *testing.T) {
|
||||
r3tag2 = "repo3tag2"
|
||||
)
|
||||
|
||||
image1, err := test.GetRandomImage("")
|
||||
So(err, ShouldBeNil)
|
||||
image1 := test.CreateImageWith().RandomLayers(1, 10).DefaultConfig().Build()
|
||||
|
||||
image2, err := test.GetRandomImage("")
|
||||
So(err, ShouldBeNil)
|
||||
image2 := test.CreateImageWith().RandomLayers(1, 10).DefaultConfig().Build()
|
||||
|
||||
// repo1
|
||||
image1.Reference = r1tag1
|
||||
err = test.UploadImage(image1, baseURL, repo1)
|
||||
err := test.UploadImage(image1, baseURL, repo1)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
image2.Reference = r1tag2
|
||||
|
||||
Reference in New Issue
Block a user