diff --git a/builder/virtualbox/common/step_output_dir_test.go b/builder/virtualbox/common/step_output_dir_test.go index 1e2f05c84..766154ca9 100644 --- a/builder/virtualbox/common/step_output_dir_test.go +++ b/builder/virtualbox/common/step_output_dir_test.go @@ -28,6 +28,7 @@ func TestStepOutputDir_impl(t *testing.T) { func TestStepOutputDir(t *testing.T) { state := testState(t) step := testStepOutputDir(t) + defer os.RemoveAll(step.Path) // Test the run 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 { t.Fatalf("bad: %s", err) } + defer os.RemoveAll(step.Path) // Test the run if action := step.Run(context.Background(), state); action != multistep.ActionHalt {