From ac36c986e008e8e4e4f56fe510ba7ab0dab0c778 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Fri, 15 Feb 2013 12:17:58 -0800 Subject: [PATCH] run as user tests: Check the exit codes --- container_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/container_test.go b/container_test.go index d21db132a9..17ec85c6b1 100644 --- a/container_test.go +++ b/container_test.go @@ -311,7 +311,7 @@ func TestUser(t *testing.T) { } defer docker.Destroy(container) output, err = container.Output() - if err != nil { + if err != nil || container.State.ExitCode != 0 { t.Fatal(err) } if !strings.Contains(string(output), "uid=0(root) gid=0(root)") { @@ -328,12 +328,12 @@ func TestUser(t *testing.T) { User: "0", }, ) - if err != nil { + if err != nil || container.State.ExitCode != 0 { t.Fatal(err) } defer docker.Destroy(container) output, err = container.Output() - if err != nil { + if err != nil || container.State.ExitCode != 0 { t.Fatal(err) } if !strings.Contains(string(output), "uid=0(root) gid=0(root)") { @@ -355,7 +355,7 @@ func TestUser(t *testing.T) { } defer docker.Destroy(container) output, err = container.Output() - if err != nil { + if err != nil || container.State.ExitCode != 0 { t.Fatal(err) } if !strings.Contains(string(output), "uid=1(daemon) gid=1(daemon)") { @@ -377,7 +377,7 @@ func TestUser(t *testing.T) { } defer docker.Destroy(container) output, err = container.Output() - if err != nil { + if err != nil || container.State.ExitCode != 0 { t.Fatal(err) } if !strings.Contains(string(output), "uid=1(daemon) gid=1(daemon)") {