remove deprecated cmd function in integration-cli

Remove deprecated cmd function in integration-cli
and change cmd to dockerCmd in all test files

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: 7fbbd515b1018721e91199960d1933383a8262a1
Component: engine
This commit is contained in:
Daehyeok Mun
2014-11-25 00:32:38 +09:00
parent 8bf9a8d42c
commit 09af87d0eb
8 changed files with 78 additions and 83 deletions

View File

@ -12,8 +12,8 @@ import (
func TestStartAttachReturnsOnError(t *testing.T) {
defer deleteAllContainers()
cmd(t, "run", "-d", "--name", "test", "busybox")
cmd(t, "stop", "test")
dockerCmd(t, "run", "-d", "--name", "test", "busybox")
dockerCmd(t, "stop", "test")
// Expect this to fail because the above container is stopped, this is what we want
if _, err := runCommand(exec.Command(dockerBinary, "run", "-d", "--name", "test2", "--link", "test:test", "busybox")); err == nil {
@ -73,7 +73,7 @@ func TestStartRecordError(t *testing.T) {
defer deleteAllContainers()
// when container runs successfully, we should not have state.Error
cmd(t, "run", "-d", "-p", "9999:9999", "--name", "test", "busybox", "top")
dockerCmd(t, "run", "-d", "-p", "9999:9999", "--name", "test", "busybox", "top")
stateErr, err := inspectField("test", "State.Error")
if err != nil {
t.Fatalf("Failed to inspect %q state's error, got error %q", "test", err)
@ -97,8 +97,8 @@ func TestStartRecordError(t *testing.T) {
}
// Expect the conflict to be resolved when we stop the initial container
cmd(t, "stop", "test")
cmd(t, "start", "test2")
dockerCmd(t, "stop", "test")
dockerCmd(t, "start", "test2")
stateErr, err = inspectField("test2", "State.Error")
if err != nil {
t.Fatalf("Failed to inspect %q state's error, got error %q", "test", err)
@ -115,7 +115,7 @@ func TestStartVolumesFromFailsCleanly(t *testing.T) {
defer deleteAllContainers()
// Create the first data volume
cmd(t, "run", "-d", "--name", "data_before", "-v", "/foo", "busybox")
dockerCmd(t, "run", "-d", "--name", "data_before", "-v", "/foo", "busybox")
// Expect this to fail because the data test after contaienr doesn't exist yet
if _, err := runCommand(exec.Command(dockerBinary, "run", "-d", "--name", "consumer", "--volumes-from", "data_before", "--volumes-from", "data_after", "busybox")); err == nil {
@ -123,13 +123,13 @@ func TestStartVolumesFromFailsCleanly(t *testing.T) {
}
// Create the second data volume
cmd(t, "run", "-d", "--name", "data_after", "-v", "/bar", "busybox")
dockerCmd(t, "run", "-d", "--name", "data_after", "-v", "/bar", "busybox")
// Now, all the volumes should be there
cmd(t, "start", "consumer")
dockerCmd(t, "start", "consumer")
// Check that we have the volumes we want
out, _, _ := cmd(t, "inspect", "--format='{{ len .Volumes }}'", "consumer")
out, _, _ := dockerCmd(t, "inspect", "--format='{{ len .Volumes }}'", "consumer")
n_volumes := strings.Trim(out, " \r\n'")
if n_volumes != "2" {
t.Fatalf("Missing volumes: expected 2, got %s", n_volumes)