From 177a2f5946623a4d4f90f5a227e57211eed6ade3 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Mon, 4 Nov 2013 12:23:35 -0800 Subject: [PATCH] add CmdLogs test --- commands_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/commands_test.go b/commands_test.go index 67eae04b19..2c0e319787 100644 --- a/commands_test.go +++ b/commands_test.go @@ -645,3 +645,19 @@ func TestRunAutoRemove(t *testing.T) { t.Fatalf("failed to remove container automatically: container %s still exists", temporaryContainerID) } } + +func TestCmdLogs(t *testing.T) { + cli := NewDockerCli(nil, ioutil.Discard, ioutil.Discard, testDaemonProto, testDaemonAddr) + defer cleanup(globalRuntime) + + if err := cli.CmdRun(unitTestImageID, "sh", "-c", "ls -l"); err != nil { + t.Fatal(err) + } + if err := cli.CmdRun("-t", unitTestImageID, "sh", "-c", "ls -l"); err != nil { + t.Fatal(err) + } + + if err := cli.CmdLogs(globalRuntime.List()[0].ID); err != nil { + t.Fatal(err) + } +}