@@ -105,7 +105,7 @@ var _ = Describe("Connections conf", func() {
105
105
})
106
106
107
107
Context ("GetConnection/Farm" , func () {
108
- 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"]}}}`
108
+ 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"]}}}`
109
109
const defContainersConf = `
110
110
[engine]
111
111
active_service = "containers"
@@ -158,6 +158,24 @@ var _ = Describe("Connections conf", func() {
158
158
Destination : Destination {URI : "ssh://test" , Identity : ".ssh/id" , IsMachine : true },
159
159
}))
160
160
161
+ con , err = conf .GetConnection ("TLS" , false )
162
+ gomega .Expect (err ).ToNot (gomega .HaveOccurred ())
163
+ gomega .Expect (con ).To (gomega .Equal (& Connection {
164
+ Name : "TLS" ,
165
+ Default : false ,
166
+ ReadWrite : true ,
167
+ Destination : Destination {URI : "tcp://podman.io:443" , TLSCAFile : "/path/to/ca.pem" },
168
+ }))
169
+
170
+ con , err = conf .GetConnection ("mTLS" , false )
171
+ gomega .Expect (err ).ToNot (gomega .HaveOccurred ())
172
+ gomega .Expect (con ).To (gomega .Equal (& Connection {
173
+ Name : "mTLS" ,
174
+ Default : false ,
175
+ ReadWrite : true ,
176
+ Destination : Destination {URI : "tcp://podman.io:443/subpath" , TLSCAFile : "/path/to/ca.pem" , TLSCertFile : "/path/to/tls.crt" , TLSKeyFile : "/path/to/tls.key" },
177
+ }))
178
+
161
179
con , err = conf .GetConnection ("containers" , false )
162
180
gomega .Expect (err ).ToNot (gomega .HaveOccurred ())
163
181
gomega .Expect (con ).To (gomega .Equal (& Connection {
0 commit comments