mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-19 02:49:18 -05:00
When copying test binary, delete first (#19331)
For plugin tests, we copy the test binary. On macOS, if the destination binary already exists, then copying over it will result in an invalid signature. The easiest workaround is to delete the file before copying.
This commit is contained in:
parent
f2a47b0e40
commit
794eb8b2e9
1 changed files with 3 additions and 0 deletions
|
|
@ -526,6 +526,9 @@ func TestAddTestPlugin(t testing.T, c *Core, name string, pluginType consts.Plug
|
|||
|
||||
// Copy over the file to the temp dir
|
||||
dst := filepath.Join(tempDir, fileName)
|
||||
|
||||
// delete the file first to avoid notary failures in macOS
|
||||
_ = os.Remove(dst) // ignore error
|
||||
out, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue