Remove tmp directories created by builder/virtualbox/common tests

This commit is contained in:
DanHam 2018-04-25 15:39:20 +01:00
parent 475b3978d2
commit 13b7078cb0
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ func TestStepOutputDir_impl(t *testing.T) {
func TestStepOutputDir(t *testing.T) { func TestStepOutputDir(t *testing.T) {
state := testState(t) state := testState(t)
step := testStepOutputDir(t) step := testStepOutputDir(t)
defer os.RemoveAll(step.Path)
// Test the run // Test the run
if action := step.Run(context.Background(), state); action != multistep.ActionContinue { if action := step.Run(context.Background(), state); action != multistep.ActionContinue {
@ -55,6 +56,7 @@ func TestStepOutputDir_exists(t *testing.T) {
if err := os.MkdirAll(step.Path, 0755); err != nil { if err := os.MkdirAll(step.Path, 0755); err != nil {
t.Fatalf("bad: %s", err) t.Fatalf("bad: %s", err)
} }
defer os.RemoveAll(step.Path)
// Test the run // Test the run
if action := step.Run(context.Background(), state); action != multistep.ActionHalt { if action := step.Run(context.Background(), state); action != multistep.ActionHalt {