MCPcopy Create free account
hub / github.com/prometheus/common / TestValidTLSConfig

Function TestValidTLSConfig

config/tls_config_test.go:100–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestValidTLSConfig(t *testing.T) {
101 for _, cfg := range expectedTLSConfigs {
102 got, err := LoadTLSConfig("testdata/" + cfg.filename)
103 if err != nil {
104 t.Fatalf("Error parsing %s: %s", cfg.filename, err)
105 }
106 // non-nil functions are never equal.
107 got.GetClientCertificate = nil
108 if !reflect.DeepEqual(got, cfg.config) {
109 t.Fatalf("%v: unexpected config result: \n\n%v\n expected\n\n%v", cfg.filename, got, cfg.config)
110 }
111 }
112}
113
114var invalidTLSConfigs = []struct {
115 filename string

Callers

nothing calls this directly

Calls 1

LoadTLSConfigFunction · 0.85

Tested by

no test coverage detected