From 2ce78aace682084393f1cda07c2bca0bbb773c95 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Tue, 29 Jun 2021 16:24:03 -0700 Subject: Enhance system connection add URL input * Add support for the tcp and unix schemes in connection URLs. Signed-off-by: Jhon Honce --- test/e2e/system_connection_test.go | 64 +++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'test/e2e/system_connection_test.go') diff --git a/test/e2e/system_connection_test.go b/test/e2e/system_connection_test.go index 7c922a648..21398887a 100644 --- a/test/e2e/system_connection_test.go +++ b/test/e2e/system_connection_test.go @@ -53,7 +53,7 @@ var _ = Describe("podman system connection", func() { GinkgoWriter.Write([]byte(timedResult)) }) - It("add", func() { + It("add ssh://", func() { cmd := []string{"system", "connection", "add", "--default", "--identity", "~/.ssh/id_rsa", @@ -94,6 +94,68 @@ var _ = Describe("podman system connection", func() { )) }) + It("add UDS", func() { + cmd := []string{"system", "connection", "add", + "QA-UDS", + "unix:///run/podman/podman.sock", + } + session := podmanTest.Podman(cmd) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.Out).Should(Say("")) + + cfg, err := config.ReadCustomConfig() + Expect(err).ShouldNot(HaveOccurred()) + Expect(cfg.Engine.ActiveService).To(Equal("QA-UDS")) + Expect(cfg.Engine.ServiceDestinations["QA-UDS"]).To(Equal( + config.Destination{ + URI: "unix:///run/podman/podman.sock", + Identity: "", + }, + )) + + cmd = []string{"system", "connection", "add", + "QA-UDS1", + "--socket-path", "/run/user/podman/podman.sock", + "unix:///run/podman/podman.sock", + } + session = podmanTest.Podman(cmd) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.Out).Should(Say("")) + + cfg, err = config.ReadCustomConfig() + Expect(err).ShouldNot(HaveOccurred()) + Expect(cfg.Engine.ActiveService).To(Equal("QA-UDS")) + Expect(cfg.Engine.ServiceDestinations["QA-UDS1"]).To(Equal( + config.Destination{ + URI: "unix:///run/user/podman/podman.sock", + Identity: "", + }, + )) + }) + + It("add tcp", func() { + cmd := []string{"system", "connection", "add", + "QA-TCP", + "tcp://localhost:8080", + } + session := podmanTest.Podman(cmd) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.Out).Should(Say("")) + + cfg, err := config.ReadCustomConfig() + Expect(err).ShouldNot(HaveOccurred()) + Expect(cfg.Engine.ActiveService).To(Equal("QA-TCP")) + Expect(cfg.Engine.ServiceDestinations["QA-TCP"]).To(Equal( + config.Destination{ + URI: "tcp://localhost:8080", + Identity: "", + }, + )) + }) + It("remove", func() { cmd := []string{"system", "connection", "add", "--default", -- cgit v1.2.3-54-g00ecf