From f91ac1b61eb7c18773ff01be58a39f49de436585 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Thu, 13 Feb 2025 10:31:53 -0500 Subject: [PATCH] crypto/internal/fips140test: fix TestACVP env vars Fix TestACVP environment construction to include both ACVP_WRAPPER and GODEBUG. Previously we were accidentally overwriting the cmd.Env, stomping the ACVP_WRAPPER env var and replacing it with just the GODEBUG env var. This in turn makes the tests start to fail when the test binary subprocess is invoked without knowing it's fulfilling the role of the wrapper, and not the test driver. Change-Id: Ie6ee30c8b93b2051a671e12aaa63d2116c5eb8c8 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/649016 LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Reviewed-by: Cherry Mui Reviewed-by: Filippo Valsorda Auto-Submit: Filippo Valsorda --- src/crypto/internal/fips140test/acvp_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/crypto/internal/fips140test/acvp_test.go b/src/crypto/internal/fips140test/acvp_test.go index 119fdefc64..ddb234bab6 100644 --- a/src/crypto/internal/fips140test/acvp_test.go +++ b/src/crypto/internal/fips140test/acvp_test.go @@ -2132,8 +2132,10 @@ func TestACVP(t *testing.T) { } cmd = testenv.Command(t, goTool, args...) cmd.Dir = dataDir - cmd.Env = append(os.Environ(), "ACVP_WRAPPER=1") - cmd.Env = append(os.Environ(), "GODEBUG=fips140=on") + cmd.Env = append(os.Environ(), + "ACVP_WRAPPER=1", + "GODEBUG=fips140=on", + ) output, err := cmd.CombinedOutput() if err != nil { t.Fatalf("failed to run acvp tests: %s\n%s", err, string(output)) -- 2.50.0