Make a new dir per test to work around windows failures
This commit is contained in:
parent
b5348f661e
commit
4eac4fbf4c
1 changed files with 6 additions and 13 deletions
|
|
@ -26,12 +26,6 @@ func TestPendingOperationDisallowsSSH(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAutomaticSSHKeyPairs(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
|
||||
sshContext := ssh.Context{
|
||||
ConfigDir: dir,
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
// These files exist when calling setupAutomaticSSHKeys
|
||||
existingFiles []string
|
||||
|
|
@ -71,15 +65,14 @@ func TestAutomaticSSHKeyPairs(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
err := os.RemoveAll(dir)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to clean test directory: %v", err)
|
||||
}
|
||||
err = os.MkdirAll(dir, 0711)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to set up test directory: %v", err)
|
||||
dir := t.TempDir()
|
||||
|
||||
sshContext := ssh.Context{
|
||||
ConfigDir: dir,
|
||||
}
|
||||
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
for _, file := range tt.existingFiles {
|
||||
if _, err := os.Create(filepath.Join(dir, file)); err != nil {
|
||||
t.Errorf("Failed to setup test files: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue