diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-27 13:13:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-27 13:13:42 +0200 |
commit | 56b2937f87bd67b46aa93109aefc08ce0edb5cf1 (patch) | |
tree | c6c4d1c885988725fc2b4459b817b88109e95e64 /test | |
parent | ddfa087d002a7acf1fb34388e8cec17a2c9efae6 (diff) | |
parent | 3cc17393734a54320968b3cc46cad83f17111492 (diff) | |
download | podman-56b2937f87bd67b46aa93109aefc08ce0edb5cf1.tar.gz podman-56b2937f87bd67b46aa93109aefc08ce0edb5cf1.tar.bz2 podman-56b2937f87bd67b46aa93109aefc08ce0edb5cf1.zip |
Merge pull request #13653 from jmontleon/fix-manifest-push-header
Resolves #13629 Add RegistryAuthHeader to manifest push
Diffstat (limited to 'test')
-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"}) |