diff options
Diffstat (limited to 'test/e2e/push_test.go')
-rw-r--r-- | test/e2e/push_test.go | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go index 45b8769a2..922995060 100644 --- a/test/e2e/push_test.go +++ b/test/e2e/push_test.go @@ -1,5 +1,3 @@ -// +build !remote - package integration import ( @@ -28,7 +26,7 @@ var _ = Describe("Podman push", func() { } podmanTest = PodmanTestCreate(tempdir) podmanTest.Setup() - podmanTest.RestoreAllArtifacts() + podmanTest.AddImageToRWStore(ALPINE) }) AfterEach(func() { @@ -39,24 +37,27 @@ var _ = Describe("Podman push", func() { }) It("podman push to containers/storage", func() { - session := podmanTest.PodmanNoCache([]string{"push", ALPINE, "containers-storage:busybox:test"}) + SkipIfRemote("Remote push does not support containers-storage transport") + session := podmanTest.Podman([]string{"push", ALPINE, "containers-storage:busybox:test"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - session = podmanTest.PodmanNoCache([]string{"rmi", ALPINE}) + session = podmanTest.Podman([]string{"rmi", ALPINE}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) It("podman push to dir", func() { + SkipIfRemote("Remote push does not support dir transport") bbdir := filepath.Join(podmanTest.TempDir, "busybox") - session := podmanTest.PodmanNoCache([]string{"push", "--remove-signatures", ALPINE, + session := podmanTest.Podman([]string{"push", "--remove-signatures", ALPINE, fmt.Sprintf("dir:%s", bbdir)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) It("podman push to local registry", func() { + SkipIfRemote("FIXME: This should work") if podmanTest.Host.Arch == "ppc64le" { Skip("No registry image for ppc64le") } @@ -65,7 +66,7 @@ var _ = Describe("Podman push", func() { } lock := GetPortLock("5000") defer lock.Unlock() - session := podmanTest.PodmanNoCache([]string{"run", "-d", "--name", "registry", "-p", "5000:5000", registry, "/entrypoint.sh", "/etc/docker/registry/config.yml"}) + session := podmanTest.Podman([]string{"run", "-d", "--name", "registry", "-p", "5000:5000", registry, "/entrypoint.sh", "/etc/docker/registry/config.yml"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -73,12 +74,12 @@ var _ = Describe("Podman push", func() { Skip("Cannot start docker registry.") } - push := podmanTest.PodmanNoCache([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"}) + push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Equal(0)) // Test --digestfile option - push2 := podmanTest.PodmanNoCache([]string{"push", "--tls-verify=false", "--digestfile=/tmp/digestfile.txt", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"}) + push2 := podmanTest.Podman([]string{"push", "--tls-verify=false", "--digestfile=/tmp/digestfile.txt", "--remove-signatures", ALPINE, "localhost:5000/my-alpine"}) push2.WaitWithDefaultTimeout() fi, err := os.Lstat("/tmp/digestfile.txt") Expect(err).To(BeNil()) @@ -87,6 +88,7 @@ var _ = Describe("Podman push", func() { }) It("podman push to local registry with authorization", func() { + SkipIfRemote("FIXME: This does not seem to be returning an error") SkipIfRootless("FIXME: Creating content in certs.d we use directories in homedir") if podmanTest.Host.Arch == "ppc64le" { Skip("No registry image for ppc64le") @@ -113,7 +115,7 @@ var _ = Describe("Podman push", func() { } lock := GetPortLock("5000") defer lock.Unlock() - session := podmanTest.PodmanNoCache([]string{"run", "--entrypoint", "htpasswd", registry, "-Bbn", "podmantest", "test"}) + session := podmanTest.Podman([]string{"run", "--entrypoint", "htpasswd", registry, "-Bbn", "podmantest", "test"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -123,7 +125,7 @@ var _ = Describe("Podman push", func() { f.WriteString(session.OutputToString()) f.Sync() - session = podmanTest.PodmanNoCache([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v", + session = podmanTest.Podman([]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", @@ -135,42 +137,44 @@ var _ = Describe("Podman push", func() { Skip("Cannot start docker registry.") } - session = podmanTest.PodmanNoCache([]string{"logs", "registry"}) + session = podmanTest.Podman([]string{"logs", "registry"}) session.WaitWithDefaultTimeout() - push := podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/tlstest"}) + push := podmanTest.Podman([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/tlstest"}) push.WaitWithDefaultTimeout() Expect(push).To(ExitWithError()) - push = podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", "--tls-verify=false", ALPINE, "localhost:5000/tlstest"}) + push = podmanTest.Podman([]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.PodmanNoCache([]string{"push", "--creds=podmantest:wrongpasswd", ALPINE, "localhost:5000/credstest"}) + push = podmanTest.Podman([]string{"push", "--creds=podmantest:wrongpasswd", ALPINE, "localhost:5000/credstest"}) push.WaitWithDefaultTimeout() Expect(push).To(ExitWithError()) - push = podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", "--cert-dir=fakedir", ALPINE, "localhost:5000/certdirtest"}) + push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", "--cert-dir=fakedir", ALPINE, "localhost:5000/certdirtest"}) push.WaitWithDefaultTimeout() Expect(push).To(ExitWithError()) - push = podmanTest.PodmanNoCache([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/defaultflags"}) + push = podmanTest.Podman([]string{"push", "--creds=podmantest:test", ALPINE, "localhost:5000/defaultflags"}) push.WaitWithDefaultTimeout() Expect(push.ExitCode()).To(Equal(0)) }) It("podman push to docker-archive", func() { + SkipIfRemote("Remote push does not support docker-archive transport") tarfn := filepath.Join(podmanTest.TempDir, "alp.tar") - session := podmanTest.PodmanNoCache([]string{"push", ALPINE, + session := podmanTest.Podman([]string{"push", ALPINE, fmt.Sprintf("docker-archive:%s:latest", tarfn)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) It("podman push to docker daemon", func() { + SkipIfRemote("Remote push does not support docker-daemon transport") setup := SystemExec("bash", []string{"-c", "systemctl status docker 2>&1"}) if setup.LineInOutputContains("Active: inactive") { @@ -183,7 +187,7 @@ var _ = Describe("Podman push", func() { Skip("Docker is not available") } - session := podmanTest.PodmanNoCache([]string{"push", ALPINE, "docker-daemon:alpine:podmantest"}) + session := podmanTest.Podman([]string{"push", ALPINE, "docker-daemon:alpine:podmantest"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -196,24 +200,27 @@ var _ = Describe("Podman push", func() { }) It("podman push to oci-archive", func() { + SkipIfRemote("Remote push does not support oci-archive transport") tarfn := filepath.Join(podmanTest.TempDir, "alp.tar") - session := podmanTest.PodmanNoCache([]string{"push", ALPINE, + session := podmanTest.Podman([]string{"push", ALPINE, fmt.Sprintf("oci-archive:%s:latest", tarfn)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) It("podman push to docker-archive no reference", func() { + SkipIfRemote("Remote push does not support docker-archive transport") tarfn := filepath.Join(podmanTest.TempDir, "alp.tar") - session := podmanTest.PodmanNoCache([]string{"push", ALPINE, + session := podmanTest.Podman([]string{"push", ALPINE, fmt.Sprintf("docker-archive:%s", tarfn)}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) It("podman push to oci-archive no reference", func() { + SkipIfRemote("Remote push does not support oci-archive transport") ociarc := filepath.Join(podmanTest.TempDir, "alp-oci") - session := podmanTest.PodmanNoCache([]string{"push", ALPINE, + session := podmanTest.Podman([]string{"push", ALPINE, fmt.Sprintf("oci-archive:%s", ociarc)}) session.WaitWithDefaultTimeout() |