Use RemoveAll to cleanup test directories

Test directories in Airship have subdirectories now, so removing them
with os.Remove() will cause tests to fail. This change updates the
cleanup logic to use os.RemoveAll() for directories with children.

Change-Id: I1e03cd0335fc1a30610e06d50a701db2b1b571c9
Signed-off-by: Drew Walters <andrew.walters@att.com>
This commit is contained in:
Drew Walters 2020-02-17 16:20:31 -06:00
parent 90f025e64d
commit f8a9a471d3

View File

@ -128,7 +128,7 @@ func makeTestDir(t *testing.T) string {
}
func deleteTestDir(t *testing.T, path string) {
err := os.Remove(path)
err := os.RemoveAll(path)
require.NoError(t, err)
}