From 140fb3ae1743e5ae5e94a18a29d53ea819471435 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 5 May 2022 10:47:32 +0200 Subject: e2e: pull_test: squash --quiet test Squash the --quiet test into another one. The test was more complex than necessary and can easily be squashed into another one to avoid one more expensive pull. Signed-off-by: Valentin Rothberg --- test/e2e/pull_test.go | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'test/e2e') diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index 0eff9a550..20f0a6b38 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" @@ -59,10 +58,16 @@ var _ = Describe("Podman pull", func() { Expect(session).To(ExitWithError()) }) - It("podman pull 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() @@ -94,25 +99,6 @@ var _ = Describe("Podman pull", func() { Expect(session).Should(Exit(0)) }) - 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() -- cgit v1.2.3-54-g00ecf