Merge pull request #8134 from LK4D4/prefix_naming_cli

Prefix naming integration-cli tests
This commit is contained in:
Jessie Frazelle 2014-09-19 11:54:04 -07:00
commit a8e964ebb2
13 changed files with 128 additions and 128 deletions

View file

@ -9,7 +9,7 @@ import (
"time"
)
func TestGetEventsLineDelim(t *testing.T) {
func TestEventsApiGetLineDelim(t *testing.T) {
name := "testimageevents"
defer deleteImages(name)
_, err := buildImage(name,

View file

@ -7,7 +7,7 @@ import (
"testing"
)
func TestInspectContainerResponse(t *testing.T) {
func TestInspectApiContainerResponse(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "true")
out, _, err := runCommandWithOutput(runCmd)
errorOut(err, t, fmt.Sprintf("failed to create a container: %v %v", out, err))

View file

@ -11,7 +11,7 @@ import (
const attachWait = 5 * time.Second
func TestMultipleAttachRestart(t *testing.T) {
func TestAttachMultipleAndRestart(t *testing.T) {
defer deleteAllContainers()
endGroup := &sync.WaitGroup{}

View file

@ -59,7 +59,7 @@ func TestBuildSixtySteps(t *testing.T) {
logDone("build - build an image with sixty build steps")
}
func TestAddSingleFileToRoot(t *testing.T) {
func TestBuildAddSingleFileToRoot(t *testing.T) {
testDirName := "SingleFileToRoot"
sourceDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd", testDirName)
buildDirectory, err := ioutil.TempDir("", "test-build-add")
@ -89,7 +89,7 @@ func TestAddSingleFileToRoot(t *testing.T) {
}
// Issue #3960: "ADD src ." hangs
func TestAddSingleFileToWorkdir(t *testing.T) {
func TestBuildAddSingleFileToWorkdir(t *testing.T) {
testDirName := "SingleFileToWorkdir"
sourceDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd", testDirName)
buildDirectory, err := ioutil.TempDir("", "test-build-add")
@ -134,7 +134,7 @@ func TestAddSingleFileToWorkdir(t *testing.T) {
logDone("build - add single file to workdir")
}
func TestAddSingleFileToExistDir(t *testing.T) {
func TestBuildAddSingleFileToExistDir(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd")
out, exitCode, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testaddimg", "SingleFileToExistDir")
errorOut(err, t, fmt.Sprintf("build failed to complete: %v %v", out, err))
@ -148,7 +148,7 @@ func TestAddSingleFileToExistDir(t *testing.T) {
logDone("build - add single file to existing dir")
}
func TestMultipleFiles(t *testing.T) {
func TestBuildCopyAddMultipleFiles(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestCopy")
out, exitCode, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testaddimg", "MultipleFiles")
errorOut(err, t, fmt.Sprintf("build failed to complete: %v %v", out, err))
@ -162,7 +162,7 @@ func TestMultipleFiles(t *testing.T) {
logDone("build - mulitple file copy/add tests")
}
func TestAddMultipleFilesToFile(t *testing.T) {
func TestBuildAddMultipleFilesToFile(t *testing.T) {
name := "testaddmultiplefilestofile"
defer deleteImages(name)
ctx, err := fakeContext(`FROM scratch
@ -185,7 +185,7 @@ func TestAddMultipleFilesToFile(t *testing.T) {
logDone("build - multiple add files to file")
}
func TestCopyMultipleFilesToFile(t *testing.T) {
func TestBuildCopyMultipleFilesToFile(t *testing.T) {
name := "testcopymultiplefilestofile"
defer deleteImages(name)
ctx, err := fakeContext(`FROM scratch
@ -208,7 +208,7 @@ func TestCopyMultipleFilesToFile(t *testing.T) {
logDone("build - multiple copy files to file")
}
func TestAddSingleFileToNonExistDir(t *testing.T) {
func TestBuildAddSingleFileToNonExistDir(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd")
out, exitCode, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testaddimg", "SingleFileToNonExistDir")
errorOut(err, t, fmt.Sprintf("build failed to complete: %v %v", out, err))
@ -222,7 +222,7 @@ func TestAddSingleFileToNonExistDir(t *testing.T) {
logDone("build - add single file to non-existing dir")
}
func TestAddDirContentToRoot(t *testing.T) {
func TestBuildAddDirContentToRoot(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd")
out, exitCode, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testaddimg", "DirContentToRoot")
errorOut(err, t, fmt.Sprintf("build failed to complete: %v %v", out, err))
@ -236,7 +236,7 @@ func TestAddDirContentToRoot(t *testing.T) {
logDone("build - add directory contents to root")
}
func TestAddDirContentToExistDir(t *testing.T) {
func TestBuildAddDirContentToExistDir(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd")
out, exitCode, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testaddimg", "DirContentToExistDir")
errorOut(err, t, fmt.Sprintf("build failed to complete: %v %v", out, err))
@ -250,7 +250,7 @@ func TestAddDirContentToExistDir(t *testing.T) {
logDone("build - add directory contents to existing dir")
}
func TestAddWholeDirToRoot(t *testing.T) {
func TestBuildAddWholeDirToRoot(t *testing.T) {
testDirName := "WholeDirToRoot"
sourceDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd", testDirName)
buildDirectory, err := ioutil.TempDir("", "test-build-add")
@ -283,7 +283,7 @@ func TestAddWholeDirToRoot(t *testing.T) {
logDone("build - add whole directory to root")
}
func TestAddEtcToRoot(t *testing.T) {
func TestBuildAddEtcToRoot(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd")
out, exitCode, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testaddimg", "EtcToRoot")
errorOut(err, t, fmt.Sprintf("build failed to complete: %v %v", out, err))
@ -1384,11 +1384,11 @@ func testContextTar(t *testing.T, compression archive.Compression) {
logDone(fmt.Sprintf("build - build an image with a context tar, compression: %v", compression))
}
func TestContextTarGzip(t *testing.T) {
func TestBuildContextTarGzip(t *testing.T) {
testContextTar(t, archive.Gzip)
}
func TestContextTarNoCompression(t *testing.T) {
func TestBuildContextTarNoCompression(t *testing.T) {
testContextTar(t, archive.Uncompressed)
}
@ -1747,7 +1747,7 @@ docker.com>"
logDone("build - validate escaping whitespace")
}
func TestDockerignore(t *testing.T) {
func TestBuildDockerignore(t *testing.T) {
name := "testbuilddockerignore"
defer deleteImages(name)
dockerfile := `
@ -1778,7 +1778,7 @@ func TestDockerignore(t *testing.T) {
logDone("build - test .dockerignore")
}
func TestDockerignoringDockerfile(t *testing.T) {
func TestBuildDockerignoringDockerfile(t *testing.T) {
name := "testbuilddockerignoredockerfile"
defer deleteImages(name)
dockerfile := `
@ -1797,7 +1797,7 @@ func TestDockerignoringDockerfile(t *testing.T) {
logDone("build - test .dockerignore of Dockerfile")
}
func TestDockerignoringWholeDir(t *testing.T) {
func TestBuildDockerignoringWholeDir(t *testing.T) {
name := "testbuilddockerignorewholedir"
defer deleteImages(name)
dockerfile := `

View file

@ -9,7 +9,7 @@ import (
)
// Make sure we can create a simple container with some args
func TestDockerCreateArgs(t *testing.T) {
func TestCreateArgs(t *testing.T) {
runCmd := exec.Command(dockerBinary, "create", "busybox", "command", "arg1", "arg2", "arg with space")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
errorOut(err, t, out)
@ -57,7 +57,7 @@ func TestDockerCreateArgs(t *testing.T) {
}
// Make sure we can set hostconfig options too
func TestDockerCreateHostConfig(t *testing.T) {
func TestCreateHostConfig(t *testing.T) {
runCmd := exec.Command(dockerBinary, "create", "-P", "busybox", "echo")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
errorOut(err, t, out)
@ -95,7 +95,7 @@ func TestDockerCreateHostConfig(t *testing.T) {
}
// "test123" should be printed by docker create + start
func TestDockerCreateEchoStdout(t *testing.T) {
func TestCreateEchoStdout(t *testing.T) {
runCmd := exec.Command(dockerBinary, "create", "busybox", "echo", "test123")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
errorOut(err, t, out)

View file

@ -9,7 +9,7 @@ import (
"time"
)
func TestCLIGetEventsUntag(t *testing.T) {
func TestEventsUntag(t *testing.T) {
out, _, _ := cmd(t, "images", "-q")
image := strings.Split(out, "\n")[0]
cmd(t, "tag", image, "utest:tag1")
@ -31,7 +31,7 @@ func TestCLIGetEventsUntag(t *testing.T) {
logDone("events - untags are logged")
}
func TestCLIGetEventsPause(t *testing.T) {
func TestEventsPause(t *testing.T) {
out, _, _ := cmd(t, "images", "-q")
image := strings.Split(out, "\n")[0]
cmd(t, "run", "-d", "--name", "testeventpause", image, "sleep", "2")
@ -57,7 +57,7 @@ func TestCLIGetEventsPause(t *testing.T) {
logDone("events - pause/unpause is logged")
}
func TestCLILimitEvents(t *testing.T) {
func TestEventsLimit(t *testing.T) {
for i := 0; i < 30; i++ {
cmd(t, "run", "busybox", "echo", strconv.Itoa(i))
}
@ -71,7 +71,7 @@ func TestCLILimitEvents(t *testing.T) {
logDone("events - limited to 64 entries")
}
func TestCLIGetEventsContainerEvents(t *testing.T) {
func TestEventsContainerEvents(t *testing.T) {
cmd(t, "run", "--rm", "busybox", "true")
eventsCmd := exec.Command(dockerBinary, "events", "--since=0", fmt.Sprintf("--until=%d", time.Now().Unix()))
out, exitCode, err := runCommandWithOutput(eventsCmd)
@ -103,7 +103,7 @@ func TestCLIGetEventsContainerEvents(t *testing.T) {
logDone("events - container create, start, die, destroy is logged")
}
func TestCLIGetEventsImageUntagDelete(t *testing.T) {
func TestEventsImageUntagDelete(t *testing.T) {
name := "testimageevents"
defer deleteImages(name)
_, err := buildImage(name,

View file

@ -11,7 +11,7 @@ import (
"github.com/docker/docker/pkg/iptables"
)
func TestEtcHostsRegularFile(t *testing.T) {
func TestLinksEtcHostsRegularFile(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
errorOut(err, t, out)
@ -25,7 +25,7 @@ func TestEtcHostsRegularFile(t *testing.T) {
logDone("link - /etc/hosts is a regular file")
}
func TestEtcHostsContentMatch(t *testing.T) {
func TestLinksEtcHostsContentMatch(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--net=host", "busybox", "cat", "/etc/hosts")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
errorOut(err, t, out)
@ -44,7 +44,7 @@ func TestEtcHostsContentMatch(t *testing.T) {
logDone("link - /etc/hosts matches hosts copy")
}
func TestPingUnlinkedContainers(t *testing.T) {
func TestLinksPingUnlinkedContainers(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--rm", "busybox", "sh", "-c", "ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1")
exitCode, err := runCommand(runCmd)
@ -57,7 +57,7 @@ func TestPingUnlinkedContainers(t *testing.T) {
logDone("links - ping unlinked container")
}
func TestPingLinkedContainers(t *testing.T) {
func TestLinksPingLinkedContainers(t *testing.T) {
var out string
out, _, _ = cmd(t, "run", "-d", "--name", "container1", "busybox", "sleep", "10")
idA := stripTrailingCharacters(out)
@ -71,7 +71,7 @@ func TestPingLinkedContainers(t *testing.T) {
logDone("links - ping linked container")
}
func TestIpTablesRulesWhenLinkAndUnlink(t *testing.T) {
func TestLinksIpTablesRulesWhenLinkAndUnlink(t *testing.T) {
cmd(t, "run", "-d", "--name", "child", "--publish", "8080:80", "busybox", "sleep", "10")
cmd(t, "run", "-d", "--name", "parent", "--link", "child:http", "busybox", "sleep", "10")
@ -96,7 +96,7 @@ func TestIpTablesRulesWhenLinkAndUnlink(t *testing.T) {
logDone("link - verify iptables when link and unlink")
}
func TestInspectLinksStarted(t *testing.T) {
func TestLinksInspectLinksStarted(t *testing.T) {
var (
expected = map[string]struct{}{"/container1:/testinspectlink/alias1": {}, "/container2:/testinspectlink/alias2": {}}
result []string
@ -125,7 +125,7 @@ func TestInspectLinksStarted(t *testing.T) {
logDone("link - links in started container inspect")
}
func TestInspectLinksStopped(t *testing.T) {
func TestLinksInspectLinksStopped(t *testing.T) {
var (
expected = map[string]struct{}{"/container1:/testinspectlink/alias1": {}, "/container2:/testinspectlink/alias2": {}}
result []string

View file

@ -7,7 +7,7 @@ import (
"testing"
)
func TestListPorts(t *testing.T) {
func TestPortList(t *testing.T) {
// one port
runCmd := exec.Command(dockerBinary, "run", "-d", "-p", "9876:80", "busybox", "top")
out, _, err := runCommandWithOutput(runCmd)

View file

@ -7,7 +7,7 @@ import (
"time"
)
func TestListContainers(t *testing.T) {
func TestPsListContainers(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "top")
out, _, err := runCommandWithOutput(runCmd)
errorOut(err, t, out)
@ -201,7 +201,7 @@ func assertContainerList(out string, expected []string) bool {
return true
}
func TestListContainersSize(t *testing.T) {
func TestPsListContainersSize(t *testing.T) {
name := "test_size"
runCmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "sh", "-c", "echo 1 > test")
out, _, err := runCommandWithOutput(runCmd)

View file

@ -7,7 +7,7 @@ import (
"time"
)
func TestDockerRestartStoppedContainer(t *testing.T) {
func TestRestartStoppedContainer(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "echo", "foobar")
out, _, err := runCommandWithOutput(runCmd)
errorOut(err, t, out)
@ -43,7 +43,7 @@ func TestDockerRestartStoppedContainer(t *testing.T) {
logDone("restart - echo foobar for stopped container")
}
func TestDockerRestartRunningContainer(t *testing.T) {
func TestRestartRunningContainer(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "sh", "-c", "echo foobar && sleep 30 && echo 'should not print this'")
out, _, err := runCommandWithOutput(runCmd)
errorOut(err, t, out)
@ -80,7 +80,7 @@ func TestDockerRestartRunningContainer(t *testing.T) {
}
// Test that restarting a container with a volume does not create a new volume on restart. Regression test for #819.
func TestDockerRestartWithVolumes(t *testing.T) {
func TestRestartWithVolumes(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-d", "-v", "/test", "busybox", "top")
out, _, err := runCommandWithOutput(runCmd)
errorOut(err, t, out)

View file

@ -7,7 +7,7 @@ import (
"testing"
)
func TestRemoveContainerWithRemovedVolume(t *testing.T) {
func TestRmContainerWithRemovedVolume(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "losemyvolumes", "-v", "/tmp/testing:/test", "busybox", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -27,7 +27,7 @@ func TestRemoveContainerWithRemovedVolume(t *testing.T) {
logDone("rm - removed volume")
}
func TestRemoveContainerWithVolume(t *testing.T) {
func TestRmContainerWithVolume(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "foo", "-v", "/srv", "busybox", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -43,7 +43,7 @@ func TestRemoveContainerWithVolume(t *testing.T) {
logDone("rm - volume")
}
func TestRemoveRunningContainer(t *testing.T) {
func TestRmRunningContainer(t *testing.T) {
createRunningContainer(t, "foo")
// Test cannot remove running container
@ -57,7 +57,7 @@ func TestRemoveRunningContainer(t *testing.T) {
logDone("rm - running container")
}
func TestForceRemoveRunningContainer(t *testing.T) {
func TestRmForceRemoveRunningContainer(t *testing.T) {
createRunningContainer(t, "foo")
// Stop then remove with -s
@ -71,7 +71,7 @@ func TestForceRemoveRunningContainer(t *testing.T) {
logDone("rm - running container with --force=true")
}
func TestContainerOrphaning(t *testing.T) {
func TestRmContainerOrphaning(t *testing.T) {
dockerfile1 := `FROM busybox:latest
ENTRYPOINT ["/bin/true"]`
img := "test-container-orphaning"
@ -110,7 +110,7 @@ func TestContainerOrphaning(t *testing.T) {
logDone("rm - container orphaning")
}
func TestDeleteTagWithExistingContainers(t *testing.T) {
func TestRmTagWithExistingContainers(t *testing.T) {
container := "test-delete-tag"
newtag := "busybox:newtag"
bb := "busybox:latest"

View file

@ -7,7 +7,7 @@ import (
"testing"
)
func TestImageRemoveWithContainerFails(t *testing.T) {
func TestRmiWithContainerFails(t *testing.T) {
errSubstr := "is using it"
// create a container
@ -38,7 +38,7 @@ func TestImageRemoveWithContainerFails(t *testing.T) {
logDone("rmi- container using image while rmi, should not remove image name")
}
func TestImageTagRemove(t *testing.T) {
func TestRmiTag(t *testing.T) {
imagesBefore, _, _ := cmd(t, "images", "-a")
cmd(t, "tag", "busybox", "utest:tag1")
cmd(t, "tag", "busybox", "utest/docker:tag2")

View file

@ -22,7 +22,7 @@ import (
)
// "test123" should be printed by docker run
func TestDockerRunEchoStdout(t *testing.T) {
func TestRunEchoStdout(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "busybox", "echo", "test123")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -39,7 +39,7 @@ func TestDockerRunEchoStdout(t *testing.T) {
}
// "test" should be printed
func TestDockerRunEchoStdoutWithMemoryLimit(t *testing.T) {
func TestRunEchoStdoutWithMemoryLimit(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-m", "2786432", "busybox", "echo", "test")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -59,7 +59,7 @@ func TestDockerRunEchoStdoutWithMemoryLimit(t *testing.T) {
}
// "test" should be printed
func TestDockerRunEchoStdoutWitCPULimit(t *testing.T) {
func TestRunEchoStdoutWitCPULimit(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-c", "1000", "busybox", "echo", "test")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -76,7 +76,7 @@ func TestDockerRunEchoStdoutWitCPULimit(t *testing.T) {
}
// "test" should be printed
func TestDockerRunEchoStdoutWithCPUAndMemoryLimit(t *testing.T) {
func TestRunEchoStdoutWithCPUAndMemoryLimit(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-c", "1000", "-m", "2786432", "busybox", "echo", "test")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -93,7 +93,7 @@ func TestDockerRunEchoStdoutWithCPUAndMemoryLimit(t *testing.T) {
}
// "test" should be printed
func TestDockerRunEchoNamedContainer(t *testing.T) {
func TestRunEchoNamedContainer(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--name", "testfoonamedcontainer", "busybox", "echo", "test")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -114,7 +114,7 @@ func TestDockerRunEchoNamedContainer(t *testing.T) {
}
// docker run should not leak file descriptors
func TestDockerRunLeakyFileDescriptors(t *testing.T) {
func TestRunLeakyFileDescriptors(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "busybox", "ls", "-C", "/proc/self/fd")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -133,7 +133,7 @@ func TestDockerRunLeakyFileDescriptors(t *testing.T) {
// it should be possible to ping Google DNS resolver
// this will fail when Internet access is unavailable
func TestDockerRunPingGoogle(t *testing.T) {
func TestRunPingGoogle(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "busybox", "ping", "-c", "1", "8.8.8.8")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -149,7 +149,7 @@ func TestDockerRunPingGoogle(t *testing.T) {
// the exit code should be 0
// some versions of lxc might make this test fail
func TestDockerRunExitCodeZero(t *testing.T) {
func TestRunExitCodeZero(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "busybox", "true")
exitCode, err := runCommand(runCmd)
errorOut(err, t, fmt.Sprintf("%s", err))
@ -165,7 +165,7 @@ func TestDockerRunExitCodeZero(t *testing.T) {
// the exit code should be 1
// some versions of lxc might make this test fail
func TestDockerRunExitCodeOne(t *testing.T) {
func TestRunExitCodeOne(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "busybox", "false")
exitCode, err := runCommand(runCmd)
if err != nil && !strings.Contains("exit status 1", fmt.Sprintf("%s", err)) {
@ -219,7 +219,7 @@ func TestRunStdinPipe(t *testing.T) {
}
// the container's ID should be printed when starting a container in detached mode
func TestDockerRunDetachedContainerIDPrinting(t *testing.T) {
func TestRunDetachedContainerIDPrinting(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "true")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -251,7 +251,7 @@ func TestDockerRunDetachedContainerIDPrinting(t *testing.T) {
}
// the working directory should be set correctly
func TestDockerRunWorkingDirectory(t *testing.T) {
func TestRunWorkingDirectory(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-w", "/root", "busybox", "pwd")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
if err != nil {
@ -281,7 +281,7 @@ func TestDockerRunWorkingDirectory(t *testing.T) {
}
// pinging Google's DNS resolver should fail when we disable the networking
func TestDockerRunWithoutNetworking(t *testing.T) {
func TestRunWithoutNetworking(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--net=none", "busybox", "ping", "-c", "1", "8.8.8.8")
out, _, exitCode, err := runCommandWithStdoutStderr(runCmd)
if err != nil && exitCode != 1 {
@ -307,7 +307,7 @@ func TestDockerRunWithoutNetworking(t *testing.T) {
}
// Regression test for #4741
func TestDockerRunWithVolumesAsFiles(t *testing.T) {
func TestRunWithVolumesAsFiles(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--name", "test-data", "--volume", "/etc/hosts:/target-file", "busybox", "true")
out, stderr, exitCode, err := runCommandWithStdoutStderr(runCmd)
if err != nil && exitCode != 0 {
@ -325,7 +325,7 @@ func TestDockerRunWithVolumesAsFiles(t *testing.T) {
}
// Regression test for #4979
func TestDockerRunWithVolumesFromExited(t *testing.T) {
func TestRunWithVolumesFromExited(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--name", "test-data", "--volume", "/some/dir", "busybox", "touch", "/some/dir/file")
out, stderr, exitCode, err := runCommandWithStdoutStderr(runCmd)
if err != nil && exitCode != 0 {
@ -343,7 +343,7 @@ func TestDockerRunWithVolumesFromExited(t *testing.T) {
}
// Regression test for #4830
func TestDockerRunWithRelativePath(t *testing.T) {
func TestRunWithRelativePath(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "-v", "tmp:/other-tmp", "busybox", "true")
if _, _, _, err := runCommandWithStdoutStderr(runCmd); err == nil {
t.Fatalf("relative path should result in an error")
@ -354,7 +354,7 @@ func TestDockerRunWithRelativePath(t *testing.T) {
logDone("run - volume with relative path")
}
func TestVolumesMountedAsReadonly(t *testing.T) {
func TestRunVolumesMountedAsReadonly(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-v", "/test:/test:ro", "busybox", "touch", "/test/somefile")
if code, err := runCommand(cmd); err == nil || code == 0 {
t.Fatalf("run should fail because volume is ro: exit code %d", code)
@ -365,7 +365,7 @@ func TestVolumesMountedAsReadonly(t *testing.T) {
logDone("run - volumes as readonly mount")
}
func TestVolumesFromInReadonlyMode(t *testing.T) {
func TestRunVolumesFromInReadonlyMode(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test", "busybox", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -382,7 +382,7 @@ func TestVolumesFromInReadonlyMode(t *testing.T) {
}
// Regression test for #1201
func TestVolumesFromInReadWriteMode(t *testing.T) {
func TestRunVolumesFromInReadWriteMode(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test", "busybox", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -398,7 +398,7 @@ func TestVolumesFromInReadWriteMode(t *testing.T) {
logDone("run - volumes from as read write mount")
}
func TestVolumesFromInheritsReadOnly(t *testing.T) {
func TestRunVolumesFromInheritsReadOnly(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test:/test:ro", "busybox", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -416,7 +416,7 @@ func TestVolumesFromInheritsReadOnly(t *testing.T) {
}
// Test for #1351
func TestApplyVolumesFromBeforeVolumes(t *testing.T) {
func TestRunApplyVolumesFromBeforeVolumes(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test", "busybox", "touch", "/test/foo")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -432,7 +432,7 @@ func TestApplyVolumesFromBeforeVolumes(t *testing.T) {
logDone("run - volumes from mounted first")
}
func TestMultipleVolumesFrom(t *testing.T) {
func TestRunMultipleVolumesFrom(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--name", "parent1", "-v", "/test", "busybox", "touch", "/test/foo")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -455,7 +455,7 @@ func TestMultipleVolumesFrom(t *testing.T) {
}
// this tests verifies the ID format for the container
func TestVerifyContainerID(t *testing.T) {
func TestRunVerifyContainerID(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-d", "busybox", "true")
out, exit, err := runCommandWithOutput(cmd)
if err != nil {
@ -478,7 +478,7 @@ func TestVerifyContainerID(t *testing.T) {
}
// Test that creating a container with a volume doesn't crash. Regression test for #995.
func TestCreateVolume(t *testing.T) {
func TestRunCreateVolume(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-v", "/var/lib/data", "busybox", "true")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -491,7 +491,7 @@ func TestCreateVolume(t *testing.T) {
// Test that creating a volume with a symlink in its path works correctly. Test for #5152.
// Note that this bug happens only with symlinks with a target that starts with '/'.
func TestCreateVolumeWithSymlink(t *testing.T) {
func TestRunCreateVolumeWithSymlink(t *testing.T) {
buildCmd := exec.Command(dockerBinary, "build", "-t", "docker-test-createvolumewithsymlink", "-")
buildCmd.Stdin = strings.NewReader(`FROM busybox
RUN mkdir /foo && ln -s /foo /bar`)
@ -533,7 +533,7 @@ func TestCreateVolumeWithSymlink(t *testing.T) {
}
// Tests that a volume path that has a symlink exists in a container mounting it with `--volumes-from`.
func TestVolumesFromSymlinkPath(t *testing.T) {
func TestRunVolumesFromSymlinkPath(t *testing.T) {
buildCmd := exec.Command(dockerBinary, "build", "-t", "docker-test-volumesfromsymlinkpath", "-")
buildCmd.Stdin = strings.NewReader(`FROM busybox
RUN mkdir /baz && ln -s /baz /foo
@ -562,7 +562,7 @@ func TestVolumesFromSymlinkPath(t *testing.T) {
logDone("run - volumes-from symlink path")
}
func TestExitCode(t *testing.T) {
func TestRunExitCode(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "/bin/sh", "-c", "exit 72")
exit, err := runCommand(cmd)
@ -578,7 +578,7 @@ func TestExitCode(t *testing.T) {
logDone("run - correct exit code")
}
func TestUserDefaultsToRoot(t *testing.T) {
func TestRunUserDefaultsToRoot(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "id")
out, _, err := runCommandWithOutput(cmd)
@ -593,7 +593,7 @@ func TestUserDefaultsToRoot(t *testing.T) {
logDone("run - default user")
}
func TestUserByName(t *testing.T) {
func TestRunUserByName(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-u", "root", "busybox", "id")
out, _, err := runCommandWithOutput(cmd)
@ -608,7 +608,7 @@ func TestUserByName(t *testing.T) {
logDone("run - user by name")
}
func TestUserByID(t *testing.T) {
func TestRunUserByID(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-u", "1", "busybox", "id")
out, _, err := runCommandWithOutput(cmd)
@ -623,7 +623,7 @@ func TestUserByID(t *testing.T) {
logDone("run - user by id")
}
func TestUserByIDBig(t *testing.T) {
func TestRunUserByIDBig(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-u", "2147483648", "busybox", "id")
out, _, err := runCommandWithOutput(cmd)
@ -638,7 +638,7 @@ func TestUserByIDBig(t *testing.T) {
logDone("run - user by id, id too big")
}
func TestUserByIDNegative(t *testing.T) {
func TestRunUserByIDNegative(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-u", "-1", "busybox", "id")
out, _, err := runCommandWithOutput(cmd)
@ -653,7 +653,7 @@ func TestUserByIDNegative(t *testing.T) {
logDone("run - user by id, id negative")
}
func TestUserByIDZero(t *testing.T) {
func TestRunUserByIDZero(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-u", "0", "busybox", "id")
out, _, err := runCommandWithOutput(cmd)
@ -668,7 +668,7 @@ func TestUserByIDZero(t *testing.T) {
logDone("run - user by id, zero uid")
}
func TestUserNotFound(t *testing.T) {
func TestRunUserNotFound(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-u", "notme", "busybox", "id")
_, err := runCommand(cmd)
@ -701,7 +701,7 @@ func TestRunTwoConcurrentContainers(t *testing.T) {
logDone("run - two concurrent containers")
}
func TestEnvironment(t *testing.T) {
func TestRunEnvironment(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-h", "testing", "-e=FALSE=true", "-e=TRUE", "-e=TRICKY", "-e=HOME=", "busybox", "env")
cmd.Env = append(os.Environ(),
"TRUE=false",
@ -744,7 +744,7 @@ func TestEnvironment(t *testing.T) {
logDone("run - verify environment")
}
func TestContainerNetwork(t *testing.T) {
func TestRunContainerNetwork(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "ping", "-c", "1", "127.0.0.1")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -756,7 +756,7 @@ func TestContainerNetwork(t *testing.T) {
}
// Issue #4681
func TestLoopbackWhenNetworkDisabled(t *testing.T) {
func TestRunLoopbackWhenNetworkDisabled(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--net=none", "busybox", "ping", "-c", "1", "127.0.0.1")
if _, err := runCommand(cmd); err != nil {
t.Fatal(err)
@ -767,7 +767,7 @@ func TestLoopbackWhenNetworkDisabled(t *testing.T) {
logDone("run - test container loopback when networking disabled")
}
func TestNetHostNotAllowedWithLinks(t *testing.T) {
func TestRunNetHostNotAllowedWithLinks(t *testing.T) {
_, _, err := cmd(t, "run", "--name", "linked", "busybox", "true")
cmd := exec.Command(dockerBinary, "run", "--net=host", "--link", "linked:linked", "busybox", "true")
@ -781,7 +781,7 @@ func TestNetHostNotAllowedWithLinks(t *testing.T) {
logDone("run - don't allow --net=host to be used with links")
}
func TestLoopbackOnlyExistsWhenNetworkingDisabled(t *testing.T) {
func TestRunLoopbackOnlyExistsWhenNetworkingDisabled(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--net=none", "busybox", "ip", "-o", "-4", "a", "show", "up")
out, _, err := runCommandWithOutput(cmd)
if err != nil {
@ -812,7 +812,7 @@ func TestLoopbackOnlyExistsWhenNetworkingDisabled(t *testing.T) {
logDone("run - test loopback only exists when networking disabled")
}
func TestPrivilegedCanMknod(t *testing.T) {
func TestRunPrivilegedCanMknod(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--privileged", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err != nil {
@ -827,7 +827,7 @@ func TestPrivilegedCanMknod(t *testing.T) {
logDone("run - test privileged can mknod")
}
func TestUnPrivilegedCanMknod(t *testing.T) {
func TestRunUnPrivilegedCanMknod(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err != nil {
@ -842,7 +842,7 @@ func TestUnPrivilegedCanMknod(t *testing.T) {
logDone("run - test un-privileged can mknod")
}
func TestCapDropInvalid(t *testing.T) {
func TestRunCapDropInvalid(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-drop=CHPASS", "busybox", "ls")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
@ -852,7 +852,7 @@ func TestCapDropInvalid(t *testing.T) {
logDone("run - test --cap-drop=CHPASS invalid")
}
func TestCapDropCannotMknod(t *testing.T) {
func TestRunCapDropCannotMknod(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-drop=MKNOD", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
@ -867,7 +867,7 @@ func TestCapDropCannotMknod(t *testing.T) {
logDone("run - test --cap-drop=MKNOD cannot mknod")
}
func TestCapDropCannotMknodLowerCase(t *testing.T) {
func TestRunCapDropCannotMknodLowerCase(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-drop=mknod", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
@ -882,7 +882,7 @@ func TestCapDropCannotMknodLowerCase(t *testing.T) {
logDone("run - test --cap-drop=mknod cannot mknod lowercase")
}
func TestCapDropALLCannotMknod(t *testing.T) {
func TestRunCapDropALLCannotMknod(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-drop=ALL", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
@ -897,7 +897,7 @@ func TestCapDropALLCannotMknod(t *testing.T) {
logDone("run - test --cap-drop=ALL cannot mknod")
}
func TestCapDropALLAddMknodCannotMknod(t *testing.T) {
func TestRunCapDropALLAddMknodCannotMknod(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-drop=ALL", "--cap-add=MKNOD", "busybox", "sh", "-c", "mknod /tmp/sda b 8 0 && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err != nil {
@ -912,7 +912,7 @@ func TestCapDropALLAddMknodCannotMknod(t *testing.T) {
logDone("run - test --cap-drop=ALL --cap-add=MKNOD can mknod")
}
func TestCapAddInvalid(t *testing.T) {
func TestRunCapAddInvalid(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-add=CHPASS", "busybox", "ls")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
@ -922,7 +922,7 @@ func TestCapAddInvalid(t *testing.T) {
logDone("run - test --cap-add=CHPASS invalid")
}
func TestCapAddCanDownInterface(t *testing.T) {
func TestRunCapAddCanDownInterface(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-add=NET_ADMIN", "busybox", "sh", "-c", "ip link set eth0 down && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err != nil {
@ -937,7 +937,7 @@ func TestCapAddCanDownInterface(t *testing.T) {
logDone("run - test --cap-add=NET_ADMIN can set eth0 down")
}
func TestCapAddALLCanDownInterface(t *testing.T) {
func TestRunCapAddALLCanDownInterface(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-add=ALL", "busybox", "sh", "-c", "ip link set eth0 down && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err != nil {
@ -952,7 +952,7 @@ func TestCapAddALLCanDownInterface(t *testing.T) {
logDone("run - test --cap-add=ALL can set eth0 down")
}
func TestCapAddALLDropNetAdminCanDownInterface(t *testing.T) {
func TestRunCapAddALLDropNetAdminCanDownInterface(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--cap-add=ALL", "--cap-drop=NET_ADMIN", "busybox", "sh", "-c", "ip link set eth0 down && echo ok")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
@ -967,7 +967,7 @@ func TestCapAddALLDropNetAdminCanDownInterface(t *testing.T) {
logDone("run - test --cap-add=ALL --cap-drop=NET_ADMIN cannot set eth0 down")
}
func TestPrivilegedCanMount(t *testing.T) {
func TestRunPrivilegedCanMount(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--privileged", "busybox", "sh", "-c", "mount -t tmpfs none /tmp && echo ok")
out, _, err := runCommandWithOutput(cmd)
@ -983,7 +983,7 @@ func TestPrivilegedCanMount(t *testing.T) {
logDone("run - test privileged can mount")
}
func TestUnPrivilegedCannotMount(t *testing.T) {
func TestRunUnPrivilegedCannotMount(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "sh", "-c", "mount -t tmpfs none /tmp && echo ok")
out, _, err := runCommandWithOutput(cmd)
@ -999,7 +999,7 @@ func TestUnPrivilegedCannotMount(t *testing.T) {
logDone("run - test un-privileged cannot mount")
}
func TestSysNotWritableInNonPrivilegedContainers(t *testing.T) {
func TestRunSysNotWritableInNonPrivilegedContainers(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "touch", "/sys/kernel/profiling")
if code, err := runCommand(cmd); err == nil || code == 0 {
t.Fatal("sys should not be writable in a non privileged container")
@ -1010,7 +1010,7 @@ func TestSysNotWritableInNonPrivilegedContainers(t *testing.T) {
logDone("run - sys not writable in non privileged container")
}
func TestSysWritableInPrivilegedContainers(t *testing.T) {
func TestRunSysWritableInPrivilegedContainers(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--privileged", "busybox", "touch", "/sys/kernel/profiling")
if code, err := runCommand(cmd); err != nil || code != 0 {
t.Fatalf("sys should be writable in privileged container")
@ -1021,7 +1021,7 @@ func TestSysWritableInPrivilegedContainers(t *testing.T) {
logDone("run - sys writable in privileged container")
}
func TestProcNotWritableInNonPrivilegedContainers(t *testing.T) {
func TestRunProcNotWritableInNonPrivilegedContainers(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "touch", "/proc/sysrq-trigger")
if code, err := runCommand(cmd); err == nil || code == 0 {
t.Fatal("proc should not be writable in a non privileged container")
@ -1032,7 +1032,7 @@ func TestProcNotWritableInNonPrivilegedContainers(t *testing.T) {
logDone("run - proc not writable in non privileged container")
}
func TestProcWritableInPrivilegedContainers(t *testing.T) {
func TestRunProcWritableInPrivilegedContainers(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--privileged", "busybox", "touch", "/proc/sysrq-trigger")
if code, err := runCommand(cmd); err != nil || code != 0 {
t.Fatalf("proc should be writable in privileged container")
@ -1054,7 +1054,7 @@ func TestRunWithCpuset(t *testing.T) {
logDone("run - cpuset 0")
}
func TestDeviceNumbers(t *testing.T) {
func TestRunDeviceNumbers(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "sh", "-c", "ls -l /dev/null")
out, _, err := runCommandWithOutput(cmd)
@ -1075,7 +1075,7 @@ func TestDeviceNumbers(t *testing.T) {
logDone("run - test device numbers")
}
func TestThatCharacterDevicesActLikeCharacterDevices(t *testing.T) {
func TestRunThatCharacterDevicesActLikeCharacterDevices(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "sh", "-c", "dd if=/dev/zero of=/zero bs=1k count=5 2> /dev/null ; du -h /zero")
out, _, err := runCommandWithOutput(cmd)
@ -1103,7 +1103,7 @@ func TestRunUnprivilegedWithChroot(t *testing.T) {
logDone("run - unprivileged with chroot")
}
func TestAddingOptionalDevices(t *testing.T) {
func TestRunAddingOptionalDevices(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--device", "/dev/zero:/dev/nulo", "busybox", "sh", "-c", "ls /dev/nulo")
out, _, err := runCommandWithOutput(cmd)
@ -1119,7 +1119,7 @@ func TestAddingOptionalDevices(t *testing.T) {
logDone("run - test --device argument")
}
func TestModeHostname(t *testing.T) {
func TestRunModeHostname(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-h=testhostname", "busybox", "cat", "/etc/hostname")
out, _, err := runCommandWithOutput(cmd)
@ -1150,7 +1150,7 @@ func TestModeHostname(t *testing.T) {
logDone("run - hostname and several network modes")
}
func TestRootWorkdir(t *testing.T) {
func TestRunRootWorkdir(t *testing.T) {
s, _, err := cmd(t, "run", "--workdir", "/", "busybox", "pwd")
if err != nil {
t.Fatal(s, err)
@ -1164,7 +1164,7 @@ func TestRootWorkdir(t *testing.T) {
logDone("run - workdir /")
}
func TestAllowBindMountingRoot(t *testing.T) {
func TestRunAllowBindMountingRoot(t *testing.T) {
s, _, err := cmd(t, "run", "-v", "/:/host", "busybox", "ls", "/host")
if err != nil {
t.Fatal(s, err)
@ -1175,7 +1175,7 @@ func TestAllowBindMountingRoot(t *testing.T) {
logDone("run - bind mount / as volume")
}
func TestDisallowBindMountingRootToRoot(t *testing.T) {
func TestRunDisallowBindMountingRootToRoot(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-v", "/:/", "busybox", "ls", "/host")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
@ -1188,7 +1188,7 @@ func TestDisallowBindMountingRootToRoot(t *testing.T) {
}
// Test recursive bind mount works by default
func TestDockerRunWithVolumesIsRecursive(t *testing.T) {
func TestRunWithVolumesIsRecursive(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "docker_recursive_mount_test")
if err != nil {
t.Fatal(err)
@ -1225,7 +1225,7 @@ func TestDockerRunWithVolumesIsRecursive(t *testing.T) {
logDone("run - volumes are bind mounted recursively")
}
func TestDnsDefaultOptions(t *testing.T) {
func TestRunDnsDefaultOptions(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "cat", "/etc/resolv.conf")
actual, _, err := runCommandWithOutput(cmd)
@ -1247,7 +1247,7 @@ func TestDnsDefaultOptions(t *testing.T) {
logDone("run - dns default options")
}
func TestDnsOptions(t *testing.T) {
func TestRunDnsOptions(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "--dns=127.0.0.1", "--dns-search=mydomain", "busybox", "cat", "/etc/resolv.conf")
out, _, err := runCommandWithOutput(cmd)
@ -1275,7 +1275,7 @@ func TestDnsOptions(t *testing.T) {
logDone("run - dns options")
}
func TestDnsOptionsBasedOnHostResolvConf(t *testing.T) {
func TestRunDnsOptionsBasedOnHostResolvConf(t *testing.T) {
resolvConf, err := ioutil.ReadFile("/etc/resolv.conf")
if os.IsNotExist(err) {
t.Fatalf("/etc/resolv.conf does not exist")
@ -1349,7 +1349,7 @@ func TestRunAddHost(t *testing.T) {
}
// Regression test for #6983
func TestAttachStdErrOnlyTTYMode(t *testing.T) {
func TestRunAttachStdErrOnlyTTYMode(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-t", "-a", "stderr", "busybox", "true")
exitCode, err := runCommand(cmd)
@ -1365,7 +1365,7 @@ func TestAttachStdErrOnlyTTYMode(t *testing.T) {
}
// Regression test for #6983
func TestAttachStdOutOnlyTTYMode(t *testing.T) {
func TestRunAttachStdOutOnlyTTYMode(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-t", "-a", "stdout", "busybox", "true")
exitCode, err := runCommand(cmd)
@ -1381,7 +1381,7 @@ func TestAttachStdOutOnlyTTYMode(t *testing.T) {
}
// Regression test for #6983
func TestAttachStdOutAndErrTTYMode(t *testing.T) {
func TestRunAttachStdOutAndErrTTYMode(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-t", "-a", "stdout", "-a", "stderr", "busybox", "true")
exitCode, err := runCommand(cmd)
@ -1396,7 +1396,7 @@ func TestAttachStdOutAndErrTTYMode(t *testing.T) {
logDone("run - Attach stderr and stdout with -t")
}
func TestState(t *testing.T) {
func TestRunState(t *testing.T) {
defer deleteAllContainers()
cmd := exec.Command(dockerBinary, "run", "-d", "busybox", "top")
@ -1463,7 +1463,7 @@ func TestState(t *testing.T) {
}
// Test for #1737
func TestCopyVolumeUidGid(t *testing.T) {
func TestRunCopyVolumeUidGid(t *testing.T) {
name := "testrunvolumesuidgid"
defer deleteImages(name)
defer deleteAllContainers()
@ -1492,7 +1492,7 @@ func TestCopyVolumeUidGid(t *testing.T) {
}
// Test for #1582
func TestCopyVolumeContent(t *testing.T) {
func TestRunCopyVolumeContent(t *testing.T) {
name := "testruncopyvolumecontent"
defer deleteImages(name)
defer deleteAllContainers()
@ -1609,7 +1609,7 @@ func TestRunExitOnStdinClose(t *testing.T) {
}
// Test for #2267
func TestWriteHostsFileAndNotCommit(t *testing.T) {
func TestRunWriteHostsFileAndNotCommit(t *testing.T) {
name := "writehosts"
cmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "sh", "-c", "echo test2267 >> /etc/hosts && cat /etc/hosts")
out, _, err := runCommandWithOutput(cmd)
@ -1636,7 +1636,7 @@ func TestWriteHostsFileAndNotCommit(t *testing.T) {
}
// Test for #2267
func TestWriteHostnameFileAndNotCommit(t *testing.T) {
func TestRunWriteHostnameFileAndNotCommit(t *testing.T) {
name := "writehostname"
cmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "sh", "-c", "echo test2267 >> /etc/hostname && cat /etc/hostname")
out, _, err := runCommandWithOutput(cmd)
@ -1663,7 +1663,7 @@ func TestWriteHostnameFileAndNotCommit(t *testing.T) {
}
// Test for #2267
func TestWriteResolvFileAndNotCommit(t *testing.T) {
func TestRunWriteResolvFileAndNotCommit(t *testing.T) {
name := "writeresolv"
cmd := exec.Command(dockerBinary, "run", "--name", name, "busybox", "sh", "-c", "echo test2267 >> /etc/resolv.conf && cat /etc/resolv.conf")
out, _, err := runCommandWithOutput(cmd)
@ -1703,7 +1703,7 @@ func TestRunWithBadDevice(t *testing.T) {
logDone("run - error with bad device")
}
func TestEntrypoint(t *testing.T) {
func TestRunEntrypoint(t *testing.T) {
name := "entrypoint"
cmd := exec.Command(dockerBinary, "run", "--name", name, "--entrypoint", "/bin/echo", "busybox", "-n", "foobar")
out, _, err := runCommandWithOutput(cmd)
@ -1717,7 +1717,7 @@ func TestEntrypoint(t *testing.T) {
logDone("run - entrypoint")
}
func TestBindMounts(t *testing.T) {
func TestRunBindMounts(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "docker-test-container")
if err != nil {
t.Fatal(err)
@ -1766,7 +1766,7 @@ func TestBindMounts(t *testing.T) {
logDone("run - bind mounts")
}
func TestMutableNetworkFiles(t *testing.T) {
func TestRunMutableNetworkFiles(t *testing.T) {
defer deleteAllContainers()
for _, fn := range []string{"resolv.conf", "hosts"} {
@ -1838,7 +1838,7 @@ func TestMutableNetworkFiles(t *testing.T) {
}
}
func TestHostsLinkedContainerUpdate(t *testing.T) {
func TestRunHostsLinkedContainerUpdate(t *testing.T) {
deleteAllContainers()
out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "--name", "c1", "busybox", "sh", "-c", "while true; do sleep 1; done"))
if err != nil {
@ -2013,7 +2013,7 @@ func TestRunPortInUse(t *testing.T) {
}
// Regression test for #7792
func TestMountOrdering(t *testing.T) {
func TestRunMountOrdering(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "docker_nested_mount_test")
if err != nil {
t.Fatal(err)