diff options
author | jason <jason@towerofpower.montleon.intra> | 2022-03-24 16:07:36 -0400 |
---|---|---|
committer | Jason Montleon <jmontleo@redhat.com> | 2022-03-26 16:39:11 -0400 |
commit | 3cc17393734a54320968b3cc46cad83f17111492 (patch) | |
tree | d76452c03777ba3330e89f97675a61e62937a84c /test/e2e | |
parent | a416fd6de40820e266e9e1e312c5f13bbb0b189f (diff) | |
download | podman-3cc17393734a54320968b3cc46cad83f17111492.tar.gz podman-3cc17393734a54320968b3cc46cad83f17111492.tar.bz2 podman-3cc17393734a54320968b3cc46cad83f17111492.zip |
Resolves #13629 Add RegistryAuthHeader to manifest push
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/manifest_test.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go index eaa9cdae6..6e029d3a4 100644 --- a/test/e2e/manifest_test.go +++ b/test/e2e/manifest_test.go @@ -5,6 +5,7 @@ import ( "path/filepath" "strings" + podmanRegistry "github.com/containers/podman/v4/hack/podman-registry-go" . "github.com/containers/podman/v4/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -272,6 +273,42 @@ var _ = Describe("Podman manifest", func() { )) }) + It("authenticated push", func() { + registry, err := podmanRegistry.Start() + Expect(err).To(BeNil()) + + session := podmanTest.Podman([]string{"manifest", "create", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"pull", ALPINE}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + session = podmanTest.Podman([]string{"tag", ALPINE, "localhost:" + registry.Port + "/alpine:latest"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "--format=v2s2", "localhost:" + registry.Port + "/alpine:latest"}) + push.WaitWithDefaultTimeout() + Expect(push).Should(Exit(0)) + + session = podmanTest.Podman([]string{"manifest", "add", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/alpine:latest"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + push = podmanTest.Podman([]string{"manifest", "push", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/credstest"}) + push.WaitWithDefaultTimeout() + Expect(push).Should(Exit(0)) + + push = podmanTest.Podman([]string{"manifest", "push", "--tls-verify=false", "--creds=podmantest:wrongpasswd", "foo", "localhost:" + registry.Port + "/credstest"}) + push.WaitWithDefaultTimeout() + Expect(push).To(ExitWithError()) + + err = registry.Stop() + Expect(err).To(BeNil()) + }) + It("push --rm", func() { SkipIfRemote("remote does not support --rm") session := podmanTest.Podman([]string{"manifest", "create", "foo"}) |