Skip to content

Commit b325151

Browse files
qmuntalgopherbot
authored andcommitted
cmd/cgo/internal/testsanitizers: skip asan tests when FIPS140 mode is on
Executing "GODEBUG=fips140=on go test -run TestASAN ./cmd/cgo/internal/testsanitizers" fails because FIPS 140 mode is incompatible with ASAN. Change-Id: I1a489f3398bbabf597fe7ffc0982c86c3b86e07e Reviewed-on: https://go-review.googlesource.com/c/go/+/685495 Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Quim Muntal <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 15d9fe4 commit b325151

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cmd/cgo/internal/testsanitizers/asan_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package sanitizers_test
88

99
import (
1010
"bytes"
11+
"crypto/fips140"
1112
"fmt"
1213
"internal/platform"
1314
"internal/testenv"
@@ -157,6 +158,10 @@ func mustHaveASAN(t *testing.T) *config {
157158
t.Skipf("skipping on %s/%s; -asan option is not supported.", goos, goarch)
158159
}
159160

161+
if fips140.Enabled() {
162+
t.Skipf("skipping with FIPS 140 mode; -asan option is not supported.")
163+
}
164+
160165
// The current implementation is only compatible with the ASan library from version
161166
// v7 to v9 (See the description in src/runtime/asan/asan.go). Therefore, using the
162167
// -asan option must use a compatible version of ASan library, which requires that

0 commit comments

Comments
 (0)