aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-05 08:37:35 -0400
committerGitHub <noreply@github.com>2022-05-05 08:37:35 -0400
commit09b8831fa21c47bf1dac05381b61cec0092f94c5 (patch)
tree5d2cd22528f4516896499dee78e2da1b6881b3d9 /test
parent8ed517576cc185ddfa5d2e3af9c034e9ae375841 (diff)
parent6ddccd94f69df853a88901e361792ded9eff1f91 (diff)
downloadpodman-09b8831fa21c47bf1dac05381b61cec0092f94c5.tar.gz
podman-09b8831fa21c47bf1dac05381b61cec0092f94c5.tar.bz2
podman-09b8831fa21c47bf1dac05381b61cec0092f94c5.zip
Merge pull request #14124 from vrothberg/e2e-cleanups
e2e cleanups
Diffstat (limited to 'test')
-rw-r--r--test/e2e/manifest_test.go5
-rw-r--r--test/e2e/pull_test.go92
2 files changed, 30 insertions, 67 deletions
diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go
index 92b8bc2e1..88ccdc87d 100644
--- a/test/e2e/manifest_test.go
+++ b/test/e2e/manifest_test.go
@@ -273,7 +273,10 @@ var _ = Describe("Podman manifest", func() {
})
It("authenticated push", func() {
- registry, err := podmanRegistry.Start()
+ registryOptions := &podmanRegistry.Options{
+ Image: "docker-archive:" + imageTarPath(registry),
+ }
+ registry, err := podmanRegistry.StartWithOptions(registryOptions)
Expect(err).To(BeNil())
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go
index 41eb8b449..55e8d637b 100644
--- a/test/e2e/pull_test.go
+++ b/test/e2e/pull_test.go
@@ -5,7 +5,6 @@ import (
"os"
"path/filepath"
"runtime"
- "strings"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo"
@@ -53,23 +52,29 @@ var _ = Describe("Podman pull", func() {
Expect(session).Should(Exit(0))
})
- It("podman pull from docker a not existing image", func() {
- session := podmanTest.Podman([]string{"pull", "ibetthisdoesntexistthere:foo"})
+ It("podman pull bogus image", func() {
+ session := podmanTest.Podman([]string{"pull", "quay.io/ibetthis/doesntexistthere:foo"})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
})
- It("podman pull from docker with tag", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2:20200210"})
+ It("podman pull with tag --quiet", func() {
+ session := podmanTest.Podman([]string{"pull", "-q", "quay.io/libpod/testdigest_v2s2:20200210"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ quietOutput := session.OutputToString()
+
+ session = podmanTest.Podman([]string{"inspect", "testdigest_v2s2:20200210", "--format", "{{.ID}}"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(Equal(quietOutput))
session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2:20200210"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
- It("podman pull from docker without tag", func() {
+ It("podman pull without tag", func() {
session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -79,39 +84,36 @@ var _ = Describe("Podman pull", func() {
Expect(session).Should(Exit(0))
})
- It("podman pull from alternate registry with tag", func() {
- session := podmanTest.Podman([]string{"pull", cirros})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
-
- session = podmanTest.Podman([]string{"rmi", cirros})
+ It("podman pull by digest", func() {
+ session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- })
- It("podman pull from alternate registry without tag", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/cirros"})
+ // Without a tag/digest the input is normalized with the "latest" tag, see #11964
+ session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
+ Expect(session).Should(Exit(1))
- session = podmanTest.Podman([]string{"rmi", "quay.io/libpod/cirros"})
+ session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
- It("podman pull by digest", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
+ It("podman pull check all tags", func() {
+ session := podmanTest.Podman([]string{"pull", "--all-tags", "quay.io/libpod/testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- // Without a tag/digest the input is normalized with the "latest" tag, see #11964
- session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"})
+ session = podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(1))
+ Expect(session).Should(Exit(0))
+ Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images")
+ })
- session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
+ It("podman pull from docker with nonexistent --authfile", func() {
+ session := podmanTest.Podman([]string{"pull", "--authfile", "/tmp/nonexistent", ALPINE})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
+ Expect(session).To(ExitWithError())
})
It("podman pull by digest (image list)", func() {
@@ -251,12 +253,6 @@ var _ = Describe("Podman pull", func() {
Expect(session).Should(Exit(0))
})
- It("podman pull bogus image", func() {
- session := podmanTest.Podman([]string{"pull", "umohnani/get-started"})
- session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
- })
-
It("podman pull from docker-archive", func() {
SkipIfRemote("podman-remote does not support pulling from docker-archive")
@@ -388,42 +384,6 @@ var _ = Describe("Podman pull", func() {
Expect(session.LineInOutputContainsTag(filepath.Join("localhost", dirpath), "latest")).To(BeTrue())
})
- It("podman pull check quiet", func() {
- err := podmanTest.RestoreArtifact(ALPINE)
- Expect(err).ToNot(HaveOccurred())
- setup := podmanTest.Podman([]string{"images", ALPINE, "-q", "--no-trunc"})
- setup.WaitWithDefaultTimeout()
- Expect(setup).Should(Exit(0))
- shortImageID := strings.Split(setup.OutputToString(), ":")[1]
-
- rmi := podmanTest.Podman([]string{"rmi", ALPINE})
- rmi.WaitWithDefaultTimeout()
- Expect(rmi).Should(Exit(0))
-
- pull := podmanTest.Podman([]string{"pull", "-q", ALPINE})
- pull.WaitWithDefaultTimeout()
- Expect(pull).Should(Exit(0))
-
- Expect(pull.OutputToString()).To(ContainSubstring(shortImageID))
- })
-
- It("podman pull check all tags", func() {
- session := podmanTest.Podman([]string{"pull", "--all-tags", "k8s.gcr.io/pause"})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
-
- session = podmanTest.Podman([]string{"images"})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 4))
- })
-
- It("podman pull from docker with nonexistent --authfile", func() {
- session := podmanTest.Podman([]string{"pull", "--authfile", "/tmp/nonexistent", ALPINE})
- session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
- })
-
It("podman pull + inspect from unqualified-search registry", func() {
// Regression test for #6381:
// Make sure that `pull shortname` and `inspect shortname`