prober: fix test logic (#15952)

Catch failing tests that have no expected error string.

Updates #15912

Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
pull/15972/head
Mike O'Driscoll 7 months ago committed by GitHub
parent 65e005ccaa
commit fccba5a2f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -252,7 +252,7 @@ func TestCRL(t *testing.T) {
"NoCRL",
leafCertParsed,
nil,
"",
"no CRL server presented in leaf cert for",
},
{
"NotBeforeCRLStaplingDate",
@ -276,7 +276,7 @@ func TestCRL(t *testing.T) {
return
}
if err == nil || !strings.Contains(err.Error(), tt.wantErr) {
if err == nil || tt.wantErr == "" || !strings.Contains(err.Error(), tt.wantErr) {
t.Errorf("unexpected error %q; want %q", err, tt.wantErr)
}
})

Loading…
Cancel
Save