using new ctx instead of getting both params back

This commit is contained in:
Cameron Davison
2017-01-09 15:55:50 -06:00
parent 2d6e7e7b57
commit d4b8fc953a

View File

@@ -703,14 +703,13 @@ func TestDockerDriver_ForcePull_IsInvalidConfig(t *testing.T) {
task, _, _ := dockerTask()
task.Config["force_pull"] = "nothing"
driverCtx, execCtx := testDriverContexts(task)
driverCtx.config.Options = map[string]string{"docker.cleanup.image": "false"}
driver := NewDockerDriver(driverCtx)
if err := driver.Prestart(execCtx, task); err == nil {
execCtx.AllocDir.Destroy()
ctx := testDriverContexts(t, task)
defer ctx.AllocDir.Destroy()
ctx.DriverCtx.config.Options = map[string]string{"docker.cleanup.image": "false"}
driver := NewDockerDriver(ctx.DriverCtx)
if err := driver.Prestart(ctx.ExecCtx, task); err == nil {
t.Fatalf("error expected in prestart")
} else {
execCtx.AllocDir.Destroy()
}
}