From 4774aa81b38d2f843ca00b884246c6d1f6067681 Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Mon, 9 Mar 2020 15:08:31 -0600 Subject: [PATCH] compliance: don't leak test directory Signed-off-by: Tycho Andersen --- pkg/compliance/v1_0_0/check_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/compliance/v1_0_0/check_test.go b/pkg/compliance/v1_0_0/check_test.go index d3f034b2..4a0ab592 100644 --- a/pkg/compliance/v1_0_0/check_test.go +++ b/pkg/compliance/v1_0_0/check_test.go @@ -5,6 +5,7 @@ import ( "context" "fmt" "io/ioutil" + "os" "testing" "time" @@ -56,7 +57,6 @@ func startServer() (*api.Controller, string) { panic(err) } - //defer os.RemoveAll(dir) ctrl.Config.Storage.RootDirectory = dir go func() { // this blocks @@ -80,4 +80,5 @@ func startServer() (*api.Controller, string) { func stopServer(ctrl *api.Controller) { ctrl.Server.Shutdown(context.Background()) + os.RemoveAll(ctrl.Config.Storage.RootDirectory) }