mirror of https://github.com/containers/podman.git
test: fix podman pull tests
the condition is based on the fact that podman save|podman load doesn't recreate the same digest, thus it would fail if the image in the additional store was pulled with a simple "podman pull". The same sequence of commands would fail using podman manually after a "podman pull alpine". Ignore the cache and use only the images that were pulled in the main store. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
90411b2290
commit
8403f4c33f
|
@ -216,37 +216,39 @@ var _ = Describe("Podman pull", func() {
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman pull by instance digest (image list)", func() {
|
It("podman pull by instance digest (image list)", func() {
|
||||||
|
SkipIfRemote("podman-remote does not support disabling external imagestore")
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"pull", "-q", "--arch=arm64", ALPINEARM64DIGEST})
|
session := podmanTest.Podman([]string{"pull", "-q", "--arch=arm64", ALPINEARM64DIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
|
|
||||||
// inspect using the digest of the list
|
// inspect using the digest of the list
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).To(ExitWithError(125, fmt.Sprintf(`no such object: "%s"`, ALPINELISTDIGEST)))
|
Expect(session).To(ExitWithError(125, fmt.Sprintf(`no such object: "%s"`, ALPINELISTDIGEST)))
|
||||||
// inspect using the digest of the list
|
// inspect using the digest of the list
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).To(ExitWithError(125, fmt.Sprintf(`no such object: "%s"`, ALPINELISTDIGEST)))
|
Expect(session).To(ExitWithError(125, fmt.Sprintf(`no such object: "%s"`, ALPINELISTDIGEST)))
|
||||||
|
|
||||||
// inspect using the digest of the arch-specific image's manifest
|
// inspect using the digest of the arch-specific image's manifest
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
|
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
|
||||||
// inspect using the digest of the arch-specific image's manifest
|
// inspect using the digest of the arch-specific image's manifest
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
|
Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
||||||
// inspect using the image ID
|
// inspect using the image ID
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
|
Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
|
||||||
// inspect using the image ID
|
// inspect using the image ID
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
|
Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
|
||||||
|
@ -258,49 +260,51 @@ var _ = Describe("Podman pull", func() {
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman pull by tag (image list)", func() {
|
It("podman pull by tag (image list)", func() {
|
||||||
|
SkipIfRemote("podman-remote does not support disabling external imagestore")
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"pull", "-q", "--arch=arm64", ALPINELISTTAG})
|
session := podmanTest.Podman([]string{"pull", "-q", "--arch=arm64", ALPINELISTTAG})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
// inspect using the tag we used for pulling
|
// inspect using the tag we used for pulling
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTTAG})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTTAG})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
||||||
// inspect using the tag we used for pulling
|
// inspect using the tag we used for pulling
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTTAG})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTTAG})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
||||||
// inspect using the digest of the list
|
// inspect using the digest of the list
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
||||||
// inspect using the digest of the list
|
// inspect using the digest of the list
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
||||||
// inspect using the digest of the arch-specific image's manifest
|
// inspect using the digest of the arch-specific image's manifest
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
||||||
// inspect using the digest of the arch-specific image's manifest
|
// inspect using the digest of the arch-specific image's manifest
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
|
||||||
// inspect using the image ID
|
// inspect using the image ID
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
|
||||||
// inspect using the image ID
|
// inspect using the image ID
|
||||||
session = podmanTest.Podman([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
|
session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
|
||||||
|
|
Loading…
Reference in New Issue