Skip to content

Commit

Permalink
e2e/tls: fix flag handling, tighten error expectation
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
  • Loading branch information
srenatus authored and tsandall committed Aug 30, 2021
1 parent 763252e commit df2c0b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/tls/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tls
import (
"crypto/tls"
"crypto/x509"
"errors"
"flag"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -32,7 +33,7 @@ func fatal(err interface{}) {
}

func TestMain(m *testing.M) {
minTLSVersion := flag.String("--min-tls-version", "1.2", "minimum TLS Version")
minTLSVersion := flag.String("min-tls-version", "1.2", "minimum TLS Version")
TLSVersion := minTLSVersions[*minTLSVersion]
flag.Parse()

Expand Down Expand Up @@ -135,7 +136,10 @@ func TestNotDefaultTLSVersion(t *testing.T) {
if err == nil {
t.Error("expected err - protocol version not supported, got nil")
}

var exp *url.Error
if !errors.As(err, &exp) {
t.Errorf("expected err type %[1]T, got %[2]T: %[2]v", exp, err)
}
})

t.Run("server started with min TLS Version 1.3, client connecting supported TLS version", func(t *testing.T) {
Expand Down

0 comments on commit df2c0b4

Please sign in to comment.