diff options
author | baude <bbaude@redhat.com> | 2019-05-14 14:28:50 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-05-29 15:12:05 -0500 |
commit | f610a485c1bca7a78d3b2f70e2005b79668fab2f (patch) | |
tree | 1a3650add2aff9b57ea005c543a29a39ff5b4976 /test/e2e/push_test.go | |
parent | 8422503f4311555ecb799449b371ad1600a8020f (diff) | |
download | podman-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/push_test.go')
-rw-r--r-- | test/e2e/push_test.go | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go index 009067482..de2416868 100644 --- a/test/e2e/push_test.go +++ b/test/e2e/push_test.go @@ -38,22 +38,18 @@ var _ = Describe("Podman push", func() { }) It("podman push to containers/storage", func() { - session := podmanTest.Podman([]string{"push", ALPINE, "containers-storage:busybox:test"}) + session := podmanTest.PodmanNoCache([]string{"push", ALPINE, "containers-storage:busybox:test"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - session = podmanTest.Podman([]string{"rmi", ALPINE}) - session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - - session = podmanTest.Podman([]string{"rmi", "busybox:test"}) + session = podmanTest.PodmanNoCache([]string{"rmi", ALPINE}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) It("podman push to dir", func() { bbdir := filepath.Join(podmanTest.TempDir, "busybox") - session := podmanTest.Podman([]string{"push", "--remove-signatures", ALPINE, + session := podmanTest.PodmanNoCache([]string{"push", "--remove-signatures", ALPINE, fmt.Sprintf("dir:%s", bbdir)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -65,8 +61,7 @@ var _ = Describe("Podman push", func() { } lock := GetPortLock("5000") defer lock.Unlock() - podmanTest.RestoreArtifact(registry) - session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", "5000:5000", registry, "/entrypoint.sh", "/etc/docker/registry/config.yml"}) + session := podmanTest.PodmanNoCache([]string{"run", "-d", "--name", "registry", "-p", "5000:5000", registry, "/entrypoint.sh", "/etc/docker/registry/config.yml"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -74,7 +69,7 @@ var _ = Describe("Podman push", func() { Skip("Can not start docker registry.") } - push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"}) + push := podmanTest.PodmanNoCache([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Equal(0)) }) @@ -106,8 +101,7 @@ var _ = Describe("Podman push", func() { } lock := GetPortLock("5000") defer lock.Unlock() - podmanTest.RestoreArtifact(registry) - session := podmanTest.Podman([]string{"run", "--entrypoint", "htpasswd", registry, "-Bbn", "podmantest", "test"}) + session := podmanTest.PodmanNoCache([]string{"run", "--entrypoint", "htpasswd", registry, "-Bbn", "podmantest", "test"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -117,7 +111,7 @@ var _ = Describe("Podman push", func() { f.WriteString(session.OutputToString()) f.Sync() - session = podmanTest.Podman([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v", + session = podmanTest.PodmanNoCache([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v", strings.Join([]string{authPath, "/auth"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e", "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd", "-v", strings.Join([]string{certPath, "/certs"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt", @@ -129,36 +123,36 @@ var _ = Describe("Podman push", func() { Skip("Can not start docker registry.") } - session = podmanTest.Podman([]string{"logs", "registry"}) + session = podmanTest.PodmanNoCache([]string{"logs", "registry"}) session.WaitWithDefaultTimeout() - push := podmanTest.Podman([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/tlstest"}) + push := podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/tlstest"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Not(Equal(0))) - push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", "--tls-verify=false", ALPINE, "localhost:5000/tlstest"}) + push = podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", "--tls-verify=false", ALPINE, "localhost:5000/tlstest"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Equal(0)) setup := SystemExec("cp", []string{filepath.Join(certPath, "domain.crt"), "/etc/containers/certs.d/localhost:5000/ca.crt"}) Expect(setup.ExitCode()).To(Equal(0)) - push = podmanTest.Podman([]string{"push", "--creds=podmantest:wrongpasswd", ALPINE, "localhost:5000/credstest"}) + push = podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:wrongpasswd", ALPINE, "localhost:5000/credstest"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Not(Equal(0))) - push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", "--cert-dir=fakedir", ALPINE, "localhost:5000/certdirtest"}) + push = podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", "--cert-dir=fakedir", ALPINE, "localhost:5000/certdirtest"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Not(Equal(0))) - push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/defaultflags"}) + push = podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/defaultflags"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Equal(0)) }) It("podman push to docker-archive", func() { tarfn := filepath.Join(podmanTest.TempDir, "alp.tar") - session := podmanTest.Podman([]string{"push", ALPINE, + session := podmanTest.PodmanNoCache([]string{"push", ALPINE, fmt.Sprintf("docker-archive:%s:latest", tarfn)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -177,7 +171,7 @@ var _ = Describe("Podman push", func() { Skip("Docker is not available") } - session := podmanTest.Podman([]string{"push", ALPINE, "docker-daemon:alpine:podmantest"}) + session := podmanTest.PodmanNoCache([]string{"push", ALPINE, "docker-daemon:alpine:podmantest"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -191,7 +185,7 @@ var _ = Describe("Podman push", func() { It("podman push to oci-archive", func() { tarfn := filepath.Join(podmanTest.TempDir, "alp.tar") - session := podmanTest.Podman([]string{"push", ALPINE, + session := podmanTest.PodmanNoCache([]string{"push", ALPINE, fmt.Sprintf("oci-archive:%s:latest", tarfn)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -208,7 +202,7 @@ var _ = Describe("Podman push", func() { setup := SystemExec("ostree", []string{strings.Join([]string{"--repo=", ostreePath}, ""), "init"}) Expect(setup.ExitCode()).To(Equal(0)) - session := podmanTest.Podman([]string{"push", ALPINE, strings.Join([]string{"ostree:alp@", ostreePath}, "")}) + session := podmanTest.PodmanNoCache([]string{"push", ALPINE, strings.Join([]string{"ostree:alp@", ostreePath}, "")}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -216,7 +210,7 @@ var _ = Describe("Podman push", func() { It("podman push to docker-archive no reference", func() { tarfn := filepath.Join(podmanTest.TempDir, "alp.tar") - session := podmanTest.Podman([]string{"push", ALPINE, + session := podmanTest.PodmanNoCache([]string{"push", ALPINE, fmt.Sprintf("docker-archive:%s", tarfn)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -224,7 +218,7 @@ var _ = Describe("Podman push", func() { It("podman push to oci-archive no reference", func() { ociarc := filepath.Join(podmanTest.TempDir, "alp-oci") - session := podmanTest.Podman([]string{"push", ALPINE, + session := podmanTest.PodmanNoCache([]string{"push", ALPINE, fmt.Sprintf("oci-archive:%s", ociarc)}) session.WaitWithDefaultTimeout() |