From fd7ab60a70d20025deef869959de2305910b288e Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Mon, 24 Oct 2016 22:22:59 +1100 Subject: [PATCH] libcontainer: make tests to make sure we don't mess with \r Signed-off-by: Aleksa Sarai --- libcontainer/integration/execin_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libcontainer/integration/execin_test.go b/libcontainer/integration/execin_test.go index 174b5f06..f25ef357 100644 --- a/libcontainer/integration/execin_test.go +++ b/libcontainer/integration/execin_test.go @@ -61,6 +61,9 @@ func TestExecIn(t *testing.T) { if !strings.Contains(out, "cat") || !strings.Contains(out, "ps") { t.Fatalf("unexpected running process, output %q", out) } + if strings.Contains(out, "\r") { + t.Fatalf("unexpected carriage-return in output") + } } func TestExecInUsernsRlimit(t *testing.T) { @@ -296,9 +299,12 @@ func TestExecInTTY(t *testing.T) { waitProcess(process, t) out := stdout.String() - if !strings.Contains(out, "cat") || !strings.Contains(string(out), "ps") { + if !strings.Contains(out, "cat") || !strings.Contains(out, "ps") { t.Fatalf("unexpected running process, output %q", out) } + if strings.Contains(out, "\r") { + t.Fatalf("unexpected carriage-return in output") + } } func TestExecInEnvironment(t *testing.T) {