libcontainer: make tests to make sure we don't mess with \r

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2016-10-24 22:22:59 +11:00
parent eea28f480d
commit fd7ab60a70
No known key found for this signature in database
GPG Key ID: 9E18AA267DDB8DB4
1 changed files with 7 additions and 1 deletions

View File

@ -61,6 +61,9 @@ func TestExecIn(t *testing.T) {
if !strings.Contains(out, "cat") || !strings.Contains(out, "ps") { if !strings.Contains(out, "cat") || !strings.Contains(out, "ps") {
t.Fatalf("unexpected running process, output %q", out) 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) { func TestExecInUsernsRlimit(t *testing.T) {
@ -296,9 +299,12 @@ func TestExecInTTY(t *testing.T) {
waitProcess(process, t) waitProcess(process, t)
out := stdout.String() 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) 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) { func TestExecInEnvironment(t *testing.T) {