test: update tests to properly use AllocDir

Also use t.TempDir when possible.
This commit is contained in:
Michael Schurter
2021-10-18 10:32:41 -07:00
parent f41b625532
commit eeb1da8a2e
10 changed files with 45 additions and 42 deletions

View File

@@ -64,7 +64,7 @@ func testExecutorCommandWithChroot(t *testing.T) *testExecCmd {
task := alloc.Job.TaskGroups[0].Tasks[0]
taskEnv := taskenv.NewBuilder(mock.Node(), alloc, task, "global").Build()
allocDir := allocdir.NewAllocDir(testlog.HCLogger(t), t.TempDir(), alloc.ID)
allocDir := allocdir.NewAllocDir(testlog.HCLogger(t), os.TempDir(), alloc.ID)
if err := allocDir.Build(); err != nil {
t.Fatalf("AllocDir.Build() failed: %v", err)
}