зеркало из https://github.com/microsoft/docker.git
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:
Родитель
a57900e35f
Коммит
28015f8e57
|
@ -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")
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче