From 96adb4a9d1577b1c22344983d0c46ea101202a82 Mon Sep 17 00:00:00 2001 From: DanHam Date: Wed, 25 Apr 2018 12:30:54 +0100 Subject: [PATCH] Remove tmp files created by builder/alicloud/ecs tests --- builder/alicloud/ecs/run_config_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builder/alicloud/ecs/run_config_test.go b/builder/alicloud/ecs/run_config_test.go index d62f60b38..fe499e21f 100644 --- a/builder/alicloud/ecs/run_config_test.go +++ b/builder/alicloud/ecs/run_config_test.go @@ -2,6 +2,7 @@ package ecs import ( "io/ioutil" + "os" "testing" "github.com/hashicorp/packer/helper/communicator" @@ -68,6 +69,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" @@ -92,6 +94,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()