From 6a3910d20adad7013b07b6d9e70eb1c4bcc1c21f Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Mon, 31 Oct 2016 10:15:50 +0000 Subject: [PATCH] Fix backend tests --- probe/docker/controls_test.go | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/probe/docker/controls_test.go b/probe/docker/controls_test.go index 61b7baf43..d87cdffce 100644 --- a/probe/docker/controls_test.go +++ b/probe/docker/controls_test.go @@ -66,20 +66,33 @@ func TestPipes(t *testing.T) { return ok }) - for _, tc := range []string{ - docker.AttachContainer, - docker.ExecContainer, + for _, want := range []struct { + control string + response xfer.Response + }{ + { + control: docker.AttachContainer, + response: xfer.Response{ + Pipe: "pipeid", + RawTTY: true, + }, + }, + + { + control: docker.ExecContainer, + response: xfer.Response{ + Pipe: "pipeid", + RawTTY: true, + ResizeTTYControl: docker.ResizeExecTTY, + }, + }, } { result := hr.HandleControlRequest(xfer.Request{ - Control: tc, + Control: want.control, NodeID: report.MakeContainerNodeID("ping"), }) - want := xfer.Response{ - Pipe: "pipeid", - RawTTY: true, - } - if !reflect.DeepEqual(result, want) { - t.Errorf("diff %s: %s", tc, test.Diff(want, result)) + if !reflect.DeepEqual(result, want.response) { + t.Errorf("diff %s: %s", want.control, test.Diff(want, result)) } } })