From 4de1766f40d8449981eb7c2022288fe4a9c9a840 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Fri, 24 Jun 2022 09:43:42 -0700 Subject: [PATCH] Fix TLS tests and allow older test certs for now Signed-off-by: Derek Collison --- scripts/runTestsOnTravis.sh | 7 +++++++ server/leafnode_test.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/runTestsOnTravis.sh b/scripts/runTestsOnTravis.sh index 304e21f1..12b0bc6d 100755 --- a/scripts/runTestsOnTravis.sh +++ b/scripts/runTestsOnTravis.sh @@ -15,6 +15,7 @@ if [ "$1" = "compile" ]; then find . -type f -name "*.go" | xargs misspell -error -locale US; staticcheck $GO_LIST if [ "$TRAVIS_TAG" != "" ]; then + export GODEBUG="x509sha1=1" go test -race -v -run=TestVersionMatchesTag ./server -count=1 -vet=off fi @@ -23,6 +24,7 @@ elif [ "$1" = "no_race_tests" ]; then # Run tests without the `-race` flag. By convention, those tests start # with `TestNoRace`. + export GODEBUG="x509sha1=1" go test -v -p=1 -run=TestNoRace ./... -count=1 -vet=off -timeout=30m -failfast elif [ "$1" = "js_tests" ]; then @@ -32,6 +34,7 @@ elif [ "$1" = "js_tests" ]; then # tests by using the `skip_js_cluster_tests` and `skip_js_super_cluster_tests` # build tags. + export GODEBUG="x509sha1=1" go test -race -v -run=TestJetStream ./server -tags=skip_js_cluster_tests,skip_js_super_cluster_tests -count=1 -vet=off -timeout=30m -failfast elif [ "$1" = "js_cluster_tests" ]; then @@ -39,6 +42,7 @@ elif [ "$1" = "js_cluster_tests" ]; then # Run JetStream clustered tests. By convention, all JS cluster tests # start with `TestJetStreamCluster`. + export GODEBUG="x509sha1=1" go test -race -v -run=TestJetStreamCluster ./server -count=1 -vet=off -timeout=30m -failfast elif [ "$1" = "js_super_cluster_tests" ]; then @@ -46,6 +50,7 @@ elif [ "$1" = "js_super_cluster_tests" ]; then # Run JetStream super clustered tests. By convention, all JS super cluster # tests with `TestJetStreamSuperCluster`. + export GODEBUG="x509sha1=1" go test -race -v -run=TestJetStreamSuperCluster ./server -count=1 -vet=off -timeout=30m -failfast elif [ "$1" = "srv_pkg_non_js_tests" ]; then @@ -53,12 +58,14 @@ elif [ "$1" = "srv_pkg_non_js_tests" ]; then # Run all non JetStream tests in the server package. We exclude the # JS tests by using the `skip_js_tests` build tag. + export GODEBUG="x509sha1=1" go test -race -v -p=1 ./server/... -tags=skip_js_tests -count=1 -vet=off -timeout=30m -failfast elif [ "$1" = "non_srv_pkg_tests" ]; then # Run all tests of all non server package. + export GODEBUG="x509sha1=1" go test -race -v -p=1 $(go list ./... | grep -v "/server") -count=1 -vet=off -timeout=30m -failfast fi diff --git a/server/leafnode_test.go b/server/leafnode_test.go index 3ddde95b..33519bd1 100644 --- a/server/leafnode_test.go +++ b/server/leafnode_test.go @@ -2610,7 +2610,7 @@ func TestLeafNodeTLSConfigReload(t *testing.T) { // Wait for the error select { case err := <-lg.errCh: - if !strings.Contains(err, "unknown") { + if !strings.Contains(err, "unknown") && !strings.Contains(err, "broken") { t.Fatalf("Unexpected error: %v", err) } case <-time.After(2 * time.Second):