diff options
author | haircommander <pehunt@redhat.com> | 2018-06-15 19:41:00 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-18 18:46:55 +0000 |
commit | d8f2cb862290895a25383485bebbca1b08f79c95 (patch) | |
tree | fad2ece26c98a254d7e8c63a8f2b0cefef169612 /test | |
parent | 0f2ea23de567983521ce6be8804deda06056af10 (diff) | |
download | podman-d8f2cb862290895a25383485bebbca1b08f79c95.tar.gz podman-d8f2cb862290895a25383485bebbca1b08f79c95.tar.bz2 podman-d8f2cb862290895a25383485bebbca1b08f79c95.zip |
TLS verify is skipped per registry.
Signed-off-by: haircommander <pehunt@redhat.com>
Closes: #952
Approved by: rhatdan
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/search_test.go | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go index 96e1422ed..7cd877db6 100644 --- a/test/e2e/search_test.go +++ b/test/e2e/search_test.go @@ -29,6 +29,13 @@ var _ = Describe("Podman search", func() { # empty [registries.insecure] registries = []` + + const regFileContents2 = ` + [registries.search] + registries = ['localhost:5000', 'localhost:6000'] + + [registries.insecure] + registries = ['localhost:5000']` BeforeEach(func() { tempdir, err = CreateTempDirInTempDir() if err != nil { @@ -240,4 +247,42 @@ var _ = Describe("Podman search", func() { // cleanup os.Setenv("REGISTRIES_CONFIG_PATH", "") }) + + It("podman search doesn't attempt HTTP if one registry is not listed as insecure", func() { + registry := podmanTest.Podman([]string{"run", "-d", "-p", "5000:5000", "--name", "registry7", "registry:2"}) + registry.WaitWithDefaultTimeout() + Expect(registry.ExitCode()).To(Equal(0)) + + if !WaitContainerReady(&podmanTest, "registry7", "listening on", 20, 1) { + Skip("Can not start docker registry.") + } + + registry = podmanTest.Podman([]string{"run", "-d", "-p", "6000:5000", "--name", "registry8", "registry:2"}) + registry.WaitWithDefaultTimeout() + Expect(registry.ExitCode()).To(Equal(0)) + + if !WaitContainerReady(&podmanTest, "registry8", "listening on", 20, 1) { + Skip("Can not start docker registry.") + } + push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, "localhost:6000/my-alpine"}) + push.WaitWithDefaultTimeout() + Expect(push.ExitCode()).To(Equal(0)) + + // registries.conf set up + regFileBytes := []byte(regFileContents2) + outfile := filepath.Join(podmanTest.TempDir, "registries.conf") + os.Setenv("REGISTRIES_CONFIG_PATH", outfile) + ioutil.WriteFile(outfile, regFileBytes, 0644) + + search := podmanTest.Podman([]string{"search", "my-alpine"}) + search.WaitWithDefaultTimeout() + + Expect(search.ExitCode()).To(Equal(0)) + Expect(search.OutputToString()).Should(BeEmpty()) + match, _ := search.ErrorGrepString("error") + Expect(match).Should(BeTrue()) + + // cleanup + os.Setenv("REGISTRIES_CONFIG_PATH", "") + }) }) |