MCPcopy Index your code
hub / github.com/zalando/skipper / TestOptionsTLSConfigInvalidPaths

Function TestOptionsTLSConfigInvalidPaths

skipper_test.go:233–254  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

231}
232
233func TestOptionsTLSConfigInvalidPaths(t *testing.T) {
234 cr := certregistry.NewCertRegistry()
235
236 for _, tt := range []struct {
237 name string
238 options *Options
239 }{
240 {"missing cert path", &Options{KeyPathTLS: "fixtures/test.key"}},
241 {"missing key path", &Options{CertPathTLS: "fixtures/test.crt"}},
242 {"wrong cert path", &Options{CertPathTLS: "fixtures/notFound.crt", KeyPathTLS: "fixtures/test.key"}},
243 {"wrong key path", &Options{CertPathTLS: "fixtures/test.crt", KeyPathTLS: "fixtures/notFound.key"}},
244 {"cert key mismatch", &Options{CertPathTLS: "fixtures/test.crt", KeyPathTLS: "fixtures/test2.key"}},
245 {"multiple cert key count mismatch", &Options{CertPathTLS: "fixtures/test.crt,fixtures/test2.crt", KeyPathTLS: "fixtures/test.key"}},
246 {"multiple cert key mismatch", &Options{CertPathTLS: "fixtures/test.crt,fixtures/test2.crt", KeyPathTLS: "fixtures/test2.key,fixtures/test.key"}},
247 } {
248 t.Run(tt.name, func(t *testing.T) {
249 _, err := tt.options.TlsConfig(cr)
250 t.Logf("tlsConfig error: %v", err)
251 require.Error(t, err)
252 })
253 }
254}
255
256// to run this test, set `-args listener` for the test command
257func TestHTTPSServer(t *testing.T) {

Callers

nothing calls this directly

Calls 3

NewCertRegistryFunction · 0.92
TlsConfigMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…