diff --git a/pkg/config/connections_test.go b/pkg/config/connections_test.go index 14176da45..7b732f726 100644 --- a/pkg/config/connections_test.go +++ b/pkg/config/connections_test.go @@ -113,7 +113,7 @@ var _ = Describe("Connections conf", func() { }) Context("GetConnection/Farm", func() { - const defConnectionsConf = `{"Connection":{"Default":"test","Connections":{"test":{"URI":"ssh://podman.io"},"QA":{"URI":"ssh://test","Identity":".ssh/id","IsMachine":true}}},"farm":{"Default":"farm1","List":{"farm1":["test"]}}}` + const defConnectionsConf = `{"Connection":{"Default":"test","Connections":{"test":{"URI":"ssh://podman.io"},"QA":{"URI":"ssh://test","Identity":".ssh/id","IsMachine":true},"TLS": {"URI": "tcp://podman.io:443", "TLSCAFile":"/path/to/ca.pem"},"mTLS":{"URI": "tcp://podman.io:443/subpath", "TLSCAFile": "/path/to/ca.pem", "TLSCertFile": "/path/to/tls.crt", "TLSKeyFile": "/path/to/tls.key"}}},"farm":{"Default":"farm1","List":{"farm1":["test"]}}}` const defContainersConf = ` [engine] active_service = "containers" @@ -166,6 +166,24 @@ var _ = Describe("Connections conf", func() { Destination: Destination{URI: "ssh://test", Identity: ".ssh/id", IsMachine: true}, })) + con, err = conf.GetConnection("TLS", false) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) + gomega.Expect(con).To(gomega.Equal(&Connection{ + Name: "TLS", + Default: false, + ReadWrite: true, + Destination: Destination{URI: "tcp://podman.io:443", TLSCAFile: "/path/to/ca.pem"}, + })) + + con, err = conf.GetConnection("mTLS", false) + gomega.Expect(err).ToNot(gomega.HaveOccurred()) + gomega.Expect(con).To(gomega.Equal(&Connection{ + Name: "mTLS", + Default: false, + ReadWrite: true, + Destination: Destination{URI: "tcp://podman.io:443/subpath", TLSCAFile: "/path/to/ca.pem", TLSCertFile: "/path/to/tls.crt", TLSKeyFile: "/path/to/tls.key"}, + })) + con, err = conf.GetConnection("containers", false) gomega.Expect(err).ToNot(gomega.HaveOccurred()) gomega.Expect(con).To(gomega.Equal(&Connection{