Fix TestContainerNoBinaryExists on windows

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-08-11 11:57:00 -07:00
parent 104a8088ca
commit b02e9a844e
3 changed files with 15 additions and 5 deletions

View File

@@ -805,7 +805,7 @@ func TestContainerNoBinaryExists(t *testing.T) {
}
}
spec, err := generateSpec(withImageConfig(ctx, image), withProcessArgs("nothing"))
spec, err := generateSpec(withImageConfig(ctx, image), WithProcessArgs("nothing"))
if err != nil {
t.Error(err)
return
@@ -821,11 +821,12 @@ func TestContainerNoBinaryExists(t *testing.T) {
switch runtime.GOOS {
case "windows":
if err != nil {
t.Errorf("failed to create task %v", err)
t.Fatalf("failed to create task %v", err)
}
if err := task.Start(ctx); err != nil {
defer task.Delete(ctx)
if err := task.Start(ctx); err == nil {
task.Kill(ctx, syscall.SIGKILL)
t.Error("task.Start() should return an error when binary does not exist")
task.Delete(ctx)
}
default:
if err == nil {