diff --git a/builder/amazon/common/run_config_test.go b/builder/amazon/common/run_config_test.go index 7cf42ded1..a88730e82 100644 --- a/builder/amazon/common/run_config_test.go +++ b/builder/amazon/common/run_config_test.go @@ -119,6 +119,7 @@ func TestRunConfigPrepare_UserData(t *testing.T) { if err != nil { t.Fatalf("err: %s", err) } + defer os.Remove(tf.Name()) defer tf.Close() c.UserData = "foo" @@ -143,6 +144,7 @@ func TestRunConfigPrepare_UserDataFile(t *testing.T) { if err != nil { t.Fatalf("err: %s", err) } + defer os.Remove(tf.Name()) defer tf.Close() c.UserDataFile = tf.Name()