Add integration test for volumes-from as file

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-03-31 17:41:40 +00:00
Родитель a57900e35f
Коммит 28015f8e57
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -253,3 +253,21 @@ func TestDockerRunWithoutNetworking(t *testing.T) {
logDone("run - disable networking with --networking=false")
logDone("run - disable networking with -n=false")
}
// Regression test for #4741
func TestDockerRunWithVolumesAsFiles(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 {
t.Fatal("1", out, stderr, err)
}
runCmd = exec.Command(dockerBinary, "run", "--volumes-from", "test-data", "busybox", "cat", "/target-file")
out, stderr, exitCode, err = runCommandWithStdoutStderr(runCmd)
if err != nil && exitCode != 0 {
t.Fatal("2", out, stderr, err)
}
deleteAllContainers()
logDone("run - regression test for #4741 - volumes from as files")
}