]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/amd64: disable FIPS 140-3 mode for TestGoAMD64v1
authorFilippo Valsorda <filippo@golang.org>
Tue, 18 Mar 2025 19:21:51 +0000 (20:21 +0100)
committerGopher Robot <gobot@golang.org>
Tue, 18 Mar 2025 21:04:58 +0000 (14:04 -0700)
TestGoAMD64v1 modifies the binary, which will make the FIPS 140-3
integrity self-check fail. Disable FIPS 140-3 mode when running the
modified binary.

Change-Id: I6a6a46566a38f8c44f996f6e1155dac5f67c56e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/658915
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/compile/internal/amd64/versions_test.go

index 92365fb365efa89863fd34879f9d9a3095ee5c98..15395fc5e5283faec8afa2d7f75c1fdb14060986 100644 (file)
@@ -75,7 +75,8 @@ func TestGoAMD64v1(t *testing.T) {
        cmd := testenv.Command(t, dst.Name())
        testenv.CleanCmdEnv(cmd)
        cmd.Env = append(cmd.Env, "TESTGOAMD64V1=yes")
-       cmd.Env = append(cmd.Env, fmt.Sprintf("GODEBUG=%s", strings.Join(features, ",")))
+       // Disable FIPS 140-3 mode, since it would detect the modified binary.
+       cmd.Env = append(cmd.Env, fmt.Sprintf("GODEBUG=%s,fips140=off", strings.Join(features, ",")))
        out, err := cmd.CombinedOutput()
        if err != nil {
                t.Fatalf("couldn't execute test: %s\n%s", err, out)