diff --git a/src/crypto/internal/fips140test/acvp_test.go b/src/crypto/internal/fips140test/acvp_test.go index e94bab74fd5..6a0b46af2bb 100644 --- a/src/crypto/internal/fips140test/acvp_test.go +++ b/src/crypto/internal/fips140test/acvp_test.go @@ -2146,7 +2146,7 @@ func TestACVP(t *testing.T) { } configPath := filepath.Join(cwd, testConfigFile) t.Logf("running check_expected.go\ncwd: %q\ndata_dir: %q\nconfig: %q\ntool: %q\nmodule-wrapper: %q\n", - cwd, dataDir, configPath, toolPath, os.Args[0]) + cwd, dataDir, configPath, toolPath, testenv.Executable(t)) // Run the check_expected test driver using the acvptool we built, and this test binary as the // module wrapper. The file paths in the config file are specified relative to the dataDir root @@ -2157,7 +2157,7 @@ func TestACVP(t *testing.T) { "-tool", toolPath, // Note: module prefix must match Wrapper value in testConfigFile. - "-module-wrappers", "go:" + os.Args[0], + "-module-wrappers", "go:" + testenv.Executable(t), "-tests", configPath, } cmd = testenv.Command(t, testenv.GoToolPath(t), args...) diff --git a/src/crypto/internal/fips140test/check_test.go b/src/crypto/internal/fips140test/check_test.go index 8aef1f9b9b6..d70ffbb77f7 100644 --- a/src/crypto/internal/fips140test/check_test.go +++ b/src/crypto/internal/fips140test/check_test.go @@ -46,7 +46,7 @@ func TestIntegrityCheckFailure(t *testing.T) { moduleStatus(t) cryptotest.MustSupportFIPS140(t) - bin, err := os.ReadFile(os.Args[0]) + bin, err := os.ReadFile(testenv.Executable(t)) if err != nil { t.Fatal(err) } diff --git a/src/crypto/tls/bogo_shim_test.go b/src/crypto/tls/bogo_shim_test.go index 1b5fc49c4f3..ccac47c2710 100644 --- a/src/crypto/tls/bogo_shim_test.go +++ b/src/crypto/tls/bogo_shim_test.go @@ -577,7 +577,7 @@ func TestBogoSuite(t *testing.T) { "test", ".", fmt.Sprintf("-shim-config=%s", filepath.Join(cwd, "bogo_config.json")), - fmt.Sprintf("-shim-path=%s", os.Args[0]), + fmt.Sprintf("-shim-path=%s", testenv.Executable(t)), "-shim-extra-flags=-bogo-mode", "-allow-unimplemented", "-loose-errors", // TODO(roland): this should be removed eventually