mirror of
https://github.com/ribbybibby/ssl_exporter.git
synced 2024-11-24 08:22:17 +02:00
Add a few tests around the scheme parsing
This commit is contained in:
parent
be072f46c9
commit
f20e251345
@ -60,6 +60,12 @@ func TestProbeHandler(t *testing.T) {
|
||||
{uri: "client.badssl.com:443", ok: true, tlsConfig: &tls.Config{Certificates: []tls.Certificate{certificate}}},
|
||||
// Test with an empty root CA bundle
|
||||
{uri: "google.com:443", ok: false, tlsConfig: &tls.Config{RootCAs: emptyRootCAs}},
|
||||
// Test with a https scheme
|
||||
{uri: "https://google.com", ok: true, tlsConfig: &tls.Config{}},
|
||||
// Test with a https scheme and port
|
||||
{uri: "https://google.com:443", ok: true, tlsConfig: &tls.Config{}},
|
||||
// Test with no scheme or port
|
||||
{uri: "google.com", ok: true, tlsConfig: &tls.Config{}},
|
||||
}
|
||||
|
||||
fmt.Println("Note: The error logs in these tests are expected. One of the important tests is that we return the expected body, even in the face of errors.")
|
||||
|
Loading…
Reference in New Issue
Block a user