summaryrefslogtreecommitdiff
path: root/test/e2e/pull_test.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-05-14 14:28:50 -0500
committerbaude <bbaude@redhat.com>2019-05-29 15:12:05 -0500
commitf610a485c1bca7a78d3b2f70e2005b79668fab2f (patch)
tree1a3650add2aff9b57ea005c543a29a39ff5b4976 /test/e2e/pull_test.go
parent8422503f4311555ecb799449b371ad1600a8020f (diff)
downloadpodman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.tar.gz
podman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.tar.bz2
podman-f610a485c1bca7a78d3b2f70e2005b79668fab2f.zip
use imagecaches for local tests
when doing localized tests (not varlink), we can use secondary image stores as read-only image caches. this cuts down on test time significantly because each test does not need to restore the images from a tarball anymore. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/pull_test.go')
-rw-r--r--test/e2e/pull_test.go64
1 files changed, 33 insertions, 31 deletions
diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go
index 4e4e80d56..d6e7b44d1 100644
--- a/test/e2e/pull_test.go
+++ b/test/e2e/pull_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman pull", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.RestoreAllArtifacts()
})
AfterEach(func() {
@@ -39,132 +38,135 @@ var _ = Describe("Podman pull", func() {
})
It("podman pull from docker a not existing image", func() {
- session := podmanTest.Podman([]string{"pull", "ibetthisdoesntexistthere:foo"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "ibetthisdoesntexistthere:foo"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Not(Equal(0)))
})
It("podman pull from docker with tag", func() {
- session := podmanTest.Podman([]string{"pull", "busybox:glibc"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "busybox:glibc"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "busybox:glibc"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "busybox:glibc"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull from docker without tag", func() {
- session := podmanTest.Podman([]string{"pull", "busybox"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "busybox"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "busybox"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "busybox"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull from alternate registry with tag", func() {
- session := podmanTest.Podman([]string{"pull", nginx})
+ session := podmanTest.PodmanNoCache([]string{"pull", nginx})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", nginx})
+ session = podmanTest.PodmanNoCache([]string{"rmi", nginx})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull from alternate registry without tag", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/alpine_nginx"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "quay.io/libpod/alpine_nginx"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "quay.io/libpod/alpine_nginx"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "quay.io/libpod/alpine_nginx"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull by digest", func() {
- session := podmanTest.Podman([]string{"pull", "alpine@sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "alpine@sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "alpine:none"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "alpine:none"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull bogus image", func() {
- session := podmanTest.Podman([]string{"pull", "umohnani/get-started"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "umohnani/get-started"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Not(Equal(0)))
})
It("podman pull from docker-archive", func() {
+ podmanTest.RestoreArtifact(ALPINE)
tarfn := filepath.Join(podmanTest.TempDir, "alp.tar")
- session := podmanTest.Podman([]string{"save", "-o", tarfn, "alpine"})
+ session := podmanTest.PodmanNoCache([]string{"save", "-o", tarfn, "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "alpine"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pull", fmt.Sprintf("docker-archive:%s", tarfn)})
+ session = podmanTest.PodmanNoCache([]string{"pull", fmt.Sprintf("docker-archive:%s", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "alpine"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull from oci-archive", func() {
+ podmanTest.RestoreArtifact(ALPINE)
tarfn := filepath.Join(podmanTest.TempDir, "oci-alp.tar")
- session := podmanTest.Podman([]string{"save", "--format", "oci-archive", "-o", tarfn, "alpine"})
+ session := podmanTest.PodmanNoCache([]string{"save", "--format", "oci-archive", "-o", tarfn, "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "alpine"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pull", fmt.Sprintf("oci-archive:%s", tarfn)})
+ session = podmanTest.PodmanNoCache([]string{"pull", fmt.Sprintf("oci-archive:%s", tarfn)})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "alpine"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull from local directory", func() {
+ podmanTest.RestoreArtifact(ALPINE)
dirpath := filepath.Join(podmanTest.TempDir, "alpine")
os.MkdirAll(dirpath, os.ModePerm)
imgPath := fmt.Sprintf("dir:%s", dirpath)
- session := podmanTest.Podman([]string{"push", "alpine", imgPath})
+ session := podmanTest.PodmanNoCache([]string{"push", "alpine", imgPath})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "alpine"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pull", imgPath})
+ session = podmanTest.PodmanNoCache([]string{"pull", imgPath})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"rmi", "alpine"})
+ session = podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
It("podman pull check quiet", func() {
podmanTest.RestoreArtifact(ALPINE)
- setup := podmanTest.Podman([]string{"images", ALPINE, "-q", "--no-trunc"})
+ setup := podmanTest.PodmanNoCache([]string{"images", ALPINE, "-q", "--no-trunc"})
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))
shortImageId := strings.Split(setup.OutputToString(), ":")[1]
- rmi := podmanTest.Podman([]string{"rmi", ALPINE})
+ rmi := podmanTest.PodmanNoCache([]string{"rmi", ALPINE})
rmi.WaitWithDefaultTimeout()
Expect(rmi.ExitCode()).To(Equal(0))
- pull := podmanTest.Podman([]string{"pull", "-q", ALPINE})
+ pull := podmanTest.PodmanNoCache([]string{"pull", "-q", ALPINE})
pull.WaitWithDefaultTimeout()
Expect(pull.ExitCode()).To(Equal(0))
@@ -172,17 +174,17 @@ var _ = Describe("Podman pull", func() {
})
It("podman pull check all tags", func() {
- session := podmanTest.Podman([]string{"pull", "--all-tags", "alpine"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "--all-tags", "alpine"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.LineInOuputStartsWith("Pulled Images:")).To(BeTrue())
- session = podmanTest.Podman([]string{"images"})
+ session = podmanTest.PodmanNoCache([]string{"images"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 4))
- rmi := podmanTest.Podman([]string{"rmi", "-a", "-f"})
+ rmi := podmanTest.PodmanNoCache([]string{"rmi", "-a", "-f"})
rmi.WaitWithDefaultTimeout()
Expect(rmi.ExitCode()).To(Equal(0))
})