From 957cbdbf302750f3fb3467237bebf29d87234208 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Tue, 30 Dec 2014 14:05:00 -0800 Subject: [PATCH] Move InspectExecID test to exec. Docker-DCO-1.1-Signed-off-by: Jessica Frazelle (github: jfrazelle) --- integration-cli/docker_cli_exec_test.go | 35 ++++++++++++++++++++++ integration-cli/docker_cli_inspect_test.go | 35 ---------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/integration-cli/docker_cli_exec_test.go b/integration-cli/docker_cli_exec_test.go index 5dc0e8d71a..0740c7b3e2 100644 --- a/integration-cli/docker_cli_exec_test.go +++ b/integration-cli/docker_cli_exec_test.go @@ -453,3 +453,38 @@ func TestExecCgroup(t *testing.T) { logDone("exec - exec has the container cgroups") } + +func TestInspectExecID(t *testing.T) { + defer deleteAllContainers() + + out, exitCode, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "busybox", "top")) + if exitCode != 0 || err != nil { + t.Fatalf("failed to run container: %s, %v", out, err) + } + id := strings.TrimSuffix(out, "\n") + + out, err = inspectField(id, "ExecIDs") + if err != nil { + t.Fatalf("failed to inspect container: %s, %v", out, err) + } + if out != "" { + t.Fatalf("ExecIDs should be empty, got: %s", out) + } + + exitCode, err = runCommand(exec.Command(dockerBinary, "exec", "-d", id, "ls", "/")) + if exitCode != 0 || err != nil { + t.Fatalf("failed to exec in container: %s, %v", out, err) + } + + out, err = inspectField(id, "ExecIDs") + if err != nil { + t.Fatalf("failed to inspect container: %s, %v", out, err) + } + + out = strings.TrimSuffix(out, "\n") + if out == "[]" || out == "" { + t.Fatalf("ExecIDs should not be empty, got: %s", out) + } + + logDone("inspect - inspect a container with ExecIDs") +} diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index ee69a89a43..cf42217ac8 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -21,38 +21,3 @@ func TestInspectImage(t *testing.T) { logDone("inspect - inspect an image") } - -func TestInspectExecID(t *testing.T) { - defer deleteAllContainers() - - out, exitCode, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "busybox", "top")) - if exitCode != 0 || err != nil { - t.Fatalf("failed to run container: %s, %v", out, err) - } - id := strings.TrimSuffix(out, "\n") - - out, err = inspectField(id, "ExecIDs") - if err != nil { - t.Fatalf("failed to inspect container: %s, %v", out, err) - } - if out != "" { - t.Fatalf("ExecIDs should be empty, got: %s", out) - } - - exitCode, err = runCommand(exec.Command(dockerBinary, "exec", "-d", id, "ls", "/")) - if exitCode != 0 || err != nil { - t.Fatalf("failed to exec in container: %s, %v", out, err) - } - - out, err = inspectField(id, "ExecIDs") - if err != nil { - t.Fatalf("failed to inspect container: %s, %v", out, err) - } - - out = strings.TrimSuffix(out, "\n") - if out == "[]" || out == "" { - t.Fatalf("ExecIDs should not be empty, got: %s", out) - } - - logDone("inspect - inspect a container with ExecIDs") -}