Close files to actually fix windows
This commit is contained in:
parent
4eac4fbf4c
commit
b2fe329011
1 changed files with 4 additions and 3 deletions
|
|
@ -71,12 +71,13 @@ func TestAutomaticSSHKeyPairs(t *testing.T) {
|
|||
ConfigDir: dir,
|
||||
}
|
||||
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
for _, file := range tt.existingFiles {
|
||||
if _, err := os.Create(filepath.Join(dir, file)); err != nil {
|
||||
f, err := os.Create(filepath.Join(dir, file))
|
||||
if err != nil {
|
||||
t.Errorf("Failed to setup test files: %v", err)
|
||||
}
|
||||
// If the file isn't closed here windows will have errors about file already in use
|
||||
f.Close()
|
||||
}
|
||||
|
||||
keyPair, err := setupAutomaticSSHKeys(sshContext)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue